Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-05 Thread Robert Haas
On Fri, Jul 11, 2025 at 3:48 PM Greg Burd wrote: > I briefly considered how one might use what was left after surgery to produce > some similar boolean signal to no avail. I think that autoprewarm was simply > trying to at most warm NBuffers then stop. The freelist at startup was just > a con

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-05 Thread Greg Burd
On Fri, Sep 5, 2025, at 12:27 PM, Andres Freund wrote: > Hi, > > On 2025-09-04 13:24:00 -0400, Greg Burd wrote: >> On Thu, Sep 4, 2025, at 12:59 PM, Andres Freund wrote: >> > Hi, >> > >> > On 2025-08-27 15:42:48 -0400, Greg Burd wrote: >> >> Regardless, I feel the first two patches on this set ad

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-05 Thread Andres Freund
Hi, On 2025-09-04 13:24:00 -0400, Greg Burd wrote: > On Thu, Sep 4, 2025, at 12:59 PM, Andres Freund wrote: > > Hi, > > > > On 2025-08-27 15:42:48 -0400, Greg Burd wrote: > >> Regardless, I feel the first two patches on this set address the > >> intention of this thread. > > > > I'm planning to co

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-04 Thread Greg Burd
On Thu, Sep 4, 2025, at 12:59 PM, Andres Freund wrote: > Hi, > > On 2025-08-27 15:42:48 -0400, Greg Burd wrote: >> Regardless, I feel the first two patches on this set address the >> intention of this thread. > > I'm planning to commit the first two patches after making a pass through > them. I h

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-09-04 Thread Andres Freund
Hi, On 2025-08-27 15:42:48 -0400, Greg Burd wrote: > Regardless, I feel the first two patches on this set address the > intention of this thread. I'm planning to commit the first two patches after making a pass through them. I have some work that I'm cleaning up to post that'd conflict and Tomas'

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-08-27 Thread Greg Burd
On Aug 17 2025, at 12:57 am, Thomas Munro wrote: > On Sun, Aug 17, 2025 at 4:34 PM Thomas Munro wrote: >> Or if you don't like those odds, maybe it'd be OK to keep % but use it >> rarely and without the CAS that can fail. > > ... or if we wanted to try harder to avoid %, could we relegate it

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-08-16 Thread Thomas Munro
On Sun, Aug 17, 2025 at 4:34 PM Thomas Munro wrote: > Or if you don't like those odds, maybe it'd be OK to keep % but use it > rarely and without the CAS that can fail. ... or if we wanted to try harder to avoid %, could we relegate it to the unlikely CLOCK-went-all-the-way-around-again-due-to-un

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-08-16 Thread Thomas Munro
On Sat, Aug 16, 2025 at 3:37 PM Thomas Munro wrote: > while (hand >= NBuffers) > { > /* Base value advanced by backend that overshoots by one tick. */ > if (hand == NBuffers) > pg_atomic_fetch_add_u64(&StrategyControl->ticks_base, NBuffers); > hand -= NB

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-08-15 Thread Thomas Munro
On Wed, Aug 13, 2025 at 9:42 AM Greg Burd wrote: > Amazing, thank you. I'll try to replicate your tests tomorrow to see if > my optimized division and modulo functions do in fact help or not. I > realize that both you and Anders are (rightly) concerned that the > performance impact of IDIV on so

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-08-12 Thread Greg Burd
On Aug 11 2025, at 9:09 am, Tomas Vondra wrote: > Hi, > > I took a look at this thread / patches, mostly because it's somewhat > related to the NUMA patch series [1]. Freelist is one of the things the > NUMA patches tweak, to split it into per-node partitions. So removing > the freelist would

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-27 Thread Greg Burd
On 7/25/25 15:02, Greg Burd wrote: > Patch set is now: > > 1) remove freelist > > 2) remove buffer_strategy_lock > > 3) abstract clock-sweep to type and API > > > > -greg Somehow including the test.c file as an attachment on my last email confused the CI and it didn't test the v10 patch set (which

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-25 Thread Greg Burd
On 7/22/25 14:43, Greg Burd wrote: > On 7/21/25 14:35, Andres Freund wrote: >> Hi, >> >> On 2025-07-21 13:37:04 -0400, Greg Burd wrote: >>> On 7/18/25 13:03, Andres Freund wrote: >>> Hello.  Thanks again for taking the time to review the email and patch, >>> I think we're onto something good here.

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-22 Thread Greg Burd
On 7/21/25 14:35, Andres Freund wrote: > Hi, > > On 2025-07-21 13:37:04 -0400, Greg Burd wrote: >> On 7/18/25 13:03, Andres Freund wrote: >> Hello.  Thanks again for taking the time to review the email and patch, >> I think we're onto something good here. >> >>> I'd be curious if anybody wants to a

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-21 Thread Andres Freund
Hi, On 2025-07-21 13:37:04 -0400, Greg Burd wrote: > On 7/18/25 13:03, Andres Freund wrote: > Hello.  Thanks again for taking the time to review the email and patch, > I think we're onto something good here. > > > > > I'd be curious if anybody wants to argue for keeping the clock sweep. Except >

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-21 Thread Greg Burd
On 7/18/25 13:03, Andres Freund wrote: > Hi, Hello.  Thanks again for taking the time to review the email and patch, I think we're onto something good here. > > I'd be curious if anybody wants to argue for keeping the clock sweep. Except > for the have_free_buffer() use in autoprewarm, it's a rat

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-18 Thread Andres Freund
Hi, I'd be curious if anybody wants to argue for keeping the clock sweep. Except for the have_free_buffer() use in autoprewarm, it's a rather trivial patch. And I really couldn't measure regressions above the noise level, even if absurdly extreme use cases. On 2025-07-17 14:35:13 -0400, Greg Bur

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-17 Thread Greg Burd
On Fri, Jul 11, 2025, at 2:52 PM, Andres Freund wrote: Hi, On 2025-07-11 13:26:53 -0400, Greg Burd wrote: In conversations [1] recently about considering how best to adapt the code to become NUMA-aware Andres commented, "FWIW, I've started to wonder if we shouldn't just get rid of the freelis

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-11 Thread Greg Burd
On Fri, Jul 11, 2025, at 2:50 PM, Nathan Bossart wrote: > On Fri, Jul 11, 2025 at 01:26:53PM -0400, Greg Burd wrote: >> This change does remove the have_free_buffer() function used by the >> contrib/pg_prewarm module. On the surface this doesn't seem to cause any >> issues, but honestly I've not

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-11 Thread Andres Freund
Hi, On 2025-07-11 13:26:53 -0400, Greg Burd wrote: > In conversations [1] recently about considering how best to adapt the code > to become NUMA-aware Andres commented, "FWIW, I've started to wonder if we > shouldn't just get rid of the freelist entirely" and because I'm a glutton > for punishment

Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-11 Thread Nathan Bossart
On Fri, Jul 11, 2025 at 01:26:53PM -0400, Greg Burd wrote: > This change does remove the have_free_buffer() function used by the > contrib/pg_prewarm module. On the surface this doesn't seem to cause any > issues, but honestly I've not thought too deeply on this one. Hm. ISTM we'll either need t

[PATCH] Let's get rid of the freelist and the buffer_strategy_lock

2025-07-11 Thread Greg Burd
Hello, In conversations [1] recently about considering how best to adapt the code to become NUMA-aware Andres commented, "FWIW, I've started to wonder if we shouldn't just get rid of the freelist entirely" and because I'm a glutton for punishment (and I think this idea has some merit) I took hi