Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, x4mmm(at)yandex-team(dot)ru, dilipbalaut(at)gmail(dot)com, tndrwang(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, tomas(dot)vondra(at)enterprisedb(dot)com
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Date: 2024-03-04 22:14:32
Message-ID: 3885480.1709590472@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> Pushed that way, but we can discuss further wording improvements/changes
> if someone wants to propose any.

I just noticed that drongo is complaining about two lines added
by commit 53c2a97a9:

drongo | 2024-03-04 14:34:52 | ../pgsql/src/backend/access/transam/slru.c(436): warning C4047: '!=': 'SlruPageStatus *' differs in levels of indirection from 'int'
drongo | 2024-03-04 14:34:52 | ../pgsql/src/backend/access/transam/slru.c(717): warning C4047: '!=': 'SlruPageStatus *' differs in levels of indirection from 'int'

These lines are

Assert(&shared->page_status[slotno] != SLRU_PAGE_EMPTY);

Assert(&ctl->shared->page_status[slotno] != SLRU_PAGE_EMPTY);

These are comparing the address of something with an enum value,
which surely cannot be sane. Is the "&" operator incorrect?

It looks like SLRU_PAGE_EMPTY has (by chance, or deliberately)
the numeric value of zero, so I guess the majority of our BF
animals are understanding this as "address != NULL". But that
doesn't look like a useful test to be making.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-03-04 22:21:18 Re: Popcount optimization using AVX512
Previous Message Tom Lane 2024-03-04 22:05:24 Re: Improve the log message output of basic_archive when basic_archive.archive_directory parameter is not set