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 1jYu1N-0000Iq-Rd for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 16:14:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYu1M-0006KN-NT for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 16:14:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYu1M-0006KF-G3 for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 16:14:12 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jYu1K-0005Au-BZ for pgsql-hackers@postgresql.org; Wed, 13 May 2020 16:14:11 +0000 Received: by mail-qt1-x842.google.com with SMTP id r8so232289qtm.11 for ; Wed, 13 May 2020 09:14:10 -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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=gJRkDyoQWrM7SJ9UNVtXLxo2B/yajzGmh81GVRRAJwI=; b=2GMr/SsJhbvenw8A7Wb4dShzHOw6JX917MHly+EhNTwVSu7r/hnpQPqV3326k4sEgZ pRjYsGR4zrE7cngSOX5BZyefCjTOSo19BpAw6EC+3MIaz7V1LzsZE2rK95SN/WNsjydT CN1ZQIXDmqMjZwXdZdiqDIcm9CR9RK2kkYZ0brLiWmaeHMcR87uvHMJgBYcqie5mFTSu HEzzoTSgOomK97Kw7tfOEegyEfFyNCQrhRxLYAmHQXzGmKrnmqRAnVKWcIzB28Sv5Xa4 yFPpiaUgTmPRaZhwFAulCLiytg16yVZLpw7fYnWe0bxNjZ2QtJZzp+8iUPcMduf5kbjg 7Oxg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=gJRkDyoQWrM7SJ9UNVtXLxo2B/yajzGmh81GVRRAJwI=; b=QKb2ufaJJ1zRlNLA0pFi6s+Co+uy/twsd22InYEkUR66TK6r1hdKsABKzcL6gwGgDs dgIwn6C9lL24d/z9fQ2Lgh2H1pI2yiZ7G9HX2pBLZWBE3cBNNLL11VCjgBW3BFFIbn7p SUek+VL+Xnj7mkxlqLqYlhTTr7CvUKD1BfBbJGVp+kp0ZP2xtE4Oo4yI8jKSJmcltMEc y85Cu1njVzMDq6fXITfa+ZQ0eO70rDmoYvWQb748QeE+7+3x+L4t7X62cISecAIPxrtb AUWXH0dn6jOH0ASmGaajcKTRcVcmjsMHNN4jcakpm7u2NTfNJ7XP+CBViWzmvXGiMgjQ XLDw== X-Gm-Message-State: AGi0PubzebZPNzFvlSB92liqyFgUSFkCVaKW5Iv+dcV6pYSPSaWp3qxX FkByVXt+iu+V7dfV0lRp2PaN3w== X-Google-Smtp-Source: APiQypKRFxTL5OXifLulnv4TRXpEoCeA2+OZ7HWdRdMhzkB4bAfi2rcrclAiyz4hndW8IP9lcdwzaA== X-Received: by 2002:ac8:4809:: with SMTP id g9mr28472711qtq.33.1589386449361; Wed, 13 May 2020 09:14:09 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id d7sm204327qkk.26.2020.05.13.09.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 09:14:07 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0DFF73005C3; Wed, 13 May 2020 12:14:06 -0400 (-04) Date: Wed, 13 May 2020 12:14:06 -0400 From: Alvaro Herrera To: Fujii Masao Cc: Tom Lane , Tomas Vondra , Masahiko Sawada , "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics Message-ID: <20200513161406.GA437@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-May-14, Fujii Masao wrote: > So I tried the similar test again and found that postmaster seems to be > able to increment the counters unless I'm missing something. > For example, > > frame #2: 0x000000010d93845f postgres`pgstat_count_slru_page_zeroed(ctl=0x000000010de27320) at pgstat.c:6739:2 > frame #3: 0x000000010d5922ba postgres`SimpleLruZeroPage(ctl=0x000000010de27320, pageno=0) at slru.c:290:2 > frame #4: 0x000000010d6b9ae2 postgres`AsyncShmemInit at async.c:568:12 > frame #5: 0x000000010d9da9a6 postgres`CreateSharedMemoryAndSemaphores at ipci.c:265:2 > frame #6: 0x000000010d93f679 postgres`reset_shared at postmaster.c:2664:2 > frame #7: 0x000000010d93d253 postgres`PostmasterMain(argc=3, argv=0x00007fad56402e00) at postmaster.c:1008:2 Umm. I have the feeling that we'd rather avoid these updates in postmaster, per our general rule that postmaster should not touch shared memory. However, it might be that it's okay in this case, as it only happens just as shmem is being "created", so other processes have not yet had any time to mess things up. (IIRC only the Async module is doing that.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services