Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1489805

Re: [PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for automatic work_struct

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for automatic work_struct
Date 2016-09-23 09:30 +0200
Message-ID <skt5M-GK-23@gated-at.bofh.it> (permalink)
References <skgLf-1mw-21@gated-at.bofh.it> <skheh-1xN-9@gated-at.bofh.it> <skhHk-1Xw-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 22, 2016 at 09:15:52PM +0200, Nicolai Stange wrote:

> One minor question regarding your patch though: it hasn't got a
> destroy_work_on_stack(). Isn't one needed because of
>   INIT_WORK_ONSTACK() -> __INIT_WORK() -> __init_work() ->
>   debug_object_init_on_stack() ?
> At least work_on_cpu() destroys its local work_struct that way...

I wasn't aware of destroy_work_on_stack(), and I'm not familiar enough
with the debug objects stuff to see hwo important it is to call.

Also, there's more INIT_WORK_ONSTACK usage lacking
destroy_work_on_stack() calls.

Maybe it would be good to do a patch fixing them all up and adding a
comment with INIT_WORK_ONSTACK() that says it ought to be paired with
destroy_work_on_stack().

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for automatic work_struct Nicolai Stange <nicstange@gmail.com> - 2016-09-22 20:20 +0200
  Re: [PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for  automatic work_struct Peter Zijlstra <peterz@infradead.org> - 2016-09-22 20:50 +0200
    Re: [PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for automatic work_struct Nicolai Stange <nicstange@gmail.com> - 2016-09-22 21:20 +0200
      Re: [PATCH] smp: smp_call_on_cpu(): use INIT_WORK_ONSTACK() for  automatic work_struct Peter Zijlstra <peterz@infradead.org> - 2016-09-23 09:30 +0200

csiph-web