The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: [PATCH v3] rhashtable: Bounce deferred worker kick through irq_work
       [not found] <20260421060326.2836354-1-tj@kernel.org>
@ 2026-05-12  6:07 ` Hillf Danton
  0 siblings, 0 replies; only message in thread
From: Hillf Danton @ 2026-05-12  6:07 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Herbert Xu, Thomas Graf, Andrew Morton, linux-crypto,
	linux-kernel

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);
--

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-12  6:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260421060326.2836354-1-tj@kernel.org>
2026-05-12  6:07 ` [PATCH v3] rhashtable: Bounce deferred worker kick through irq_work Hillf Danton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox