All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Xiaochuan Li <chuanx2070@163.com>
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH v2] io_uring/lock: Keep spinlock release before wake_up()
Date: Wed, 23 Sep 2026 10:52:46 -0600	[thread overview]
Message-ID: <35640d8a-4a6e-4e86-b553-5d5bdcba6e1c@kernel.dk> (raw)
In-Reply-To: <20260923161622.25737-1-chuanx2070@163.com>

On 9/23/26 10:16 AM, Xiaochuan Li wrote:
> @@ -574,9 +575,8 @@ static struct io_wq_work *io_get_next_work(struct io_wq_acct *acct,
>  		unstalled = io_wait_on_hash(wq, stall_hash);
>  		raw_spin_lock(&acct->lock);
>  		if (unstalled) {
> +			*need_wake = true;
>  			clear_bit(IO_ACCT_STALLED_BIT, &acct->flags);
> -			if (wq_has_sleeper(&wq->hash->wait))
> -				wake_up(&wq->hash->wait);
>  		}
>  	}

*need_wake = wq_has_sleeper(&wq->hash->wait);

? And probably retain the sme ordering with the bit clear.

Apart from that, I think it looks fine. The lock shuffling is somewhat
annoying and inefficient, an unfortunate side effect of the raw vs
normal spinlocks.

-- 
Jens Axboe

  reply	other threads:[~2026-09-23 16:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260919123021.21318-1-chuanx2070@163.com>
2026-09-23 16:16 ` [PATCH v2] io_uring/lock: Keep spinlock release before wake_up() Xiaochuan Li
2026-09-23 16:52   ` Jens Axboe [this message]
2026-09-23 21:13   ` Gabriel Krisman Bertazi
2026-09-23 21:15     ` Jens Axboe
2026-09-23 16:48 ` Xiaochuan Li
2026-09-23 17:20   ` [PATCH v3] " Xiaochuan Li
2026-09-23 17:37     ` Jens Axboe
2026-09-24  6:32       ` Sebastian Andrzej Siewior

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=35640d8a-4a6e-4e86-b553-5d5bdcba6e1c@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bigeasy@linutronix.de \
    --cc=chuanx2070@163.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.