On Thu, Apr 3, 2025 at 10:23 AM Bertrand Drouvot <bertranddrouvot...@gmail.com> wrote: > > Hi,
Hi Bertrand, > On Thu, Apr 03, 2025 at 09:01:43AM +0200, Jakub Wartak wrote: [..] > === v21-0002 > While pg_buffercache_build_tuple() is not added (pg_buffercache_save_tuple() > is). Fixed > About v21-0002: > > === 1 > > I can see that the pg_buffercache_init_entries() helper comments are added in > v21-0003 but I think that it would be better to add them in v21-0002 > (where the helper is actually created). Moved > About v21-0003: > > === 2 > > > I hear you, attached v21 / 0003 is free of float/double arithmetics > > and uses non-float point values. > > + if (buffers_per_page > 1) > + os_page_query_count = NBuffers; > + else > + os_page_query_count = NBuffers * pages_per_buffer; > > yeah, that's more elegant. I think that it properly handles the relationships > between buffer and page sizes without relying on float arithmetic. Cool > === 3 > > + if (buffers_per_page > 1) > + { > > As buffers_per_page does not change, I think I'd put this check outside of the > for (i = 0; i < NBuffers; i++) loop, something like: > > " > if (buffers_per_page > 1) { > /* BLCKSZ < PAGESIZE: one page hosts many Buffers */ > for (i = 0; i < NBuffers; i++) { > . > . > . > . > } else { > /* BLCKSZ >= PAGESIZE: Buffer occupies more than one OS page */ > for (i = 0; i < NBuffers; i++) { > . > . > . > " Done. > === 4 > > > That _numa_prepare_ptrs() is unused and will need to be removed, > > but we can still move some code there if necessary. > > Yeah I think that it can be simply removed then. Removed. > === 5 > > > @Bertrand: do you have anything against pg_shm_allocations_numa > > instead of pg_shm_numa_allocations? I don't mind changing it... > > I think that pg_shm_allocations_numa() is better (given the examples you just > shared). OK, let's go with this name then (in v22). > === 6 > > > I find all of those non-user friendly and I'm afraid I won't be able > > to pull that alone in time... > > Maybe we could add a few words in the doc to mention the "multiple nodes per > buffer" case? And try to improve it for say 19? Right, we could also put it as a limitation. I would be happy to leave it as it must be a rare condition, but Tomas stated he's not. > Also maybe we should just focus till v21-0003 (and discard v21-0004 for 18). Do you mean discard pg_buffercache_numa (0002+0003) and instead go with pg_shm_allocations_numa (0004) ? BTW: I've noticed that Tomas responded with his v22 to this after I've solved all of the above in mine v22, so I'll drop v23 soon and then let's continue there. -J.