Remove unused fields from BufferCacheNumaRec

Поиск
Список
Период
Сортировка
Искать

Remove unused fields from BufferCacheNumaRec

От:
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Дата:
Вложения:
Hi hackers,

While working on [1], I noticed that there are unused fields in BufferCacheNumaRec
since ba2a3c2302f.

Also, I noticed that a comment was not at the correct location in 
pg_buffercache_numa_pages().

The attached takes care of both.

[1]: https://www.postgresql.org/message-id/aR9I29QgGdyUMkJq%40ip-10-97-1-34.eu-west-3.compute.internal

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Re: Remove unused fields from BufferCacheNumaRec

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Fri, Nov 21, 2025 at 11:34:01AM +0000, Bertrand Drouvot wrote:
> While working on [1], I noticed that there are unused fields in BufferCacheNumaRec
> since ba2a3c2302f.
> 
> Also, I noticed that a comment was not at the correct location in 
> pg_buffercache_numa_pages().
> 
> The attached takes care of both.
> 
> [1]: https://www.postgresql.org/message-id/aR9I29QgGdyUMkJq%40ip-10-97-1-34.eu-west-3.compute.internal

It seems to me that you are right here.  Will appl, thanks.
--
Michael

Re: Remove unused fields from BufferCacheNumaRec

От:
Chao Li <li.evan.chao@gmail.com>
Дата:


> On Nov 21, 2025, at 19:34, Bertrand Drouvot  wrote:
> 
> Hi hackers,
> 
> While working on [1], I noticed that there are unused fields in BufferCacheNumaRec
> since ba2a3c2302f.
> 
> Also, I noticed that a comment was not at the correct location in 
> pg_buffercache_numa_pages().
> 
> The attached takes care of both.

As long as compile passes, that proves the removal of the unused fields is safe. And by reading the code, I believe the movement of the comment is also correct.

Looks like you have done a little bit rewording on the comment:

1. "This loop stores into os_page_ptrs[]” is understandable, but feels a bit incomplete to me as non-English-speaking. I understand your intention is to make “stores” and “touches” to share “addresses”. But this is not a strong opinion comment, if Michael considers okay, I will be fine as well.

2. Instead of saying “if needed”, why don’t explicitly mention something like “on the first pass”. 

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Re: Remove unused fields from BufferCacheNumaRec

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Sun, Nov 23, 2025 at 12:27:08PM +0800, Chao Li wrote:
> 1. "This loop stores into os_page_ptrs[]” is understandable, but
> feels a bit incomplete to me as non-English-speaking. I understand
> your intention is to make “stores” and “touches” to share
> “addresses”. But this is not a strong opinion comment, if Michael
> considers okay, I will be fine as well.

I have actually used something slightly different at the end, and
appl-ed the result.
--
Michael

Re: Remove unused fields from BufferCacheNumaRec

От:
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Дата:
Hi,

Thanks for having looked at it!

On Sun, Nov 23, 2025 at 12:27:08PM +0800, Chao Li wrote:
> 
> As long as compile passes, that proves the removal of the unused fields is safe.

Most of the time, but not always, see [1].

[1]: https://www.postgresql.org/message-id/aS2b3LoUypW1/Gdz%40ip-10-97-1-34.eu-west-3.compute.internal

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com


FAQ