Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYro3-0005bE-E3 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Oct 2021 15:29:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mYro2-0002wn-Ac for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Oct 2021 15:29:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYro2-0002wc-2X for pgsql-hackers@lists.postgresql.org; Fri, 08 Oct 2021 15:29:06 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYrnz-00087H-46 for pgsql-hackers@lists.postgresql.org; Fri, 08 Oct 2021 15:29:05 +0000 Received: from hrk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id 90EDA6009A; Sat, 9 Oct 2021 00:28:57 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com Subject: Re: Fix pg_log_backend_memory_contexts() 's delay To: bt21tanigaway , Michael Paquier Cc: Robert Haas , Tom Lane , Bharath Rupireddy , PostgreSQL Hackers References: <0aae3e074face409b35153451be5cc11@oss.nttdata.com> <4055757.1633436879@sss.pgh.pa.us> <1accf2ba3912f3f59a60ef90b5411433@oss.nttdata.com> From: Fujii Masao Message-ID: <52ff4115-961c-7803-635f-d27b8e9b9ee2@oss.nttdata.com> Date: Sat, 9 Oct 2021 00:28:57 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <1accf2ba3912f3f59a60ef90b5411433@oss.nttdata.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/10/06 17:14, bt21tanigaway wrote: > Thanks for your review. > >>> Thanks for the patch. Do we also need to do the change in >>> HandleMainLoopInterrupts, HandleCheckpointerInterrupts, >>> HandlePgArchInterrupts, HandleWalWriterInterrupts as we don't call >>> CHECK_FOR_INTERRUPTS() there? > >> Yeah, that's still some information that the user asked for.  Looking >> at the things that have a PGPROC entry, should we worry about the main >> loop of the logical replication launcher? > > ・Now, the target of “pg_log_backend_memory_contexts()” is “autovacuum launcher” and “logical replication launcher”.  I observed that the delay occurred only in “autovacuum launcher” not in “logical replication launcher”. > ・”autovacuum launcher” used “HandleAutoVacLauncherInterrupts()” ( not including “ProcessLogMemoryContextInterrupt()” ) instead of “ProcessInterrupts() ( including “ProcessLogMemoryContextInterrupt()” ). “ProcessLogMemoryContextInterrupt()” will not be executed until the next “ProcessInterrupts()” is executed. So, I added “ProcessLogMemoryContextInterrupt()”. > ・”logical replication launcher” uses only “ProcessInterrupts()”. So, We don’t have to fix it. Yes. >> IMHO, we can support all the processes which return a PGPROC entry by >> both BackendPidGetProc and AuxiliaryPidGetProc where the >> AuxiliaryPidGetProc would cover the following processes. I'm not sure >> one is interested in the  memory context info of auxiliary processes. I like this idea because it seems helpful at least for debug purpose. > ・The purpose of this patch is to solve the delay problem, so I would like another patch to deal with “ BackendPidGetProc” and “AuxiliaryPidGetProc”. +1 to improve those things separately. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION