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 1jYssW-0006Zn-RZ for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 15:01:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYssV-000178-Pi for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 15:00:59 +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 1jYspP-0001aj-6o for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 14:57:47 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jYspM-0007IX-8o for pgsql-hackers@postgresql.org; Wed, 13 May 2020 14:57:46 +0000 Received: by mail-wr1-x443.google.com with SMTP id y16so14113230wrs.3 for ; Wed, 13 May 2020 07:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=sI58yLDUwn52+GiEVHYbE/KjgpkJbElJ3LnKJxbW35c=; b=D39mnX0BvbuI+LeHFRXdN7Vqp6kjBRSu2OGlLv0ySGt+QOVTGBaJteGmk6K1ExqDJA NuHQtVo68VZhzlmZjmCDRCcnSdGV+E39b5euLRaV3xWfKI0bcfPiX3QlFG5VROyYhYmc g+M5B1mzuydLL+gKIG36XBWnvojJUCUP7x4u72vpZTS4PV+BUlCn0NbHoD8hzxwTy5/D o8w95ZhkDsDW49V9QeluEeMBAEyz3eRZFiCZYw7yQ8yFFNHyorMgIoSYAkmKPYPGcPLJ xsCEjOVr9cQUqFfSALkhQYiHGI2nzF72CYZ0JdgDeMzf75e6OwjZyxAPCbajylpGgs8+ WqXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sI58yLDUwn52+GiEVHYbE/KjgpkJbElJ3LnKJxbW35c=; b=JM2dtW+rpNw9ccJ9qdd9nAZ5w2yEooFg/TV+MSq+I6XZGGHqIlcS4kFmtcWTC6Hmr8 WkjifIKVchC9ZgmGS0vjl5v5bStxPFj0hlHEJfZD5AlSbPCyU/XrkqFMhlZwofZg51M4 oSRZwCIfdgb2RN2q50cniQqG6+eBHv76XolAVHQuPne40jhFcQHENJQTUta3ckJ8w9Fq 8xir9qQpK3olH80XeO2+EC5BynCt0DT4g9tOAEtsWMsddG9QOuHzcEzUQlRqxkIFj9Wj DMGtUykKexAtuF7vTPTlKQTFUHxzNIRMoysHzWuNBJDH7PxjYc0BaBNF0XU/+JHJN51v n8UQ== X-Gm-Message-State: AGi0PuYNsDM3bSxdMFpOETysYq8n1f2ZrI5ogalN2k469oY3CqoBuq1I M8WeVPs5QVj70xz0/PJ0JzbG7g== X-Google-Smtp-Source: APiQypLlZ7Sbs2BPjeI7EvP5jNrPc2fp1JN7tlUT0qLNpXCU5RgfkHZPvZP8+Cmb8K86JN9H/V+n8Q== X-Received: by 2002:adf:dcc6:: with SMTP id x6mr30978786wrm.126.1589381863296; Wed, 13 May 2020 07:57:43 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id p10sm5654326wrn.10.2020.05.13.07.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 07:57:42 -0700 (PDT) Date: Wed, 13 May 2020 16:57:39 +0200 From: Tomas Vondra To: Tom Lane Cc: Fujii Masao , Alvaro Herrera , Masahiko Sawada , "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics Message-ID: <20200513145739.wlnbse5rw3vvscyr@development> References: <0e1c8904-13be-ab70-0096-54f0b30e43ba@oss.nttdata.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <32135.1589379999@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, May 13, 2020 at 10:26:39AM -0400, Tom Lane wrote: >Fujii Masao writes: >> On 2020/05/13 17:21, Tomas Vondra wrote: >>> On Wed, May 13, 2020 at 04:10:30PM +0900, Fujii Masao wrote: >>>> Also I found another minor issue; SLRUStats has not been initialized to 0 >>>> and which could update the counters unexpectedly. Attached patch fixes >>>> this issue. > >> Pushed both. Thanks! > >Why is that necessary? A static variable is defined by C to start off >as zeroes. > But is it a static variable? It's not declared as 'static' but maybe we can assume it inits to zeroes anyway? I see we do that for BgWriterStats. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services