lkml.org 
[lkml]   [2024]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 6/7] workqueue: Allow cancel_work_sync() and disable_work() from atomic contexts on BH work items
    Hello,

    On Thu, Feb 22, 2024 at 12:36:29PM +0800, Lai Jiangshan wrote:
    > On Thu, Feb 22, 2024 at 1:43 AM Tejun Heo <tj@kernel.org> wrote:
    >
    > > @@ -4077,11 +4076,37 @@ static bool __flush_work(struct work_struct *work, bool from_cancel)
    > >
    > > rcu_read_lock();
    > > pool = start_flush_work(work, &barr, from_cancel);
    > > + is_bh = pool && (pool->flags & POOL_BH);
    > > rcu_read_unlock();
    > > if (!pool)
    > > return false;
    > >
    > > - wait_for_completion(&barr.done);
    > > + if (is_bh && from_cancel) {
    >
    > Can "*work_data_bits(work) & WORK_OFFQ_BH" be used here?
    > If so, the previous patch will not be needed.

    Hmm... yeah, if we test from_cancel first, we should know that the work item
    is offq and then can depend on OFFQ_BH. Maybe I'm missing something. Will
    try that.

    Thanks.

    --
    tejun

    \
     
     \ /
      Last update: 2024-05-27 15:15    [W:6.538 / U:0.700 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site