Message ID | 20210913112609.2651084-7-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 Mon, Sep 13, 2021 at 01:26:09PM +0200, Marco Elver wrote: > While there is an increased risk of failing to insert the stack trace, > this is typically unlikely, especially if the same insertion had already > succeeded previously (stack depot hit). For frequent calls from the same > location, it therefore becomes extremely unlikely that > kasan_record_aux_stack_noalloc() fails. > > Link: https://lkml.kernel.org/r/20210902200134.25603-1-skhan@linuxfoundation.org > Reported-by: Shuah Khan <skhan@linuxfoundation.org> > Signed-off-by: Marco Elver <elver@google.com> > Tested-by: Shuah Khan <skhan@linuxfoundation.org> > Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Tejun Heo <tj@kernel.org> Please feel free to route with the rest of series or if you want me to take these through the wq tree, please let me know. Thanks.
On Mon, 13 Sept 2021 at 19:03, Tejun Heo <tj@kernel.org> wrote: > > On Mon, Sep 13, 2021 at 01:26:09PM +0200, Marco Elver wrote: > > While there is an increased risk of failing to insert the stack trace, > > this is typically unlikely, especially if the same insertion had already > > succeeded previously (stack depot hit). For frequent calls from the same > > location, it therefore becomes extremely unlikely that > > kasan_record_aux_stack_noalloc() fails. > > > > Link: https://lkml.kernel.org/r/20210902200134.25603-1-skhan@linuxfoundation.org > > Reported-by: Shuah Khan <skhan@linuxfoundation.org> > > Signed-off-by: Marco Elver <elver@google.com> > > Tested-by: Shuah Khan <skhan@linuxfoundation.org> > > Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> > > Acked-by: Tejun Heo <tj@kernel.org> Thanks! > Please feel free to route with the rest of series or if you want me to take > these through the wq tree, please let me know. Usually KASAN & stackdepot patches go via the -mm tree. I hope the 1-line change to workqueue won't conflict with other changes pending in the wq tree. Unless you or Andrew tells us otherwise, I assume these will at some point appear in -mm. Thanks, -- Marco > Thanks. > > -- > tejun
On Mon, Sep 13, 2021 at 07:58:39PM +0200, Marco Elver wrote: > > Please feel free to route with the rest of series or if you want me to take > > these through the wq tree, please let me know. > > Usually KASAN & stackdepot patches go via the -mm tree. I hope the > 1-line change to workqueue won't conflict with other changes pending > in the wq tree. Unless you or Andrew tells us otherwise, I assume > these will at some point appear in -mm. That part is really unlikely to cause conflicts and -mm sits on top of all other trees anyway, so it should be completely fine. Thanks.
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 33a6b4a2443d..9a042a449002 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1350,7 +1350,7 @@ static void insert_work(struct pool_workqueue *pwq, struct work_struct *work, struct worker_pool *pool = pwq->pool; /* record the work call stack in order to print it in KASAN reports */ - kasan_record_aux_stack(work); + kasan_record_aux_stack_noalloc(work); /* we own @work, set data and link */ set_work_pwq(work, pwq, extra_flags);