From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A3B1CA5FB2 for ; Tue, 29 Sep 2026 01:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=swUmod02z4YSu+S0OpTFeerhJ++xu2t/bgwcilIXIDQ=; b=uP29gzE3CQotJ+ +v5tAAJ7yEeQ+mdog2GhuXl0+3VDFlW3pDRrARc7Gn9EQYm2TQL7l31+A4ktTsDmfnSdDO8AL3HoG VQxs5r2eMiRIt9YL4zpERkaBUswHWFrEDJbJQ1neLWKjYUpNsrX+dobpuDh7TAvMhlTwXwfB4s+iq QP4nILqVJkwSEcnQ+lVvH+DvGefZdNpMR2NYLZleiYwNco39nBf3mx3mBug7UHxKy+hcEzwcNm75i /nUdO80hrsdUQvwX+wP2a3O0Ow2H+1XfVi6DoYXR6122U3iGFNBiJF+SzjH4OJQlpgk1nm3cgCcIg WJ38/FVHZpzdt2zKgh7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBMNI-000000020f1-0lNh; Tue, 29 Sep 2026 01:11:16 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xAOuI-0000000FE61-2vMS; Sat, 26 Sep 2026 09:41:22 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1C08043E2E; Sat, 26 Sep 2026 09:41:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E8C81F000FF; Sat, 26 Sep 2026 09:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790415681; bh=0u13dbBevDvvrKeztStjJV2PV5yx6LiZibgW9CGmgFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Jp0AvcBc2qFPX1KUyqat5xOo7kolWDkC6C0w6P6DaUvXm5iSIG2CZI03JVCmdPvQ2 vFXKg46qQ6h6qbDwt9b4xtSV8aaaHLKGAB793g+poJ3xMYhkIZo7xqXL5RLvULfLUx vltnCfE9F9DOd8HFLd4r2r4Sg0lUuE/yF336VcdgoJJtQs97NrE8ayt+3eU4eDKxGI oItyuRRw3Cj0jyhydyYqR3Mm1CDYrci/+rQrHCVid7DDrx80EwRj+MiAUgyhESJ7FS iOAhXbJnk5J5uDUKfyr1oX15QJ3wMcCu5lNOsTEzc+QVqHwaov8/ApQZu8GqGu9l4+ gmVl8+MdCcOZA== Date: Sat, 26 Sep 2026 10:40:50 +0100 From: "Lorenzo Stoakes (ARM)" To: Arnd Bergmann Cc: Andrew Morton , "Liam R. Howlett" , "Vlastimil Babka (SUSE)" , Jann Horn , Pedro Falcato , "David Hildenbrand (Red Hat)" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonathan Corbet , Greg Kroah-Hartman , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Paul Moore , Stephen Smalley , Jaroslav Kysela , Takashi Iwai , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , "Kirill A. Shutemov" , Doug Gilbert , "James E . J . Bottomley" , "Martin K. Petersen" , Jaya Kumar , Simona Vetter , Helge Deller , Sebastian Reichel , John Hubbard , peterx , Masami Hiramatsu , Oleg Nesterov , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Rik van Riel , Harry Yoo , Juri Lelli , Vincent Guittot , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Dave Airlie , Will Deacon , "Aneesh Kumar K.V (Arm)" , Nicholas Piggin , Muchun Song , Oscar Salvador , Matthew Wilcox , Jan Kara , Marc Zyngier , Oliver Upton , Catalin Marinas , Madhavan Srinivasan , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , "David S . Miller" , Andreas Larsson , Alexander Viro , Christian Brauner , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , Youngjun Park , Johannes Weiner , Qi Zheng , Shakeel Butt , Axel Rasmussen , Yuanchu Xie , Wei Xu , Chengming Zhou , Michal Hocko , Miklos Szeredi , Xu Xin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-usb@vger.kernel.org, linux-rdma@vger.kernel.org, selinux@vger.kernel.org, linux-sound@vger.kernel.org, bpf@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Linux-Arch , linux-fsdevel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, fuse-devel@lists.linux.dev, Takashi Iwai , Emil Tsalapatis Subject: Re: [PATCH v3 00/40] mm: make VMA flag semantics explicit, eliminate VM_SPECIAL Message-ID: References: <20260917-b4-mmap-prepare-vma-flag-sanify-v3-0-4583d8a23bca@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Mon, 28 Sep 2026 18:11:13 -0700 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sat, Sep 26, 2026 at 12:06:22AM +0200, Arnd Bergmann wrote: > On Thu, Sep 17, 2026, at 18:22, Lorenzo Stoakes (ARM) wrote: > > > > mm/vma.c | 246 +++++++++++++++++++------- > > Hi Lorenzo, > > I see that in linux-next there is a new build failure in some > configurations in code that you are changing here: Thanks for the report! > > mm/vma.c: In function '__mmap_region': > mm/vma.c:3083:1: error: the frame size of 1552 bytes is larger than 1536 bytes [-Werror=frame-larger-than=] > > I don't immediately see anything that you did that would have introduced > something bad that wasn't already there, so it's likely just gone from > just below the limit I was using for my testing to just above. The 1536 > byte limit is what I use on 64-bit builds with KASAN and otherwise > still has a clean build (with a small number of local fixup patches). Hmm are you specifying this limit manually somehow? > > What I see is that this function has multiple structures on the > stack that have nontrivial sizes: > > VMA_ITERATOR(vmi, mm, addr); /* 104 bytes */ > MMAP_STATE(map, mm, &vmi, addr, len,...); /* 384 bytes */ > struct vm_area_desc desc; /* 128 bytes */ > > The config that caused this is https://pastebin.com/raw/5M95qHy5, > which is an x86-64 build with CONFIG_KASAN_STACK enabled, and likely > a few other configuration options that made it a little worse. > KASAN_STACK tends to double the stack size used by structures > in order to catch out-of-bounds accesses. Yeah, there is a lot on the stack admittedly but there is also a lot of state being used. I'm sure we can reduce it. > > If I sprinkle some 'noinline_for_stack' annotations on functions > called by __mmap_region(), I can get the size down to 1144 in this > config, but that doesn't sound like a great workaround. > > The large stack usage is potentially harmful if this ends up > in call chains that have additional large stack usage (e.g. > kmalloc() leading to reclaim). Any ideas for how to reduce it here? That can never happen :) this call chain is _only_ for an mmap() call. > > Arnd In general I am absolutely taking this seriously and will find a way to reduce this, but my only question is whether this is actually something that needs to be done in this series? Because it's already huge and I would rather avoid adding yet another patch to it if possible. If I can do it as a follow-up that'd be ideal! Thanks! -- Cheers, Lorenzo _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv