From: Christoph Hellwig <hch@lst.de>
To: Yongpeng Yang <yangyongpeng.storage@gmail.com>
Cc: Damien Le Moal <dlemoal@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>,
linux-block@vger.kernel.org,
Yongpeng Yang <yangyongpeng@xiaomi.com>,
Yongpeng Yang <yangyongpeng.storage@outlook.com>
Subject: Re: [PATCH v2 1/1] zloop: ensure atomicity of state checks in zloop_queue_rq
Date: Mon, 15 Dec 2025 06:31:53 +0100 [thread overview]
Message-ID: <20251215053153.GA30599@lst.de> (raw)
In-Reply-To: <20251213134545.207014-3-yangyongpeng.storage@gmail.com>
On Sat, Dec 13, 2025 at 09:45:46PM +0800, Yongpeng Yang wrote:
> From: Yongpeng Yang <yangyongpeng@xiaomi.com>
>
> The state check of zlo->state in zloop_queue_rq() fails to guarantee
> atomicity. This patch changes zlo->state to an atomic_t type variable,
> avoiding the use of the zloop_ctl_mutex lock for protection.
Err, no. atomic_t for states is rarely a good idea. And unless I'm
missing something this state check is just an optimization, so a
data_race() should be enough. Either way this should probably first
be done and discussed for the loop code that has a lot more reviewers
and then ported to zloop.
next prev parent reply other threads:[~2025-12-15 5:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-13 13:45 [PATCH v2 1/1] zloop: ensure atomicity of state checks in zloop_queue_rq Yongpeng Yang
2025-12-15 5:31 ` Christoph Hellwig [this message]
2025-12-15 6:25 ` Yongpeng Yang
2025-12-15 6:26 ` Damien Le Moal
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=20251215053153.GA30599@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=yangyongpeng.storage@gmail.com \
--cc=yangyongpeng.storage@outlook.com \
--cc=yangyongpeng@xiaomi.com \
/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.