mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>
Cc: linux-kernel@vger.kernel.org, tzungbi@kernel.org,
	Bartosz Golaszewski <brgl@kernel.org>
Subject: [PATCH] revocable: Remove redundant synchronize_srcu() call
Date: Wed, 21 Jan 2026 04:02:04 +0000	[thread overview]
Message-ID: <20260121040204.2699886-1-tzungbi@kernel.org> (raw)

When allocating a revocable provider via revocable_provider_alloc(),
there is no revocable consumers (i.e., RCU readers) yet.  Remove the
redundant synchronize_srcu() call to save cycles.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
To address the performance impact reported in
https://lore.kernel.org/linux-gpio/CAMRc=McrFa42mNWmZtD1HKKKZ+USUKpQAAME50wbfxPM7L72gA@mail.gmail.com/.

 drivers/base/revocable.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/base/revocable.c b/drivers/base/revocable.c
index f6cece275aac..b068e18a847d 100644
--- a/drivers/base/revocable.c
+++ b/drivers/base/revocable.c
@@ -99,7 +99,6 @@ struct revocable_provider *revocable_provider_alloc(void *res)
 
 	init_srcu_struct(&rp->srcu);
 	rcu_assign_pointer(rp->res, res);
-	synchronize_srcu(&rp->srcu);
 	kref_init(&rp->kref);
 
 	return rp;
-- 
2.52.0.457.g6b5491de43-goog


             reply	other threads:[~2026-01-21  4:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  4:02 Tzung-Bi Shih [this message]
2026-01-21 10:38 ` Bartosz Golaszewski
2026-01-21 12:34   ` Tzung-Bi Shih
2026-01-21 15:18     ` Bartosz Golaszewski
2026-01-21 16:04       ` Tzung-Bi Shih
2026-01-21 16:58         ` Bartosz Golaszewski
2026-01-21 16:52       ` Tzung-Bi Shih

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=20260121040204.2699886-1-tzungbi@kernel.org \
    --to=tzungbi@kernel.org \
    --cc=brgl@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®