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 1mXjYG-0003Po-8X for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Oct 2021 12:28:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mXjYF-0001cx-5Y for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Oct 2021 12:28:07 +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 1mXjYE-0001cp-Tr for pgsql-hackers@lists.postgresql.org; Tue, 05 Oct 2021 12:28:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXjYC-0002Fh-BF for pgsql-hackers@lists.postgresql.org; Tue, 05 Oct 2021 12:28:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 195CRxuZ4055758; Tue, 5 Oct 2021 08:27:59 -0400 From: Tom Lane To: Bharath Rupireddy cc: bt21tanigaway , PostgreSQL Hackers Subject: Re: Fix pg_log_backend_memory_contexts() 's delay In-reply-to: References: <0aae3e074face409b35153451be5cc11@oss.nttdata.com> Comments: In-reply-to Bharath Rupireddy message dated "Tue, 05 Oct 2021 16:05:04 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <4055756.1633436879.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 05 Oct 2021 08:27:59 -0400 Message-ID: <4055757.1633436879@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bharath Rupireddy writes: > On Tue, Oct 5, 2021 at 2:50 PM bt21tanigaway > wrote: >> Log output takes time between several seconds to a few tens when using >> ‘SELECT pg_log_backend_memory_contexts(1234)’ with PID of ‘autovacuum >> launcher’. >> I made a patch for this problem. > 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? It's not real clear to me why we need to care about this in those processes' idle loops. Their memory consumption is unlikely to be very interesting in that state, nor could it change before they wake up. regards, tom lane