From: Ming Lei <ming.lei@redhat.com>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>,
linux-block@vger.kernel.org, dlemoal@kernel.org, axboe@kernel.dk,
gjoyce@ibm.com
Subject: Re: [PATCHv2 1/6] blk-sysfs: remove q->sysfs_lock for attributes which don't need it
Date: Wed, 19 Feb 2025 17:20:13 +0800 [thread overview]
Message-ID: <Z7WiTZKIKBeFHf4I@fedora> (raw)
In-Reply-To: <d00f7633-c54c-4abf-b36d-eb941a6dcc5c@linux.ibm.com>
On Wed, Feb 19, 2025 at 02:26:49PM +0530, Nilay Shroff wrote:
>
>
> On 2/19/25 2:04 PM, Nilay Shroff wrote:
> >
> >
> > On 2/19/25 8:54 AM, Ming Lei wrote:
> >> On Tue, Feb 18, 2025 at 05:29:53PM +0100, Christoph Hellwig wrote:
> >>> On Tue, Feb 18, 2025 at 09:45:02PM +0800, Ming Lei wrote:
> >>>> IMO, this RO attributes needn't protection from q->limits_lock:
> >>>>
> >>>> - no lifetime issue
> >>>>
> >>>> - in-tree code needn't limits_lock.
> >>>>
> >>>> - all are scalar variable, so the attribute itself is updated atomically
> >>>
> >>> Except in the memory model they aren't without READ_ONCE/WRITE_ONCE.
> >>
> >> RW_ONCE is supposed for avoiding compiler optimization, and scalar
> >> variable atomic update should be decided by hardware.
> >>
> >>>
> >>> Given that the limits_lock is not a hot lock taking the lock is a very
> >>> easy way to mark our intent. And if we get things like thread thread
> >>> sanitizer patches merged that will become essential. Even KCSAN
> >>> might object already without it.
> >>
> >> My main concern is that there are too many ->store()/->load() variants
> >> now, but not deal if you think this way is fine, :-)
> >>
> > We will only have ->store_limit()/->show_limit() and ->store()/->load() in
> > the next patchset as I am going to cleanup load_module() as well as get away with show_nolock() and store_nolock() methods as discussed with Christoph in
> > another thread.
> >
>
> Sorry a typo, I meant we will only have ->store_limit()/->show_limit()
> and ->store()/show() methods. Also, we'll cleanup load_module() as well
> as get away with show_nolock() and store_nolock() methods in the next
> patchset as discussed with Christoph in another thread.
OK, that looks much better!
Thanks,
Ming
next prev parent reply other threads:[~2025-02-19 9:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 8:28 [PATCHv2 0/6] block: fix lock order and remove redundant locking Nilay Shroff
2025-02-18 8:28 ` [PATCHv2 1/6] blk-sysfs: remove q->sysfs_lock for attributes which don't need it Nilay Shroff
2025-02-18 8:46 ` Christoph Hellwig
2025-02-18 11:26 ` Nilay Shroff
2025-02-21 14:02 ` Nilay Shroff
2025-02-22 12:44 ` Ming Lei
2025-02-24 13:09 ` Nilay Shroff
2025-02-24 14:49 ` Christoph Hellwig
2025-02-26 12:09 ` Nilay Shroff
2025-02-24 8:41 ` Hannes Reinecke
2025-02-24 13:12 ` Nilay Shroff
2025-02-18 12:10 ` Ming Lei
2025-02-18 13:11 ` Nilay Shroff
2025-02-18 13:45 ` Ming Lei
2025-02-18 16:29 ` Christoph Hellwig
2025-02-19 3:24 ` Ming Lei
2025-02-19 5:42 ` Christoph Hellwig
2025-02-19 8:34 ` Nilay Shroff
2025-02-19 8:56 ` Nilay Shroff
2025-02-19 9:20 ` Ming Lei [this message]
2025-02-18 8:28 ` [PATCHv2 2/6] blk-sysfs: acquire q->limits_lock while reading attributes Nilay Shroff
2025-02-18 8:46 ` Christoph Hellwig
2025-02-18 8:28 ` [PATCHv2 3/6] block: Introduce a dedicated lock for protecting queue elevator updates Nilay Shroff
2025-02-18 9:05 ` Christoph Hellwig
2025-02-18 11:14 ` Nilay Shroff
2025-02-18 16:32 ` Christoph Hellwig
2025-02-19 8:41 ` Nilay Shroff
2025-02-18 8:28 ` [PATCHv2 4/6] blk-sysfs: protect nr_requests update using q->elevator_lock Nilay Shroff
2025-02-18 8:28 ` [PATCHv2 5/6] blk-sysfs: protect wbt_lat_usec " Nilay Shroff
2025-02-18 8:28 ` [PATCHv2 6/6] blk-sysfs: protect read_ahead_kb using q->limits_lock Nilay Shroff
2025-02-18 9:12 ` Christoph Hellwig
2025-02-18 11:27 ` Nilay Shroff
2025-02-18 9:21 ` [PATCHv2 0/6] block: fix lock order and remove redundant locking Christoph Hellwig
2025-02-18 12:09 ` Nilay Shroff
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=Z7WiTZKIKBeFHf4I@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=gjoyce@ibm.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=nilay@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox