Index | Thread | Search

From:
"Ted Unangst" <tedu@tedunangst.com>
Subject:
Re: sys/sysctl: make hw.setperf MP safe
To:
"Kirill A. Korinsky" <kirill@korins.ky>
Cc:
"Mark Kettenis" <mark.kettenis@xs4all.nl>, tech@openbsd.org, mvs@openbsd.org
Date:
Thu, 22 May 2025 17:41:07 -0400

Download raw body.

Thread
On 2025-05-22, Kirill A. Korinsky wrote:
> On Thu, 22 May 2025 00:17:43 +0200,
> Mark Kettenis <mark.kettenis@xs4all.nl> wrote:

> > I'm still not convinced load tearing and store tearing are genuine
> > problems.  All the examples I've seen from the Linux developers are
> > somewhat convoluted, involving things like unions or type punning.
> > But there is currently no consensus among OpenBSD developers.

I'm tempted to say godbolt or it didn't happen.

We may as well just add a prebuild step that runs the entire kernel
through a sed script that changes everything to atomic, then we can
continue writing normal code.

> To be clear: this diff is one of many similar diffs which unlock sysctl.
> 
> I need this to construct an experemntal MP-safe setperf policy which can be
> run without kernel lock with smaller than 100ms intervals to see how it
> goes.

Can we do a smaller diff without all the atomic fluff?

I can agree there's value in moving this stuff out of kernel lock, but
I don't think this amount of churn is productive.