Skip to content

Commit

Permalink
lib/ref_tracker: remove warnings in case of allocation failure
Browse files Browse the repository at this point in the history
Library can handle allocation failures. To avoid allocation warnings
__GFP_NOWARN has been added everywhere. Moreover GFP_ATOMIC has been
replaced with GFP_NOWAIT in case of stack allocation on tracker free
call.

Signed-off-by: Andrzej Hajda <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
ahajda authored and kuba-moo committed Jun 5, 2023
1 parent 227c6c8 commit acd8f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ref_tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int ref_tracker_alloc(struct ref_tracker_dir *dir,
unsigned long entries[REF_TRACKER_STACK_ENTRIES];
struct ref_tracker *tracker;
unsigned int nr_entries;
gfp_t gfp_mask = gfp;
gfp_t gfp_mask = gfp | __GFP_NOWARN;
unsigned long flags;

WARN_ON_ONCE(dir->dead);
Expand Down Expand Up @@ -237,7 +237,8 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
return -EEXIST;
}
nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 1);
stack_handle = stack_depot_save(entries, nr_entries, GFP_ATOMIC);
stack_handle = stack_depot_save(entries, nr_entries,
GFP_NOWAIT | __GFP_NOWARN);

spin_lock_irqsave(&dir->lock, flags);
if (tracker->dead) {
Expand Down

0 comments on commit acd8f0e

Please sign in to comment.