[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADxym3bo1DEtR+oFaN7F-cvFZ8yPgivxL69w35EETMKCGpmS0w@mail.gmail.com>
Date: Wed, 27 Aug 2025 13:47:50 +0800
From: Menglong Dong <menglong8.dong@...il.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>, Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>, Steven Rostedt <rostedt@...dmis.org>,
Benjamin Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, John Fastabend <john.fastabend@...il.com>,
Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau <martin.lau@...ux.dev>, Eduard <eddyz87@...il.com>,
Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
tzimmermann@...e.de, simona.vetter@...ll.ch,
Jani Nikula <jani.nikula@...el.com>, LKML <linux-kernel@...r.kernel.org>,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH v3 2/3] sched: make migrate_enable/migrate_disable inline
On Wed, Aug 27, 2025 at 10:58 AM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Thu, Aug 21, 2025 at 2:38 AM Menglong Dong <menglong8.dong@...il.com> wrote:
> >
> > +
> > +#ifndef CREATE_MIGRATE_DISABLE
> > +static inline void migrate_disable(void)
> > +{
> > + __migrate_disable();
> > +}
> > +
> > +static inline void migrate_enable(void)
> > +{
> > + __migrate_enable();
> > +}
> > +#else /* CREATE_MIGRATE_DISABLE */
> > +extern void migrate_disable(void);
> > +extern void migrate_enable(void);
> > +#endif /* CREATE_MIGRATE_DISABLE */
>
> I think the explanation from the commit log is better to be
> copy pasted here as a comment, since the need for the macro
> is quite hard to understand.
Okay!
>
> > +
> > +#else /* MODULE */
> > +extern void migrate_disable(void);
> > +extern void migrate_enable(void);
> > +#endif /* MODULE */
> > +
>
> ...
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index be00629f0ba4..58164a69449d 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -7,6 +7,8 @@
> > * Copyright (C) 1991-2002 Linus Torvalds
> > * Copyright (C) 1998-2024 Ingo Molnar, Red Hat
> > */
> > +#define CREATE_MIGRATE_DISABLE
> > +#include <linux/sched.h>
>
> Also how about calling it
> #define INSTANTIATE_EXPORTED_MIGRATE_DISABLE
>
> When I asked AI what "instantiate exported migrate_disable"
> means it guessed it nicely :)
> while "create migrate_disable" had a vague answer.
Okay, sounds nice!
Powered by blists - more mailing lists