Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3161642lqp; Tue, 26 Mar 2024 00:53:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrhl4II4YB6u4SyKDNNjNPF5cesFD+ApgAZf+yjrIyPyGxIIEh0F0i8cf+YBxQ4ClwtTnZ7CieRM0OlVg5I/TxEnUDV8Mr3G00jas22w== X-Google-Smtp-Source: AGHT+IEY4pVjGm7XFkE3ozZDqzwNuLufGRTqTzGj/BtZ08r4r5nuzis9Dmn4vTRLtkDWuhAOGwCl X-Received: by 2002:a05:6a20:6a05:b0:1a3:8d32:c182 with SMTP id p5-20020a056a206a0500b001a38d32c182mr1038801pzk.11.1711439633820; Tue, 26 Mar 2024 00:53:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711439633; cv=pass; d=google.com; s=arc-20160816; b=IG8/pAUilbj1ZJ4KdlGPS5k1fGPmAsToP7iyrvz+mM0HjjBxg2Ku5UN7AlvTOZmCK6 1KIytE5k4aqi5q6T3MwpOv/nIvx3awZOyCb2Mgg94Yd85XyPvS4lEJ7BEzrQN4GXhpGD 5uM04D2tIUM+4oKv47v1S/r+9tvYLXWDOTFUYyYnOFl5Wrib/QDG0krcSXgG6Q+1Y/oc 9FKICoHW0GPw/mw8kMma9QS8TJhJSOb6+UViZ7hwlpZz5d+uH4s7ZdRG3v1YZObUBAqr aBjqSB4A9FGYkDpvt0hATRRGtmKohXBG7iOfJdEzVqDUhbq2JOyi+iUcu7EBohkbK1Qf PgIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=Ot6b39AXYDAVGwlyEemjJVuPK4U4r83NNhgKBebl2bA=; fh=qb7/UQARZeRoCdXG0X0pzDjA1dT+01OSCxtFSjM8RzE=; b=0MlPPKh3cVhRhSbT4+HrECqNdjlbV2ezCL8AYgqUKPnVZhHkKAietKei3fDwtkDWQ2 XvRDi+zIY7nGrZ0Tj1G2I65v9By2vulFR0n6cg2lpyDCbbxalsyN/KpKNWLhDvngBY1J GG+jwDjhBaM5bNoA9W2OS1pdPzH4ywr1Fmhd6rm+d3rqDBpuE2HPC7fjwVgUeAMHjgHu y+GZdcz6j55svAXQmoYzMJDYQwHmngO1HRHt1CZ6kpo3vMHKcdebtgYtsi7XXc5lwkkK zwhlPYrjP+aMWRtTdvhdH9O0PPSw7yAG2R3LE33t9XW16wq0r75JxwK4BHm1tF6CS20B g85w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="tg/RSc4V"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-118490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118490-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g1-20020a632001000000b005dc893fcd90si9054272pgg.362.2024.03.26.00.53.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 00:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="tg/RSc4V"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-118490-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118490-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 74A592E2D07 for ; Tue, 26 Mar 2024 07:53:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D453613281F; Tue, 26 Mar 2024 07:53:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="tg/RSc4V" Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B199F4CB2E; Tue, 26 Mar 2024 07:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711439625; cv=none; b=Yz6q7OjcmMjxz78vXELf62o+1wANWcUGOZE9ofUjycKgVuF0YCNorE/J9v9qcK/fIw5b5A35dMtGXSPAq7QGoqIpuYq+CUJ65ToSD3z774Rg5mPB5d5MFMGY56t1lxTvq2J0sIuCyH7BNZNIc1+MYon0kDMYuFjcGUFKccgj5NM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711439625; c=relaxed/simple; bh=RSZylZlCpTdbm+Z9o6U3XqmKBS0KpMhd9GAVethT39M=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=bX7rkRoOUhREL19yf1krFhojPLqTtT6cLzcSiORsF4q7M6VaUlVNuu0+0xeS/PUmhgMjmCl91b4GEL6Bvj+ThekIqPithbgrOenw4urfaP2nIjF8/4zbM+5BTHNbt/lkT4bgrOtS9q2YCK1/j9zVDk1v+Ja7wuWKOKu3Pcja6GM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=tg/RSc4V; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=Ot6b39AXYDAVGwlyEemjJVuPK4U4r83NNhgKBebl2bA=; t=1711439623; x=1712649223; b=tg/RSc4VYDSnmfkVKJrEkvfEeqmJfQgxumJcpSsqMuwj11j WzojvYa8DYb+0WCXdkOThtdhjx8mRDaYQTlZrh6y2su34DsZc9g9G0vl2v9XogzQTuXfmIEB9Q7iZ eiavY8AEVRuPrXh0fzAFBnjWYfusBqHWiUvCpaKroGb5pd3GhXylZFVjg29kqX/Te+tH4DkoeOTnA sqDcK7zkbti4bAONOCEZOZyosvCypIL/0nDZ7hUkYp3E1g8xa5UboEASxJS6o5yc0ljwQE4KGstQL JfLKiXbm4qF647EBeO7ZhevNZXh4D6I+uxVyFhlLci3IAwYxdJYoKmc41B5yvmnw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rp1cq-0000000FYHx-0UH6; Tue, 26 Mar 2024 08:53:40 +0100 Message-ID: <0659e47eb33c4159168abe392764a1de44e9bc71.camel@sipsolutions.net> Subject: Re: [PATCH] rcu: mollify sparse with RCU guard From: Johannes Berg To: Dan Carpenter Cc: Boqun Feng , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Josh Triplett , Peter Zijlstra Date: Tue, 26 Mar 2024 08:53:39 +0100 In-Reply-To: <04081c65-f9bf-404c-8557-7af72f6a72de@moroto.mountain> References: <20240325101626.41584-2-johannes@sipsolutions.net> <055111792727869a98c1fa693014e0b6f5d256ea.camel@sipsolutions.net> <35355d02-3eef-4860-847b-b7bbf05f4a31@moroto.mountain> <48034addaeb6c33ca8b3e636262b6c043ddc5359.camel@sipsolutions.net> <04081c65-f9bf-404c-8557-7af72f6a72de@moroto.mountain> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Tue, 2024-03-26 at 10:39 +0300, Dan Carpenter wrote: > On Mon, Mar 25, 2024 at 07:43:18PM +0100, Johannes Berg wrote: > > On Mon, 2024-03-25 at 21:28 +0300, Dan Carpenter wrote: > > > On Mon, Mar 25, 2024 at 05:41:22PM +0100, Johannes Berg wrote: > > > > Also __acquire()/__release() are just empty macros without __CHECKE= R__. > > > > So not sure the indirection really is warranted for this special ca= se. > > > >=20 > > > > I can add a comment in there, I guess, something like > > > >=20 > > > > /* sparse doesn't actually "call" cleanup functions */ > > > >=20 > > > > perhaps. That reminds me I forgot to CC Dan ... > > > >=20 > > >=20 > > > These are Sparse warnings, not Smatch warning... Smatch doesn't use a= ny > > > of the Sparse locking annotations. > >=20 > > Sure, of course. I just saw that you added cleanup stuff to sparse to > > allow using it in smatch. > >=20 > > > Smatch handles cleanup basically correctly at this point. > >=20 > > Do you "run" / "emit" the cleanup function calls there? >=20 > Yes. I see. I guess that doesn't work for sparse. You write: This shouldn't really have been needed if I had written the parse.c code correctly to create new scopes for every __cleanup__. Would that maybe be a way to handle it in sparse? Though not sure how to return then. > > I briefly look > > at doing that in sparse but it felt ... complicated, and then I saw the > > condition in the cleanup function which I thought sparse could probably > > not see through anyway. >=20 > The if (_T->lock) statements are a problem. For those, I have to > manually add them to check_locking.c as an unlock function and to > check_preempt.c as a decrement the preempt count function. OK, no fun. I think overall it's still easier to go with this patch :) And maybe we should think about replacing what we need sparse for... johannes