From: Hillf Danton <hdanton@sina.com>
To: Tejun Heo <tj@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Thomas Graf <tgraf@suug.ch>,
Andrew Morton <akpm@linux-foundation.org>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] rhashtable: Bounce deferred worker kick through irq_work
Date: Tue, 12 May 2026 14:07:31 +0800 [thread overview]
Message-ID: <20260512060732.512-1-hdanton@sina.com> (raw)
In-Reply-To: <20260421060326.2836354-1-tj@kernel.org>
On Mon, 20 Apr 2026 20:03:26 -1000 Tejun Heo wrote:
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -441,10 +441,33 @@ static void rht_deferred_worker(struct work_struct *work)
>
> mutex_unlock(&ht->mutex);
>
> + /*
> + * Re-arm via @run_work, not @run_irq_work.
> + * rhashtable_free_and_destroy() drains async work as irq_work_sync()
> + * followed by cancel_work_sync(). If this site queued irq_work while
> + * cancel_work_sync() was waiting for us, irq_work_sync() would already
> + * have returned and the stale irq_work could fire post-teardown.
> + * cancel_work_sync() natively handles self-requeue on @run_work.
> + */
> if (err)
> schedule_work(&ht->run_work);
> }
>
Two cents: add BUG to capture the failure of handling self-requeue.
--- x/kernel/workqueue.c
+++ y/kernel/workqueue.c
@@ -2369,6 +2369,10 @@ retry:
work_flags |= WORK_STRUCT_INACTIVE;
insert_work(pwq, work, &pwq->inactive_works, work_flags);
}
+ do {
+ unsigned long data = *work_data_bits(work);
+ BUG_ON(data & WORK_OFFQ_DISABLE_MASK);
+ } while (0);
out:
raw_spin_unlock(&pool->lock);
--
prev parent reply other threads:[~2026-05-12 6:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-19 18:19 [RFC PATCH] rhashtable: Bounce deferred worker kick through irq_work when insecure_elasticity is set Tejun Heo
2026-04-20 8:44 ` Herbert Xu
2026-04-20 17:02 ` Tejun Heo
2026-04-20 18:12 ` [PATCH v2] rhashtable: Bounce deferred worker kick through irq_work Tejun Heo
2026-04-21 3:02 ` Herbert Xu
2026-04-21 6:03 ` [PATCH v3] " Tejun Heo
2026-04-21 6:06 ` Herbert Xu
2026-04-21 6:14 ` Tejun Heo
2026-05-12 6:07 ` Hillf Danton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512060732.512-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=akpm@linux-foundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tgraf@suug.ch \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox