lkml.org 
[lkml]   [2020]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 01/11] asm-generic/pgtable: Adds generic functions to track lockless pgtable walks
From
Date
Hello Christophe, thanks for the feedback!

On Thu, 2020-02-06 at 06:54 +0100, Christophe Leroy wrote:
> > A memory barrier was also added just to make sure there is no speculative
> > read outside the interrupt disabled area. Other than that, it is not
> > supposed to have any change of behavior from current code.
>
> Is that speculative barrier necessary for all architectures ? Does it
> impact performance ? Shouldn't this be another patch ?

It makes sense, better keep the code as much as possible as it was. If
any arch finds this barrier needed, it can implement it's own version
of this function (or another patch to add this to generic, if proved to
be needed in every arch).

> > +#ifndef __HAVE_ARCH_LOCKLESS_PGTBL_WALK_CONTROL
> > +/*
> > + * begin_lockless_pgtbl_walk: Must be inserted before a function call that does
> > + * lockless pagetable walks, such as __find_linux_pte()
> > + */
> > +static inline
> > +unsigned long begin_lockless_pgtbl_walk(void)
>
> What about keeping the same syntax as local_irq_save(), something like:
>
> #define begin_lockless_pgtbl_walk(flags) \
> do {
> local_irq_save(flags);
> smp_mb();
> } while (0)
>

Makes sense. But wouldn't inlining have the same code output?

Best regards,
Leonardo Bras

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-02-07 03:21    [W:0.063 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site