From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 003.mia.mailroute.net (003.mia.mailroute.net [199.89.3.6]) (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 1819C227EA8; Fri, 19 Sep 2025 17:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.3.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758302490; cv=none; b=c7T9XHmjTA03OrvOwM2NBW7Rx5zAuRVvIP2O/75SVXEh5cERUqBqLc4gD2IjGEnLeLiXs/q7HvE2eyKGcwCZVVHwl/JR5cE4fJwGtxDOz5lpuDkUz/j/vNKL9N1//Is+aItiq6GaT/Bq+RV5Ml6eGiEdFzkF/4+BUI6SM3vPd+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758302490; c=relaxed/simple; bh=/2jAKV9i75aKZxYUfkfVcPa5YZbB0ra8iEfrm/O5034=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RG8hSIQ4lYkrznnkzHPMpikDJe2agqr8ectv1Ws7lEHsJguBDdZqLgndBSaEYRBY3Gar+oi4nGsgFE4BXZXUdjsqZLylrfyeRItAlrNXpSeVo1OkN7/JQoPGizBcc7GS3Fe+3pxDlQVky5lGhWSu9Nyd2i5GxsICuJ0fvKoIS0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=L8/5f0d8; arc=none smtp.client-ip=199.89.3.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="L8/5f0d8" Received: from localhost (localhost [127.0.0.1]) by 003.mia.mailroute.net (Postfix) with ESMTP id 4cSznL5LKTzlgqVk; Fri, 19 Sep 2025 17:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1758302479; x=1760894480; bh=KlBMZtQYmssvvNlMdIFNyVIK CykDzp91ay9FSX4ijvY=; b=L8/5f0d8/kPyXoJ7DoiyeGUMePzHeJ+yVVI7oEG7 Y/g8nB7VZYf4pFB/HQcbU/WwOQ2kjYtYvAhsnrLL0quWX4GMl7aH01WO641cHC/M raSDU+8jQepUsqDl4DUTQF8dqtrahKmiJGLWao6jTYvwwlimGXdXMzTsblCck8Ol NvqBph9rN6BI19OaJVWn4FT33f19effNIdudp6goRn7YKrbmHqM/4d8zunz/tWEG UIL7ER/Wq2UJWgV6cMKzIZC7kqgMp0Y3EbzWN7cmkfJ4gcT1npp8XTK/9ii53vdh 99kxBiXmt1tlBKTOOth6OWvTsiMhLf/YOO7XCKUtlMWxxQ== X-Virus-Scanned: by MailRoute Received: from 003.mia.mailroute.net ([127.0.0.1]) by localhost (003.mia [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id OCIV4NH48gVh; Fri, 19 Sep 2025 17:21:19 +0000 (UTC) Received: from [100.66.154.22] (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 003.mia.mailroute.net (Postfix) with ESMTPSA id 4cSzmX4zj3zlgqW0; Fri, 19 Sep 2025 17:20:43 +0000 (UTC) Message-ID: Date: Fri, 19 Sep 2025 10:20:37 -0700 Precedence: bulk X-Mailing-List: linux-sparse@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 00/35] Compiler-Based Capability- and Locking-Analysis To: Christoph Hellwig , Nathan Chancellor Cc: Marco Elver , Peter Zijlstra , Boqun Feng , Ingo Molnar , Will Deacon , "David S. Miller" , Luc Van Oostenryck , "Paul E. McKenney" , Alexander Potapenko , Arnd Bergmann , Bill Wendling , Dmitry Vyukov , Eric Dumazet , Frederic Weisbecker , Greg Kroah-Hartman , Herbert Xu , Ian Rogers , Jann Horn , Joel Fernandes , Jonathan Corbet , Josh Triplett , Justin Stitt , Kees Cook , Kentaro Takeda , Lukas Bulwahn , Mark Rutland , Mathieu Desnoyers , Miguel Ojeda , Neeraj Upadhyay , Nick Desaulniers , Steven Rostedt , Tetsuo Handa , Thomas Gleixner , Thomas Graf , Uladzislau Rezki , Waiman Long , kasan-dev@googlegroups.com, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-sparse@vger.kernel.org, llvm@lists.linux.dev, rcu@vger.kernel.org References: <20250918140451.1289454-1-elver@google.com> <20250918141511.GA30263@lst.de> <20250918174555.GA3366400@ax162> <20250919140803.GA23745@lst.de> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20250919140803.GA23745@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/19/25 7:08 AM, Christoph Hellwig wrote: > 3) Wrappers that take multiple locks conditionally > > We have helpers that take different locks in the same object based on the > arguments like xfs_ilock() or those that take the same lock and a variable > number of objects like xfs_dqlockn based on input and sorting. The > first are just historic and we might want to kill them, but the > sorting of objects to acquire locks in order thing is a pattern in > various places including the VFS, so we'll need some way to annotate it. Hi Christoph, As you probably remember some time ago I took a look myself at adding locking annotations to kernel code. I ended up annotating multiple XFS functions with NO_THREAD_SAFETY_ANALYSIS. Maybe the locking patterns in XFS are too complex for compile-time analysis? See also the XFS changes in https://lore.kernel.org/lkml/20250206175114.1974171-33-bvanassche@acm.org/. Thanks, Bart.