Re: [PATCH v3 2/3] sched: make migrate_enable/migrate_disable inline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 27, 2025 at 10:58 AM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> On Thu, Aug 21, 2025 at 2:38 AM Menglong Dong <menglong8.dong@xxxxxxxxx> 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!





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux