From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 A391A311967; Tue, 20 Jan 2026 16:01:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768924863; cv=none; b=Q+RZoKlKpLAyLu1OCCPzY9wIebDUfBNoU2xBQkxunQjlJ5OlrgMPOP9bAzd5lfGbXvusOqfq9454kzeOcid+tAGC4KevDG+yuvz1ireb7Fw1Ht9/RmbEu1XEU8bSiK/iuDbsjGua4787xrpvnE3GjQ44IsQuVshFHDskFTCUeU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768924863; c=relaxed/simple; bh=XntaNhMOb3ljN0OUod4vqOUNi4wPltdCRFCEO3POz5k=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=hTrzCie9REUOI6UPUmBxZfotDQie3fsip/O4uWuch5OxX6GI+kx86BL2A21d3VSeYtrpApkEGKTSz4mQ2HMixFStK9mEu/hvCVJzqTEcGdnpNmHtUxnhAIQKIwYLv2h9cTaOehuht6pIH8dEqcPr/L9ShjPgGwaReaTMR+Pl6gk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=kR9gOAj5; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=hcwcLU9t; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="kR9gOAj5"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hcwcLU9t" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailflow.stl.internal (Postfix) with ESMTP id A7CFA13012B5; Tue, 20 Jan 2026 11:00:57 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Tue, 20 Jan 2026 11:00:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1768924857; x=1768932057; bh=KfkVnVcFie+8lJSMwr+BM1cQg1+WZ1F7itYYKxiYDxA=; b= kR9gOAj5pXn1HlvyIPf1Dn2UnaJAS+jRzIAsaR2XzWmwVU3duRgbE0mh5JHntjXj cuWYepTHKUWzhsOhC73++QR5yvZK4X1S2AwaIcjIrwElOhOnB7qBma9Rt3sk4wEp WApUxciyhayGX/RZcK8fKFz6xIdI+xP0DrR1lTAATkjc8XoS7YDkMHYuYZCNVtBX 4oGFoRnhTrXR+Av/H+nXr31W99ztPY8wV3R2x29p9i/J68icSSg69RfuDb4y8YAC s4LhKb2VHYYXAgITpUrU4ktCyPGwkOI9lIgNBoXcky3A3mVVfmLH/JHxew6hI9Hi veL08yMhuZP0sXK/DL5Ezw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1768924857; x= 1768932057; bh=KfkVnVcFie+8lJSMwr+BM1cQg1+WZ1F7itYYKxiYDxA=; b=h cwcLU9t2Na5NvYNY+HqrNgOlIOAEx2zdTmluSgjajfn4eJ5F+JIB4BRW8ErmbMJb 5ljggxqqdQPdg2SZtb56c1NTdnpBu5weRDSXaiQR+Mg0Ub9iThiAQ79EUDX9yysa If4/Knasx1iPLLZBRyvYpz8FhOYnlESn3fgeQPRrN8KMwKv6jSRpu0DLxO2sSNsb R4TQnDC+MhnR+ow7ZS/sYxRoTgI4V6asIPb1zuVNFs2Fc8BB9RtG2146jooAzX5l vcbjXpebeDkjFdxXkF3/V9TJ8Omw44E5cSge6Qts1idwHBYUlshPhSE1PbPF8M3M EM/yfREYAwG76Llyugm5Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugedtkeefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedftehrnhgu uceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrthhtvg hrnhephfdthfdvtdefhedukeetgefggffhjeeggeetfefggfevudegudevledvkefhvdei necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnh gusegrrhhnuggsrdguvgdpnhgspghrtghpthhtohepgeefpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehjrghnihdrnhhikhhulhgrsehlihhnuhigrdhinhhtvghlrdgtoh hmpdhrtghpthhtohepjhhoohhnrghsrdhlrghhthhinhgvnheslhhinhhugidrihhnthgv lhdrtghomhdprhgtphhtthhopehmrggrrhhtvghnrdhlrghnkhhhohhrshhtsehlihhnuh igrdhinhhtvghlrdgtohhmpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhn uggrthhiohhnrdhorhhgpdhrtghpthhtohepughrihdquggvvhgvlheslhhishhtshdrfh hrvggvuggvshhkthhophdrohhrghdprhgtphhtthhopehinhhtvghlqdhgfhigsehlihhs thhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtohepnhhtfhhsfeeslhhish htshdrlhhinhhugidruggvvhdprhgtphhtthhopehnvhguihhmmheslhhishhtshdrlhhi nhhugidruggvvhdprhgtphhtthhopeguvghvvghlsehlihhsthhsrdhorhgrnhhgvghfsh drohhrgh X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A67DD70006A; Tue, 20 Jan 2026 11:00:54 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AWSx1lsrOtaB Date: Tue, 20 Jan 2026 17:00:28 +0100 From: "Arnd Bergmann" To: "Lorenzo Stoakes" , "Jason Gunthorpe" Cc: "Andrew Morton" , "Jarkko Sakkinen" , "Dave Hansen" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , x86@kernel.org, "H. Peter Anvin" , "Greg Kroah-Hartman" , "Dan Williams" , "Vishal Verma" , "Dave Jiang" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "Dave Airlie" , "Simona Vetter" , "Jani Nikula" , "Joonas Lahtinen" , "Rodrigo Vivi" , "Tvrtko Ursulin" , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Huang Rui" , "Matthew Auld" , "Matthew Brost" , "Alexander Viro" , "Christian Brauner" , "Jan Kara" , "Benjamin LaHaise" , "Gao Xiang" , "Chao Yu" , "Yue Hu" , "Jeffle Xu" , "Sandeep Dhavale" , "Hongbo Li" , "Chunhai Guo" , "Theodore Ts'o" , "Andreas Dilger" , "Muchun Song" , "Oscar Salvador" , "David Hildenbrand (Red Hat)" , "Konstantin Komarov" , "Mike Marshall" , "Martin Brandenburg" , "Tony Luck" , "Reinette Chatre" , "Dave Martin" , "James Morse" , "Babu Moger" , "Carlos Maiolino" , "Damien Le Moal" , "Naohiro Aota" , "Johannes Thumshirn" , "Matthew Wilcox" , "Liam R. Howlett" , "Vlastimil Babka" , "Mike Rapoport" , "Suren Baghdasaryan" , "Michal Hocko" , "Hugh Dickins" , "Baolin Wang" , "Zi Yan" , "Nico Pache" , "Ryan Roberts" , "Dev Jain" , "Barry Song" , "Lance Yang" , "Jann Horn" , "Pedro Falcato" , "David Howells" , "Paul Moore" , "James Morris" , "Serge E. Hallyn" , "Yury Norov" , "Rasmus Villemoes" , linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, ntfs3@lists.linux.dev, devel@lists.orangefs.org, linux-xfs@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Message-Id: <1617ac60-6261-483d-aeb5-13aba5f477af@app.fastmail.com> In-Reply-To: <488a0fd8-5d64-4907-873b-60cefee96979@lucifer.local> References: <20260119231403.GS1134360@nvidia.com> <36abc616-471b-4c7b-82f5-db87f324d708@lucifer.local> <20260120133619.GZ1134360@nvidia.com> <488a0fd8-5d64-4907-873b-60cefee96979@lucifer.local> Subject: Re: [PATCH RESEND 09/12] mm: make vm_area_desc utilise vma_flags_t only Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, Jan 20, 2026, at 16:10, Lorenzo Stoakes wrote: > On Tue, Jan 20, 2026 at 09:36:19AM -0400, Jason Gunthorpe wrote: > > I am not sure about this 'idiomatic kernel style' thing either, it feels rather > conjured. Yes you wouldn't ordinarily pass something larger than a register size > by-value, but here the intent is for it to be inlined anyway right? > > It strikes me that the key optimisation here is the inlining, now if the issue > is that ye olde compiler might choose not to inline very small functions (seems > unlikely) we could always throw in an __always_inline? I can think of three specific things going wrong with structures passed by value: - functions that cannot be inlined are bound by the ELF ABI, and several of them require structs to be passed on the stack regardless of the size. Most of the popular architectures seem fine here, but mips and powerpc look like they are affected. - The larger the struct is, the more architectures are affected. Parts of the amdgpu driver and the bcachefs file system ran into this with 64-bit structures passed by value on 32-bit architectures causing horrible codegen even with inlining. I think it's usually fine up to a single register size. - clang's inlining algorithm works the other way round from gcc's: inlining into the root caller first and sometimes leaving tiny leaf function out of line unless you add __always_inline. Arnd