On Tue, Apr 7, 2020 at 6:03 PM Jens Axboe <axboe@xxxxxxxxx> wrote: > Various callsites currently check current->task_works != NULL to know > when to run work. Add a helper that we use internally for that. This is > in preparation for also not running if exit queue has been queued. [...] > +static inline bool task_work_pending(void) > +{ > + return current->task_works; > +} I think this should be using READ_ONCE().