From nobody Wed Oct 8 21:09:37 2025 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E65351DE4DC; Wed, 25 Jun 2025 03:11:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750821093; cv=none; b=IUWGbLh2DqUxDyNMusExQ75SYfp0zwj1C+fnWyeZLZ2HhklNmMvCE5oy8rnCmCOJeyRVeJ2Khfyd8Y95bQghmTHjSsTliu78Uh4EqqYfaVUoF386BjZwd/7g69IhOau12lPo7DESwKANrf/jYAYa8pIURCC9RIlUTowwHcO2tLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750821093; c=relaxed/simple; bh=TZOtCUxplLpVZwlulyF2AdR7IutlsKFrx5aA44BpK6Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NnnO8k0gxFQk+WdqHiCzjTvnrdUjzL/p434y5R856PBLYwsC6g7jq5HqbiqSUjXJqT6iUamwdleI7ouWtTszbD/wD+Le3JDgYHrJYCHBxQDzPlcocGgD5NSdjuPWXzV3BKVQzQ39kPNkj+ipve5oEvwBL9VJadz/BHXuRe3a5RI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QIJS0OfZ; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QIJS0OfZ" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-7d3e5df4785so408181685a.0; Tue, 24 Jun 2025 20:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750821090; x=1751425890; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=qhQXR4q/1FKoBNWknRJmtYgN/63wc+pb7z14qfrzMOI=; b=QIJS0OfZeKYhj3IlYZFBGiCOB4LBouPxvd102+FS1UqnVFuWop6xkvtBRECGtR+FNz E02GrMKJeFyclFseoZSwoyPbSjcFIx+SUciunYBwdeInLuJsFcaNGMOuGoxQ6VGknS5E f31l8RTkpNKr7uwTBw66nNma6oJzb5rzTfLf/B9uTZsf7w6XkE6wfhqV+lJu/QF/ilXp qhmIggKdCJmHG3T2UqwCC7JjPupu+9uh/iuJcm/YUPAUTAah4IqcWkUTR+e6IT61pbMm jUbK2qpU9+imo6EUHYNKUZY02gsp+w+wP5rMyxnG8FTu6h0fBlfdmO1YIlywWTZCIUo8 aXzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750821090; x=1751425890; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qhQXR4q/1FKoBNWknRJmtYgN/63wc+pb7z14qfrzMOI=; b=lgK5mKe5AvjuxSHoz8v4U718/6OjouaYTpMSrBHeXFOUJB4ogA1x5V0cxeb/r8edbR yvr/JraBWWb0waUjHIAAZxBieK7nS/+KnV8aEb94wqFLO5Ik7HdlMd1GpTisJ5nkSJVN CLzDvZQNdG4N7QvbPfS2K69OuT7gv7KKil4rT50GvJeGfGLL4suLtOE/CPyq0gObFYdI iT+JZ8KbUVRsC/QSu0UC57LZf65FBbRAVL1ZgTo9usxWwtOYEaQEj0bhUSEwJ9VGFu1B 7M9xjHRWkyTuU9z0Cahp+mV0acLmlfV/Vk6i+6Fc516k4qIYP/IqmxDJO5aTdeppPgwG kS5A== X-Forwarded-Encrypted: i=1; AJvYcCUQIxhpUTp0EdkFnMSGEHucxRoBfrTugh9IJu1G4RVpGZbAqgpWmRCgX6zs05VuHSK6JH10GOM=@vger.kernel.org, AJvYcCWX7JUfd01GENW12pROpfpxLWcFi0PnBDNvJFh6Km3gZ0OqgJ9EDbx4T2m2c1Ms5kmDrjQf@vger.kernel.org X-Gm-Message-State: AOJu0Yxl3X9pZd8pYtPMQg29nwELI/5wyqrinZkvv2CsKzb/btl4Ghog Z0g6+obYO63ICAvC3CTlwr4fXIevyUHHgFQTR11VlMXQA6UAvLAQOix7 X-Gm-Gg: ASbGnctNyF80pokmm3vGO4Agr/vJ1IclFZtsH2qx5GGmts9N3W3aXVcEsXnuzEju00x P5BMsxGCmwyO43gX3phD1RNez8FhyWVbvP4O7TTr9hEU7/zWWSfKJHue24yUQUJITZS8nwe7qwS hpNZ8O3/fTHg6LdzmPl9zOXi7peYaRbfrnN7cWah01ViAZYr44Qs7Sg5w6aaDoO+rElJ/HfrO/k zvnYtHs7tY9uRKkXSFqAwcs+DzUEfw0N6le5pGfFeJUblvxO+odBLUFOetd4FhHEpeDVjuenC90 7mAuyd/8k5Rfc0KhnaG+++VQ+0oOwAnA7k50nrJNLcyMz8IWcWmDwvmFDrwUj4cjAmTAxaScopQ xSdg4JC7x8pb8Kgh6ZVcO0iYL6wGiO520xjdM8trVKpeTdi6rXyRd X-Google-Smtp-Source: AGHT+IEcTWAIOOFSCQca6pLktm0oe2Iu3mQqxK8tubUlzRS0uHFLS6o5cXHt4DbBg4x47R2Z4s8MFw== X-Received: by 2002:a05:620a:6a14:b0:7d4:29ea:a9a7 with SMTP id af79cd13be357-7d429eaaaf9mr113733385a.49.1750821089756; Tue, 24 Jun 2025 20:11:29 -0700 (PDT) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d3f999a5a8sm566908585a.18.2025.06.24.20.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 20:11:29 -0700 (PDT) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id C0A4CF40066; Tue, 24 Jun 2025 23:11:28 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 24 Jun 2025 23:11:28 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvudeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeeuohhquhhnucfh vghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrthhtvg hrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfevffeiueejhfeuiefggeeuheeggefg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqh hunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedtieegqddu jeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvg drnhgrmhgvpdhnsggprhgtphhtthhopedviedpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtg hpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlkhhm mheslhhishhtshdrlhhinhhugidruggvvhdprhgtphhtthhopehpvghtvghriiesihhnfh hrrgguvggrugdrohhrghdprhgtphhtthhopehmihhnghhosehkvghrnhgvlhdrohhrghdp rhgtphhtthhopeifihhllheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepsghoqhhunh drfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhhonhhgmhgrnhesrhgvughh rghtrdgtohhmpdhrtghpthhtohepuggrvhgvsehsthhgohhlrggsshdrnhgvth X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Jun 2025 23:11:28 -0400 (EDT) From: Boqun Feng To: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, lkmm@lists.linux.dev Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , Davidlohr Bueso , "Paul E. McKenney" , Josh Triplett , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Breno Leitao , aeh@meta.com, netdev@vger.kernel.org, edumazet@google.com, jhs@mojatatu.com, kernel-team@meta.com, Erik Lundgren Subject: [PATCH 3/8] shazptr: Add refscale test for wildcard Date: Tue, 24 Jun 2025 20:10:56 -0700 Message-Id: <20250625031101.12555-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250625031101.12555-1-boqun.feng@gmail.com> References: <20250625031101.12555-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the refscale test for shazptr, which starts another shazptr critical section inside an existing one to measure the reader side performance when wildcard logic is triggered. Signed-off-by: Boqun Feng --- kernel/rcu/refscale.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c index 154520e4ee4c..fdbb4a2c91fe 100644 --- a/kernel/rcu/refscale.c +++ b/kernel/rcu/refscale.c @@ -928,6 +928,44 @@ static const struct ref_scale_ops shazptr_ops =3D { .name =3D "shazptr" }; =20 +static void ref_shazptr_wc_read_section(const int nloops) +{ + int i; + + for (i =3D nloops; i >=3D 0; i--) { + preempt_disable(); + { + guard(shazptr)(ref_shazptr_read_section); + /* Trigger wildcard logic */ + guard(shazptr)(ref_shazptr_wc_read_section); + } + preempt_enable(); + } +} + +static void ref_shazptr_wc_delay_section(const int nloops, const int udl, = const int ndl) +{ + int i; + + for (i =3D nloops; i >=3D 0; i--) { + preempt_disable(); + { + guard(shazptr)(ref_shazptr_delay_section); + /* Trigger wildcard logic */ + guard(shazptr)(ref_shazptr_wc_delay_section); + un_delay(udl, ndl); + } + preempt_enable(); + } +} + +static const struct ref_scale_ops shazptr_wildcard_ops =3D { + .init =3D ref_shazptr_init, + .readsection =3D ref_shazptr_wc_read_section, + .delaysection =3D ref_shazptr_wc_delay_section, + .name =3D "shazptr_wildcard" +}; + static void rcu_scale_one_reader(void) { if (readdelay <=3D 0) @@ -1235,7 +1273,7 @@ ref_scale_init(void) &refcnt_ops, &rwlock_ops, &rwsem_ops, &lock_ops, &lock_irq_ops, &acqrel_ops, &sched_clock_ops, &clock_ops, &jiffies_ops, &typesafe_ref_ops, &typesafe_lock_ops, &typesafe_seqlock_ops, - &shazptr_ops, + &shazptr_ops, &shazptr_wildcard_ops, }; =20 if (!torture_init_begin(scale_type, verbose)) --=20 2.39.5 (Apple Git-154)