pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Yuhang Qiu <iamqyh@gmail.com>
To: Palak Chaturvedi <chaturvedipalak1911@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: pgsql-hackers@postgresql.org, Heikki Linnakangas <heikki.linnakangas@databricks.com>
Cc: Haoyu Huang <haoyu.huang@databricks.com>
Cc: Tomas Vondra <tomas@vondra.me>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Jakub Wartak <jakub.wartak@enterprisedb.com>
Subject: Re: Changing shared_buffers without restart
Date: Fri, 11 Sep 2026 18:56:28 +0800
Message-ID: <8E7D0939-ADE1-405A-91D2-0139A6E322B3@gmail.com> (raw )
In-Reply-To: <CALfch18bfYdXz1E7OZO45ECKN9Sn=L-tYXg=mhWa0b2k3c7Qnw@mail.gmail.com >
References: <gzb2oqqabzqidlnumrbau2k2fscb5jo6nlpdjnf6pu5y4bk5mo@xoujqgtiqvgr >
<CAExHW5uGozdiDm_BefS7jpQzaisCs4_nLTMF0+S_Pds49pRG_w@mail.gmail.com >
<ufa7sghbf3fv7jobgd4yc5am4lzqf7bn2cigqv6cpi6vtkmbah@flj6n76hdgab >
<CA+hUKG+KFbOhPudfcuHaa4TPsZxQ053LnXri2vYfeFNTo+WYjQ@mail.gmail.com >
<CA+hUKGLfdc6gbXc0bE6R_TukCMzbKLvgjZsLtfyPxQOnOaGivw@mail.gmail.com >
<kwvbsat7reeopjhwopfypwdhsfrcev7nmmltec5ec6zzkjol5o@itpqaokfw7kb >
<CA+hUKGLQhsZ1dEf5Zo6JuPbs6n-qX=cTGy49feKf1iFA_TBP1g@mail.gmail.com >
<CAExHW5v9cE+ETusTafZyvy+eVpnVvoayVm7ZOk4Ddq8fxY270A@mail.gmail.com >
<CAExHW5sYg_d4O7oGRqbomnVODeqR3YNAeYAa526n1dsWCM=+Fg@mail.gmail.com >
<CAExHW5vB8sAmDtkEN5dcYYeBok3D8eAzMFCOH1k+krxht1yFjA@mail.gmail.com >
<qltuzcdxapofdtb5mrd4em3bzu2qiwhp3cdwdsosmn7rhrtn4u@yaogvphfwc4h >
<CAExHW5sOu8+9h6t7jsA5jVcQ--N-LCtjkPnCw+rpoN0ovT6PHg@mail.gmail.com >
<CAExHW5sVxEwQsuzkgjjJQP9-XVe0H2njEVw1HxeYFdT7u7J+eQ@mail.gmail.com >
<CAExHW5s8s=UhjqNa_Tz1PFCRLzt3=5nvd5vD1wFdKWMQCmFySQ@mail.gmail.com >
<CAKZiRmwxVqEbp7JgOed=BCT6cq8RNuHk3N0vuwro65Tsw9E8NA@mail.gmail.com >
<CAExHW5vEfDQuqgV0Z_8=5htZTt186VioD+d2YtszywegAag5=Q@mail.gmail.com >
<CAKZiRmy-ou3p9r7=ejARZMFEa8-eXwOPEVJd2Q8XqHrhSnTRag@mail.gmail.com >
<CAExHW5stjJP7eOspBJEhkPb4ODYALSkMZyurb5AaWwOt8_umSw@mail.gmail.com >
<CAKZiRmxfT7n0whHkLqtPkyUq_coH=UYP9fQ3V6Xv+2bug-XJSw@mail.gmail.com >
<CAExHW5uX2LGwWHaeZu5XqK-83NwzUzpSAXn6hT+xx9X=21tweA@mail.gmail.com >
<CAExHW5tYUYY13b4S1fv-zdxNsEEJzTy1EW6mRUj+FFEpA4Q0=g@mail.gmail.com >
<CAExHW5ts93Rnof7pjFFYrY9aTOmCo+xsdQazqeqN1BaKozTBvA@mail.gmail.com >
<B6CC6AF0-F7B3-4389-9740-DD1288EC15DB@gmail.com >
<CALfch1_s98q32Ch3mo9J+kN0ycuGvLD-24fjVoQOAX1QyKGRNw@mail.gmail.com >
<78DD860A-DD0E-4B70-A0CA-EE5CCA3E0E60@gmail.com >
<CALfch1_K04G39nNrZCBw+pbqG4aXMXsAcv04A_MRhEtjJi2T8A@mail.gmail.com >
<4E5726E6-D640-4E2E-8860-5A2DDDABC35D@gmail.com >
<CALfch18bfYdXz1E7OZO45ECKN9Sn=L-tYXg=mhWa0b2k3c7Qnw@mail.gmail.com >
Hi Palak,
> Yes. v20260908-0016 rechecks BM_TAG_VALID under LockBufHdr() and does
> UnlockBufHdr() + continue instead of asserting when the tag was
> cleared concurrently.
>
> Right, that line predates the MADV_REMOVE range fix. Removed it in
> v20260908-0015.
Thanks. 0015 and 0016 LGTM.
I also tested the patches and did some more review.
With shared_buffers=32MB and max_shared_buffers left at its default, parallel
workers fail to start, even without any resize:
FATAL: failed to initialize shared_buffers to 16384
CONTEXT: parallel worker
RestoreGUCState() resets the GUC to its 128MB boot value, which exceeds
MaxNBuffers and fails the check hook.
There is also a performance issue in the grow path:
PGSharedMemoryEnsureAllocated() gets the whole structure's range, rather than
just the added range. Even a small increase makes MADV_POPULATE_WRITE walk the
existing range again, adding overhead for large buffer pools. Could we limit
this to the page-aligned [current_end, new_end), as in the shrink path?
Two minor points:
* check_shared_buffers() allows equality with MaxNBuffers, so "must be less than"
should be "must not exceed".
* In proc.c, "specifid there" should be "specified there".
Some issues raised in earlier reviews remain unaddressed. Could you include a
status list with the next update, separating resolved and unresolved items?
That would help reviewers who are new to the thread or haven't followed it for
a while.
Best regards,
Yuhang Qiu
view thread (167+ messages) latest in thread
Message-ID: <8E7D0939-ADE1-405A-91D2-0139A6E322B3@gmail.com>
Permalink: ../8E7D0939-ADE1-405A-91D2-0139A6E322B3@gmail.com/
Also on: postgresql.org/message-id/8E7D0939-ADE1-405A-91D2-0139A6E322B3@gmail.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: iamqyh@gmail.com, chaturvedipalak1911@gmail.com, ashutosh.bapat.oss@gmail.com, heikki.linnakangas@databricks.com, haoyu.huang@databricks.com, tomas@vondra.me, peter@eisentraut.org, thomas.munro@gmail.com, 9erthalion6@gmail.com, robertmhaas@gmail.com, andres@anarazel.de, jakub.wartak@enterprisedb.com
Subject: Re: Changing shared_buffers without restart
In-Reply-To: <8E7D0939-ADE1-405A-91D2-0139A6E322B3@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox