[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251005160753.GA6063@redhat.com>
Date: Sun, 5 Oct 2025 18:07:54 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Boqun Feng <boqun.feng@...il.com>,
David Howells <dhowells@...hat.com>, Ingo Molnar <mingo@...hat.com>,
Li RongQing <lirongqing@...du.com>,
Peter Zijlstra <peterz@...radead.org>,
Waiman Long <longman@...hat.com>, Will Deacon <will@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] seqlock: introduce SEQLOCK_READ_SECTION()
OK. I'll send v2 but let me ask...
On 10/05, Linus Torvalds wrote:
>
> As far as the users are concerned, the result doesn't end up being
> really any different from our scoped guards, so I'd actually suggest
> you just make this helper look like our scoped_guard() macro does.
I swear, I too thought about scoped_seqlock_xxx ;)
> And instead of making people pass in a NULL 'flags', just do a
> separate version of it, exactly like we do for locking. Even if the
> internal implementation then ends up sharing most of the code, please
> don't make people pass in NULL just because they don't want the
> irqsave version.
>
> So make it two different things:
>
> scoped_seqlock_read(lock) { .... }
>
> scoped_seqlock__read_irqsave(lock, flags) { ... }
OK. But if you don't object I'd like to avoid another DEFINE_LOCK_GUARD()
or something like it in this case. To me it won't buy anything.
And I think that the "generic" seqlock_read_section_retry(flags) makes
sense, the "if (flags)" checks should not generate the extra code.
Will you agree?
> (Maybe 'flags' can even be local to that scope?)
The problem is that you can't declare "int lockless/seq" and
"unsigned long flags" inside "for (...)", but I'll try to think about
it more.
Oleg.
Powered by blists - more mailing lists