Re: [PATCH] mm,page_owner: don't remove GFP flags in add_stack_record_to_list

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

 



On 4/29/24 7:47 AM, Christoph Hellwig wrote:
> This loses flags like GFP_NOFS and GFP_NOIO that are important to avoid
> deadlocks as well as GFP_NOLOCKDEP that otherwise generates lockdep false
> positives.

GFP_NOFS and GFP_NOIO translate to GFP_KERNEL without __GFP_FS/__GFP_IO so I
don't see how this patch would have helped with those.
__GFP_NOLOCKDEP is likely the actual issue and stackdepot solved it like this:

https://lore.kernel.org/linux-xfs/20240418141133.22950-1-ryabinin.a.a@xxxxxxxxx/

So we could just do the same here.

> Fixes: 217b2119b9e2 ("mm,page_owner: implement the tracking of the stacks count")
> Reported-by: Reported-by: syzbot+b7e8d799f0ab724876f9@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  mm/page_owner.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index d17d1351ec84af..d214488846fa92 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -168,9 +168,7 @@ static void add_stack_record_to_list(struct stack_record *stack_record,
>  	unsigned long flags;
>  	struct stack *stack;
>  
> -	/* Filter gfp_mask the same way stackdepot does, for consistency */
>  	gfp_mask &= ~GFP_ZONEMASK;
> -	gfp_mask &= (GFP_ATOMIC | GFP_KERNEL);
>  	gfp_mask |= __GFP_NOWARN;
>  
>  	set_current_in_page_owner();





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux