On 8/29/25 13:29, yangshiguang wrote:
At 2025-08-27 16:40:21, "Vlastimil Babka" vbabka@suse.cz wrote:
How about this?
/* Preemption is disabled in ___slab_alloc() */
gfp_flags &= ~(__GFP_DIRECT_RECLAIM);
gfp_flags = (gfp_flags & ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL)) |
__GFP_NOWARN;
I'd suggest using gfp_nested_flags() and & ~(__GFP_DIRECT_RECLAIM);
However, gfp has been processed by gfp_nested_mask() in stack_depot_save_flags().
Aha, didn't notice. Good to know!
Still need to call here?
No then we can indeed just mask out __GFP_DIRECT_RECLAIM.
Maybe the comment could say something like:
/* * Preemption is disabled in ___slab_alloc() so we need to disallow * blocking. The flags are further adjusted by gfp_nested_mask() in * stack_depot itself. */
set_track_prepare() ->stack_depot_save_flags()
-- Cheers, Harry / Hyeonggon
At 2025-08-29 21:08:58, "Vlastimil Babka" vbabka@suse.cz wrote:
On 8/29/25 13:29, yangshiguang wrote:
At 2025-08-27 16:40:21, "Vlastimil Babka" vbabka@suse.cz wrote:
How about this?
/* Preemption is disabled in ___slab_alloc() */
gfp_flags &= ~(__GFP_DIRECT_RECLAIM);
gfp_flags = (gfp_flags & ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL)) |
__GFP_NOWARN;
I'd suggest using gfp_nested_flags() and & ~(__GFP_DIRECT_RECLAIM);
However, gfp has been processed by gfp_nested_mask() in stack_depot_save_flags().
Aha, didn't notice. Good to know!
Still need to call here?
No then we can indeed just mask out __GFP_DIRECT_RECLAIM.
Maybe the comment could say something like:
sure. Express clearly.
/*
- Preemption is disabled in ___slab_alloc() so we need to disallow
- blocking. The flags are further adjusted by gfp_nested_mask() in
- stack_depot itself.
*/
set_track_prepare() ->stack_depot_save_flags()
-- Cheers, Harry / Hyeonggon
linux-stable-mirror@lists.linaro.org