lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpF921P+0Zvi+nugpcdojtsP79O2GwTiedY1n4V7OFFC9Q@mail.gmail.com>
Date: Mon, 13 Jan 2025 09:53:21 -0800
From: Suren Baghdasaryan <surenb@...gle.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: akpm@...ux-foundation.org, peterz@...radead.org, willy@...radead.org, 
	liam.howlett@...cle.com, david.laight.linux@...il.com, mhocko@...e.com, 
	vbabka@...e.cz, hannes@...xchg.org, mjguzik@...il.com, oliver.sang@...el.com, 
	mgorman@...hsingularity.net, david@...hat.com, peterx@...hat.com, 
	oleg@...hat.com, dave@...olabs.net, paulmck@...nel.org, brauner@...nel.org, 
	dhowells@...hat.com, hdanton@...a.com, hughd@...gle.com, 
	lokeshgidra@...gle.com, minchan@...gle.com, jannh@...gle.com, 
	shakeel.butt@...ux.dev, souravpanda@...gle.com, pasha.tatashin@...een.com, 
	klarasmodin@...il.com, richard.weiyang@...il.com, corbet@....net, 
	linux-doc@...r.kernel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	kernel-team@...roid.com
Subject: Re: [PATCH v9 08/17] mm: move mmap_init_lock() out of the header file

On Mon, Jan 13, 2025 at 7:27 AM Lorenzo Stoakes
<lorenzo.stoakes@...cle.com> wrote:
>
> On Fri, Jan 10, 2025 at 08:25:55PM -0800, Suren Baghdasaryan wrote:
> > mmap_init_lock() is used only from mm_init() in fork.c, therefore it does
> > not have to reside in the header file. This move lets us avoid including
> > additional headers in mmap_lock.h later, when mmap_init_lock() needs to
> > initialize rcuwait object.
> >
> > Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
> > Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
>
> Aside from nit below, LGTM:
>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
>
> > ---
> >  include/linux/mmap_lock.h | 6 ------
> >  kernel/fork.c             | 6 ++++++
> >  2 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
> > index 45a21faa3ff6..4706c6769902 100644
> > --- a/include/linux/mmap_lock.h
> > +++ b/include/linux/mmap_lock.h
> > @@ -122,12 +122,6 @@ static inline bool mmap_lock_speculate_retry(struct mm_struct *mm, unsigned int
> >
> >  #endif /* CONFIG_PER_VMA_LOCK */
> >
> > -static inline void mmap_init_lock(struct mm_struct *mm)
> > -{
> > -     init_rwsem(&mm->mmap_lock);
> > -     mm_lock_seqcount_init(mm);
> > -}
> > -
> >  static inline void mmap_write_lock(struct mm_struct *mm)
> >  {
> >       __mmap_lock_trace_start_locking(mm, true);
> > diff --git a/kernel/fork.c b/kernel/fork.c
> > index f2f9e7b427ad..d4c75428ccaf 100644
> > --- a/kernel/fork.c
> > +++ b/kernel/fork.c
> > @@ -1219,6 +1219,12 @@ static void mm_init_uprobes_state(struct mm_struct *mm)
> >  #endif
> >  }
> >
> > +static inline void mmap_init_lock(struct mm_struct *mm)
>
> we don't need inline here, please drop it.

Ack.

>
> > +{
> > +     init_rwsem(&mm->mmap_lock);
> > +     mm_lock_seqcount_init(mm);
> > +}
> > +
> >  static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
> >       struct user_namespace *user_ns)
> >  {
> > --
> > 2.47.1.613.gc27f4b7a9f-goog
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ