Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4yvz-007Xcs-05 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 10:56:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4yvx-00E5um-0k for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 10:56:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4yvw-00E5ud-2p for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 10:56:40 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4yvv-000000057Uo-0PSI for pgsql-hackers@postgresql.org; Fri, 11 Sep 2026 10:56:40 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-852c481415fso968472b3a.3 for ; Fri, 11 Sep 2026 03:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789124198; x=1789728998; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=WVxWHRR3AjgJTIcjb9S/tAcbNXvS8ZlBPXSyYf2K/P8=; b=nRFvDIYkflLReFb6R0455XPnEDGH1PuzPjZ3uAA/kzAuQeZ9ncYuaiu0JZg2A7BDAZ vUiw5//kBrhl0iew9WcJGQsl+mCcQl3X6l1ShUONW42zyAHNBYx5B8kGIg4w0kWUGUhH bHgsbHNibw3oUaicwVufHA/jB+I2qY0Pql9N4lKirzbmLfIGa1MBVFvtuv38tGrShKj+ IihELbk77XzngehEt0iUoCCtpRZVU5old5Z1nSwtS0BARduUPLiHXHo+YzqAWNI5JOZ7 oy5txkQAME4gQA61M9/kN5Qnv/Pbc7ijVXJajxX2wxG80VjptSi7IAG/DcQrsacyCPpX BXiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789124198; x=1789728998; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WVxWHRR3AjgJTIcjb9S/tAcbNXvS8ZlBPXSyYf2K/P8=; b=dm6GVTE7K/t6aeC5LhsePdmuOJqpnJqpop5Pl55nQhBt4QyZMXvZYrdEynQRq6sc7N IRcQ6oFcKQ1bJI4m2bZu9C3Va4L1I8biIWypLzxDajlSekinDKY56EWl02pfFcRg7ThT 1pZTdrNJMEx08UUojSPkdY+CtnHOGWVlwByrnvPY0OxXfL8vlUDLd3U3RXATpidAvG7H Lw/m1wgXs0yZJqXHpGdjZz4BXJF46qjG0n3ZsSNgI+phco8GbCNDO647nbCPCO4M31UL t8NTfzPFPoQNj8IGI2AFW67eTimpk6/ywtZF0o32Mj/BA0yOkzuzymH+custHEI2PmbV ecog== X-Forwarded-Encrypted: i=1; AKwUvBzPcFEDLMqsz4T7jP5Md/vI9VWI9rvORjtsswtvGgv3Uc12u1aHPq/FiUBsnjK+b9e1w65B9YrI/prYEJO9@postgresql.org X-Gm-Message-State: AFuF++l1c2B1sLudFq17dlNXyFtvuTALmGJvUo5p34Vz/eV3UUDXB0q2 9JGroQDfFMF9mpzVUCDB2IrI96gZMwMSQNjW1nUKvQbWwUpWXFRt96bB X-Gm-Gg: AYBFou3anch6w8Hseo/ImYcIdEtImJPCFZ6DtNSfqTIPbQvoCNmqOlqEZqqf6IBoTZ5 OqXeQiuVMI69PzvzxnOzvuZsMTsit1cuDFhyX/S7O+7YevrQjrs8GkUiyxJpufHBbGAtOIau4/g HTrFT3Qy0fLOnpwoiIGIQbMl2WzjXsTmyJI0+2Rr3OI5zOihRD3qK+oHOiMNFX87YGW/kmCVOz9 AloIwG+fF45BIM+4yz+Gymp8AkaRLWBZgoZGYwvhyTpyFEszZMH4URp/wLXKIfZZKGuRvFLPBnR HCUyXnntatJPbqY9ClFy7iSXs81wENueAkJ5Nb4Z/sG3m9plSopGYSa3fje3i9lMZfWTSHORqJp KAMNfrLt8QLKe3PU6FLfDooWXAhEAy4dExsuTdfoKaHNDFgwulMIyeqj9S/7bEObVNLoMjWsk/H X0anBEQWjf5dj5pXbOPTCVKGXPKsNekcKo2OC0KgLQtpR1P8R8A39//L4EmaA7JO8hF1JpoWbuw vfw4wHWa1ey+v8= X-Received: by 2002:a05:6a20:a12c:b0:3d3:b02a:7252 with SMTP id adf61e73a8af0-3daed4222c1mr6507431637.28.1789124197912; Fri, 11 Sep 2026 03:56:37 -0700 (PDT) Received: from smtpclient.apple ([107.151.175.2]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4e9a8a9sm5718793eec.13.2026.09.11.03.56.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2026 03:56:37 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.1\)) Subject: Re: Changing shared_buffers without restart From: Yuhang Qiu In-Reply-To: Date: Fri, 11 Sep 2026 18:56:28 +0800 Cc: Ashutosh Bapat , pgsql-hackers@postgresql.org, Heikki Linnakangas , Haoyu Huang , Tomas Vondra , Peter Eisentraut , Thomas Munro , Dmitry Dolgov <9erthalion6@gmail.com>, Robert Haas , Andres Freund , Jakub Wartak Content-Transfer-Encoding: quoted-printable Message-Id: <8E7D0939-ADE1-405A-91D2-0139A6E322B3@gmail.com> References: <78DD860A-DD0E-4B70-A0CA-EE5CCA3E0E60@gmail.com> <4E5726E6-D640-4E2E-8860-5A2DDDABC35D@gmail.com> To: Palak Chaturvedi X-Mailer: Apple Mail (2.3864.700.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Palak, > Yes. v20260908-0016 rechecks BM_TAG_VALID under LockBufHdr() and does > UnlockBufHdr() + continue instead of asserting when the tag was > cleared concurrently. >=20 > 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=3D32MB 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