Message ID | 20210907141307.1437816-3-elver@google.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | stackdepot, kasan, workqueue: Avoid expanding stackdepot slabs when holding raw_spin_lock | expand |
On Tue, Sep 7, 2021 at 4:14 PM Marco Elver <elver@google.com> wrote: > > alloc_flags in depot_alloc_stack() is no longer used; remove it. > > Signed-off-by: Marco Elver <elver@google.com> Reviewed-by: Alexander Potapenko <glider@google.com> > --- > lib/stackdepot.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/lib/stackdepot.c b/lib/stackdepot.c > index 0a2e417f83cb..c80a9f734253 100644 > --- a/lib/stackdepot.c > +++ b/lib/stackdepot.c > @@ -102,8 +102,8 @@ static bool init_stack_slab(void **prealloc) > } > > /* Allocation of a new stack in raw storage */ > -static struct stack_record *depot_alloc_stack(unsigned long *entries, int size, > - u32 hash, void **prealloc, gfp_t alloc_flags) > +static struct stack_record * > +depot_alloc_stack(unsigned long *entries, int size, u32 hash, void **prealloc) > { > struct stack_record *stack; > size_t required_size = struct_size(stack, entries, size); > @@ -309,9 +309,8 @@ depot_stack_handle_t stack_depot_save(unsigned long *entries, > > found = find_stack(*bucket, entries, nr_entries, hash); > if (!found) { > - struct stack_record *new = > - depot_alloc_stack(entries, nr_entries, > - hash, &prealloc, alloc_flags); > + struct stack_record *new = depot_alloc_stack(entries, nr_entries, hash, &prealloc); > + > if (new) { > new->next = *bucket; > /* > -- > 2.33.0.153.gba50c8fa24-goog >
diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 0a2e417f83cb..c80a9f734253 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -102,8 +102,8 @@ static bool init_stack_slab(void **prealloc) } /* Allocation of a new stack in raw storage */ -static struct stack_record *depot_alloc_stack(unsigned long *entries, int size, - u32 hash, void **prealloc, gfp_t alloc_flags) +static struct stack_record * +depot_alloc_stack(unsigned long *entries, int size, u32 hash, void **prealloc) { struct stack_record *stack; size_t required_size = struct_size(stack, entries, size); @@ -309,9 +309,8 @@ depot_stack_handle_t stack_depot_save(unsigned long *entries, found = find_stack(*bucket, entries, nr_entries, hash); if (!found) { - struct stack_record *new = - depot_alloc_stack(entries, nr_entries, - hash, &prealloc, alloc_flags); + struct stack_record *new = depot_alloc_stack(entries, nr_entries, hash, &prealloc); + if (new) { new->next = *bucket; /*
alloc_flags in depot_alloc_stack() is no longer used; remove it. Signed-off-by: Marco Elver <elver@google.com> --- lib/stackdepot.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)