[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABRcYmKnEW-OafqYeDp9jkBz3VSQawi_8mz6W-M1L52MR4y8zQ@mail.gmail.com>
Date: Mon, 22 May 2023 18:11:00 +0200
From: Florent Revest <revest@...omium.org>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, catalin.marinas@....com,
anshuman.khandual@....com, joey.gouly@....com, mhocko@...e.com,
keescook@...omium.org, peterx@...hat.com, izbyshev@...ras.ru,
broonie@...nel.org, szabolcs.nagy@....com, kpsingh@...nel.org,
gthelen@...gle.com, toiwoton@...il.com
Subject: Re: [PATCH v2 4/5] mm: Add a NO_INHERIT flag to the PR_SET_MDWE prctl
On Mon, May 22, 2023 at 11:01 AM David Hildenbrand <david@...hat.com> wrote:
>
> On 17.05.23 17:03, Florent Revest wrote:
> > +#define MMF_INIT_FLAGS(flags) ({ \
> > + unsigned long new_flags = flags; \
> > + if (new_flags & (1UL << MMF_HAS_MDWE_NO_INHERIT)) \
> > + new_flags &= ~((1UL << MMF_HAS_MDWE) | \
> > + (1UL << MMF_HAS_MDWE_NO_INHERIT)); \
> > + new_flags & MMF_INIT_MASK; \
> > +})
>
> Why the desire for macros here? :)
I just thought that's what the cool kids do nowadays ?! :)
Eh, I'm joking, I completely agree. Somehow this was suggested to me
in v1 as a macro and I didn't think of questioning that, but a static
inline function should be more readable indeed! I will fix this in v3.
> We have a single user of MMF_INIT_FLAGS, why not inline or use a proper
> inline function?
I have a slight preference for a separate function, so we don't spill
over too much of this logic in fork.c.
Thanks for the review David!
Powered by blists - more mailing lists