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 1jYtSl-0007kh-Mi for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 15:38:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYtSk-0002N7-Ie for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 15:38:26 +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 1jYtSk-0002N0-BY for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 15:38:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYtSi-0007e8-70 for pgsql-hackers@postgresql.org; Wed, 13 May 2020 15:38:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04DFcFed002669; Wed, 13 May 2020 11:38:15 -0400 From: Tom Lane To: Tomas Vondra cc: Fujii Masao , Alvaro Herrera , Masahiko Sawada , "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics In-reply-to: <20200513152846.goee2c5xrly52ga2@development> References: <20200502000818.nn4kpewiput42bnb@development> <49b8ad17-f6d9-a086-a952-ff1fec3ac1b3@oss.nttdata.com> <20200502105500.hwhba3d6s3hlrqf6@development> <20200502165905.brfxv6dk5vjdbgti@development> <976bbb73-a112-de3c-c488-b34b64609793@oss.nttdata.com> <20200513082159.myflgcs5fnhnujbk@development> <32135.1589379999@sss.pgh.pa.us> <20200513152846.goee2c5xrly52ga2@development> Comments: In-reply-to Tomas Vondra message dated "Wed, 13 May 2020 17:28:46 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2667.1589384295.1@sss.pgh.pa.us> Date: Wed, 13 May 2020 11:38:15 -0400 Message-ID: <2668.1589384295@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > I think it counts as a variable with "static storage duration" per 6.7.8 > (para 10), see [1]. I wasn't aware of this either, but it probably means > the memset is unnecessary. > Also, it seems a bit strange/confusing to handle this differently from > BgWriterStats. And that worked fine without the init for years ... Yeah, exactly. There might be merit in memsetting it if we thought that it could have become nonzero in the postmaster during a previous shmem cycle-of-life. But the postmaster really shouldn't be accumulating such counts; and if it is, then we have a bigger problem, because child processes would be inheriting those counts via fork. I think this change is unnecessary and should be reverted to avoid future confusion about whether somehow it is necessary. regards, tom lane