lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/31] rhashtable: Allow rhashtable to be used from irq-safe contexts
Hello,

On Wed, Nov 30, 2022 at 08:35:13AM -0800, Linus Torvalds wrote:
> On Wed, Nov 30, 2022 at 12:23 AM Tejun Heo <tj@kernel.org> wrote:
> >
> >
> > static inline void rht_lock(struct bucket_table *tbl,
> > - struct rhash_lock_head __rcu **bkt)
> > + struct rhash_lock_head __rcu **bkt,
> > + unsigned long *flags)
>
> I guess it doesn't matter as long as this actually gets inlined, but
> wouldn't it be better to have
>
> flags = rht_lock(..);
> ...
> rht_unlock(.., flags);
>
> as the calling convention? Rather than passing a pointer to the stack around.

Sure thing.

> That's what the native _raw_spin_lock_irqsave() interface is (even if
> "spin_lock_irqsave()" itself for historical reasons uses that inline
> asm-like "pass argument by reference *without* using a pointer")

Yeah, it always feels kinda weird to wrap irqsave/restore due to the special
reference passing.

> And gaah, we should have made 'flags' be a real type long ago, but I
> guess 'unsigned long' is too ingrained and traditional to change that
> now.

Hahaha, that's gonna be an epic patchset.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2022-11-30 18:08    [W:0.036 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site