From: Zach Brown <zab@zabbo.net>
To: Valerie Aurora <val@versity.com>
Cc: rpdfs-devel@lists.linux.dev
Subject: Re: [PATCH 1/3] rpdfs: Use write_seqlock_bh() for balloc info
Date: Wed, 25 Mar 2026 15:05:58 -0700 [thread overview]
Message-ID: <20260325220558.GD990991@localhost.localdomain> (raw)
In-Reply-To: <20260319093727.15343-2-val@versity.com>
On Thu, Mar 19, 2026 at 10:37:25AM +0100, Valerie Aurora wrote:
> The balloc info seqlock is taken from bh context due to
> rpdfs_balloc_publish_region() being called from an RCU callback, so it
> needs to use write_seqlock_bh() instead of write_seqlock(). Found via
> lockdep.
I'll admit, I was being a bit lazy and not running with debug kernels as
consistently as I should :). I'll work on that.
> @@ -192,12 +192,12 @@ struct rpdfs_balloc_region *rpdfs_balloc_take_region(struct rpdfs_fs_info *rfi)
> while_read_seqretry(&balinf->seqlock)
> empty = list_empty(&balinf->region_list);
> if (!empty) {
> - write_seqlock(&balinf->seqlock);
> + write_seqlock_bh(&balinf->seqlock);
But let's do this another way. Let's not punish all the users of the
region for the single weirdly implemented publish.
While the builder is protected by RCU, the region isn't. It was just
bad reasoning to think that we needed to publish from call_rcu. We only
need to free the builder there.
For publishing, first we can move the use of the region up above the
decrements of in_flight. Then we save the result of the last in_flight
decrement for each case (initial trying to send, other responses
arriving). Whoever won and got in_flight down to 0 can take exclusive
ownership of the region and publish it. (The spin_unlock _release
semantics ensures that everyone's done with the region by the time they
start meessing with in_flight).
I'll that assume you want to take a swing at this but let me know if
you'd rather I clean up the mess I made.
- z
next prev parent reply other threads:[~2026-03-25 22:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 9:37 [PATCH 0/3] Minor locking fixes and debug output Valerie Aurora
2026-03-19 9:37 ` [PATCH 1/3] rpdfs: Use write_seqlock_bh() for balloc info Valerie Aurora
2026-03-25 22:05 ` Zach Brown [this message]
2026-03-19 9:37 ` [PATCH 2/3] rpdfs: Initialize block seqlock before using it and fix memleak Valerie Aurora
2026-03-25 22:08 ` Zach Brown
2026-03-19 9:37 ` [PATCH 3/3] rpdfs: Add debugging for block not found case in rpdfs_use_txn_prepared Valerie Aurora
2026-03-25 22:09 ` Zach Brown
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=20260325220558.GD990991@localhost.localdomain \
--to=zab@zabbo.net \
--cc=rpdfs-devel@lists.linux.dev \
--cc=val@versity.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.