Re: [PATCH mm] tracing: incorrect gfp_t conversion

From: Vasily Averin
Date: Sat May 07 2022 - 18:33:03 EST


On 5/7/22 22:37, Andrew Morton wrote:
> On Sat, 7 May 2022 22:02:05 +0300 Vasily Averin <vvs@xxxxxxxxxx> wrote:
>> + {(__force unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \
>> + {(__force unsigned long)GFP_NOFS, "GFP_NOFS"}, \
>
> This got all repetitive, line-wrappy and ugly :(
>
> What do we think of something silly like this?

> --- a/include/trace/events/mmflags.h~tracing-incorrect-gfp_t-conversion-fix
> +++ a/include/trace/events/mmflags.h
> @@ -13,53 +13,57 @@
> * Thus most bits set go first.
> */
>
> +#define FUL __force unsigned long
> +
> #define __def_gfpflag_names \
> - {(__force unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \
> - {(__force unsigned long)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \
...
> + {(FUL)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \
> + {(FUL)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \


I think it's a good idea, and I regret it was your idea and not mine.

Should I resend my patch with these changes or would you prefer
to keep your patch as a separate one?

Thank you,
Vasily Averin