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 1mY24w-00018o-OO for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Oct 2021 08:15:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mY24t-0000gi-8M for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Oct 2021 08:15:03 +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 1mY24t-0000ga-0O for pgsql-hackers@lists.postgresql.org; Wed, 06 Oct 2021 08:15:03 +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 1mY24n-0003rB-Mb for pgsql-hackers@lists.postgresql.org; Wed, 06 Oct 2021 08:15:02 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 4F1AF6077C; Wed, 6 Oct 2021 17:14:51 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 06 Oct 2021 17:14:51 +0900 From: bt21tanigaway To: Michael Paquier Cc: Robert Haas , Tom Lane , Bharath Rupireddy , PostgreSQL Hackers Subject: Re: Fix pg_log_backend_memory_contexts() 's delay In-Reply-To: References: <0aae3e074face409b35153451be5cc11@oss.nttdata.com> <4055757.1633436879@sss.pgh.pa.us> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <1accf2ba3912f3f59a60ef90b5411433@oss.nttdata.com> X-Sender: bt21tanigaway@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. > 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. ・The purpose of this patch is to solve the delay problem, so I would like another patch to deal with “ BackendPidGetProc” and “AuxiliaryPidGetProc”. Regards, Koyu Tanigawa