remove WaitEventCustomCounterData

Started by Nathan Bossart17 days ago4 messageshackers
Jump to latest
#1Nathan Bossart
nathandbossart@gmail.com

While trying to understand the extent of our spinlock usage, I noticed that
WaitEventCustomCounterData->mutex is unnecessary because the counter is
only ever accessed with WaitEventCustomLock held exclusively. So, here's a
patch to simplify matters a bit. Thoughts?

--
nathan

Attachments:

v1-0001-remove-WaitEventCustomCounterData.patchtext/plain; charset=us-asciiDownload+7-24
#2Michael Paquier
michael@paquier.xyz
In reply to: Nathan Bossart (#1)
Re: remove WaitEventCustomCounterData

On Wed, Jul 08, 2026 at 09:50:33PM -0500, Nathan Bossart wrote:

While trying to understand the extent of our spinlock usage, I noticed that
WaitEventCustomCounterData->mutex is unnecessary because the counter is
only ever accessed with WaitEventCustomLock held exclusively. So, here's a
patch to simplify matters a bit. Thoughts?

Indeed. This removal sounds good to me, thanks.
--
Michael

#3Fujii Masao
masao.fujii@gmail.com
In reply to: Michael Paquier (#2)
Re: remove WaitEventCustomCounterData

On Thu, Jul 9, 2026 at 1:04 PM Michael Paquier <michael@paquier.xyz> wrote:

On Wed, Jul 08, 2026 at 09:50:33PM -0500, Nathan Bossart wrote:

While trying to understand the extent of our spinlock usage, I noticed that
WaitEventCustomCounterData->mutex is unnecessary because the counter is
only ever accessed with WaitEventCustomLock held exclusively. So, here's a
patch to simplify matters a bit. Thoughts?

Indeed. This removal sounds good to me, thanks.

#include "storage/spin.h" seems no longer needed in wait_event.c,
since the patch removes the last use of the spinlock code there.
So we can remove that include as well?

Regards,

--
Fujii Masao

#4Nathan Bossart
nathandbossart@gmail.com
In reply to: Fujii Masao (#3)
Re: remove WaitEventCustomCounterData

On Thu, Jul 09, 2026 at 01:22:52PM +0900, Fujii Masao wrote:

#include "storage/spin.h" seems no longer needed in wait_event.c,
since the patch removes the last use of the spinlock code there.
So we can remove that include as well?

I think so. I've committed the patch with that change. Thanks for
looking!

--
nathan