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 1msdN7-0005w9-QX for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 04:07:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msdN6-0007z7-Nc for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 04:07:00 +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 1msdN6-0007yy-Dh for pgsql-hackers@lists.postgresql.org; Thu, 02 Dec 2021 04:07:00 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1msdN3-0005xo-Nu for pgsql-hackers@postgresql.org; Thu, 02 Dec 2021 04:07:00 +0000 Received: by mail-io1-xd33.google.com with SMTP id x10so33775534ioj.9 for ; Wed, 01 Dec 2021 20:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MRoSTp/bjNOhp421vlZ8JAJOJrskuCgc3FCJvykfbHI=; b=7GBam5VUQeL2nQBFD8EbT/DWlOWHJhJxtmPN8w7WjPBCWIqd2BCEKGHsEuMxdToTuo XUF/DCQ8a8SXLyIWpB4vQ2kOHpGtV1R/Ji/joCF0xLlznWrFepSx34eIhGidr6KiDQpd e48wlRUNTmvVvi2VCRlLjKV769+mdQHYnzpNRaEET6L1uMLHDuQLjlSkRabTg2LKUoBP rA2fQ3vPONr3XEOYxuLyL+7c+PEAqYphmqDEI1kJ0HBPcylf6MOkjCVMeETO7dgtXOQt HhZ5YEf2mXntz4UltVwmhGvHliNeplmG//Tj1ZS24jYuIPrUXSNOXn6rFfPr9QzLExLQ 4NxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MRoSTp/bjNOhp421vlZ8JAJOJrskuCgc3FCJvykfbHI=; b=A2P5l6UeaZNBjB0bUZ/7NCSRoyRcQianL1j2qGW2edJ4R5riuY/DSkPKkH/CueSrcP PIVpzbbVbR91kOcrVuMfvGu6BOQo3WeJkz/BTmcgJuh+RAapLk5snSxigE56HS0wj51o wciL7Qj4UgegEmvTKUbNgx+rgT/o2vpG6kaiqhooTlRiD+MU5+5uD1ZTXPH6oaUv/3hi HOZDRVq3SfGEi62OydJy0KZ1gLgDPPouYCDwuwQpZ10Yqg21BMgnvRZZ6MVxfAY9Dbd4 A+4qlq11QQPb7yHC2TcSsLM7rrrI+zcGzCMUQ0LL+twzkwtwhTQ1emmegYiQwaqhQ447 FYiA== X-Gm-Message-State: AOAM532ZKBZzY9Ldy4IifL5aLFjA1VGD5ANPuv9hFnJNMzH7sdbdF08S Qt+ZVXhGnQZn/SJJmTqHxvMdCA== X-Google-Smtp-Source: ABdhPJybl2BNn1gf0oXJhMl2SmAZDzyClVWafj+8X+K3JkRv2d+dqQuZUV4/HutLWGISa4G7IjJ1zQ== X-Received: by 2002:a5e:cb0d:: with SMTP id p13mr12986106iom.71.1638418015963; Wed, 01 Dec 2021 20:06:55 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x13sm1053777ilp.43.2021.12.01.20.06.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Dec 2021 20:06:55 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 28AA2800AE5; Wed, 1 Dec 2021 22:06:53 -0600 (CST) Date: Wed, 1 Dec 2021 22:06:53 -0600 From: Justin Pryzby To: Melanie Plageman Cc: Andres Freund , Alvaro Herrera , Kyotaro Horiguchi , Magnus Hagander , pgsql-hackers@postgresql.org, Lukas Fittl , Thomas Munro Subject: Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?) Message-ID: <20211202040653.GM17618@telsasoft.com> References: <202109302315.65qtfrmgbpzt@alvherre.pgsql> <20211008175620.nspjy6wwmzvyzkrg@alap3.anarazel.de> <20211019192931.eeeohw6yrvqe6bol@alap3.anarazel.de> <20211119164952.mlw7ecj4xxliuuut@alap3.anarazel.de> <20211125011559.GC17618@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 01, 2021 at 04:59:44PM -0500, Melanie Plageman wrote: > Thanks for the review! > > On Wed, Nov 24, 2021 at 8:16 PM Justin Pryzby wrote: > > You wrote beentry++ at the start of two loops, but I think that's wrong; it > > should be at the end, as in the rest of the file (or as a loop increment). > > BackendStatusArray[0] is actually used (even though its backend has > > backendId==1, not 0). "MyBEEntry = &BackendStatusArray[MyBackendId - 1];" > > I've fixed this in v16 which I will attach to the next email in the thread. I just noticed that since beentry++ is now at the end of the loop, it's being missed when you "continue": + if (beentry->st_procpid == 0) + continue; Also, I saw that pgindent messed up and added spaces after pointers in function declarations, due to new typedefs not in typedefs.list: -pgstat_send_buffers_reset(PgStat_MsgResetsharedcounter *msg) +pgstat_send_buffers_reset(PgStat_MsgResetsharedcounter * msg) -static inline void pg_atomic_inc_counter(pg_atomic_uint64 *counter) +static inline void +pg_atomic_inc_counter(pg_atomic_uint64 * counter) -- Justin