Commit acd8f0e5 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Jakub Kicinski

lib/ref_tracker: remove warnings in case of allocation failure

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: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 227c6c83
...@@ -189,7 +189,7 @@ int ref_tracker_alloc(struct ref_tracker_dir *dir, ...@@ -189,7 +189,7 @@ int ref_tracker_alloc(struct ref_tracker_dir *dir,
unsigned long entries[REF_TRACKER_STACK_ENTRIES]; unsigned long entries[REF_TRACKER_STACK_ENTRIES];
struct ref_tracker *tracker; struct ref_tracker *tracker;
unsigned int nr_entries; unsigned int nr_entries;
gfp_t gfp_mask = gfp; gfp_t gfp_mask = gfp | __GFP_NOWARN;
unsigned long flags; unsigned long flags;
WARN_ON_ONCE(dir->dead); WARN_ON_ONCE(dir->dead);
...@@ -237,7 +237,8 @@ int ref_tracker_free(struct ref_tracker_dir *dir, ...@@ -237,7 +237,8 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
return -EEXIST; return -EEXIST;
} }
nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 1); 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); spin_lock_irqsave(&dir->lock, flags);
if (tracker->dead) { if (tracker->dead) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment