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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 2A7B6C87FCB for ; Tue, 5 Aug 2025 09:38:26 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4bx7dr57wRz3069; Tue, 5 Aug 2025 19:38:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=139.178.84.217 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1754386704; cv=none; b=W8KPW+0oeoEOEmwfwz/QTTwl2FvD0vspVxtGpcfeUz/8ce7md8eOoyYSnPmwvsVfQznJEUrc0AUDSZUOmFPFKQGvQUfOSnA5rD26BZnRysRGJSdi76YKBu3kHDz9O7JKV1gzYFUqf5VXGiWa4k+7DBgaWyorE3GVclbjkBXwKi+GTxeHAp3ko1on7lYX3NQhSnFlN3Ur6vhNuZctqYx9dMyFyx/UDg5Zn0uVfQ6w+/7GLN0Me2WpPtGuX7ZDQAvARRJHIsUqituMHg6l6Rn+dmJqHDiqglSMEpnBWlSe5BvvUcCFTdU/PrQ9TE8iCgS6QfwRTCKuqO3kyNMJniH/dA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1754386704; c=relaxed/relaxed; bh=qq75wLn4Jr35PxKHT8Ir8YDRfOwxEOJ3fDUl+YJWOlw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q8VabYWR46wcRp2P5FGdwvmjpskmd6L3eCEYxdNm7bJUzPPkl6oyaOL+klm77J7+syxpGmsn+tP7trfV3jddSlwv9UPjihXACgU8EgobSil7wAydS6L+7mUpJ/e7jMGzp65DhEpmcEp4kl4xU9BSZoHC6fhYj2+/JYLFNi5GNMGoLG87lXU9jmmXsESTXmJmJdjGW+1RUKQSXVmCNccKzA2JkRx+B6TTm4WPkRozbSwjFrQiTH/AQMAtL+WJ4++eWibFXF0Xzcr10mwbxCSYhOw0lQ06XK14f4MlJbGBcWBnk21oPvFnQ4rvpYV66sIvSSfKJqTFX6YZLUTShvMklg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=WaqdWXeH; dkim-atps=neutral; spf=pass (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=rppt@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=WaqdWXeH; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=rppt@kernel.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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) by lists.ozlabs.org (Postfix) with ESMTPS id 4bx7dq4s4bz3064 for ; Tue, 5 Aug 2025 19:38:23 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 230995C3FEF; Tue, 5 Aug 2025 09:38:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B73A3C4CEF7; Tue, 5 Aug 2025 09:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754386699; bh=PtcIziWKmeZojE8NbukEIlxT+NCLvvfcRfGscENjViM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WaqdWXeHFq4oltQn9PTlA505X/oL+/hHqNtgIoY7zKJ2rAIIyFMHaM+0OG/yh2pw4 a4OPg6vNpHqwYzZOYWH9z2eFj0o9qdjphfKwQATxpDET/tUKgH15v5CCmaccGtiziI K47HqBXpuuIazHWs7f7nOBdJzkPcC6o7Uz2XE0NjVLokbL/vEdh4tvhC3lSlpz6wIJ cRJvBI/3D77VRI3Nw6Ov+py/jFgFc5Ni8OH6Dnx4eGST8kP5vZjYp9Nb+FQNxwUhWq 2m2r86L7YkwtCZGME114r4pdSCFeteEHhrAOdiqvbKwV054IIClCJwCyv020K+cNSI X5cmccT7jkP9Q== Date: Tue, 5 Aug 2025 12:37:57 +0300 From: Mike Rapoport To: Uladzislau Rezki Cc: Lorenzo Stoakes , Harry Yoo , Andrew Morton , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "David S . Miller" , Andreas Larsson , Jarkko Sakkinen , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Alexander Viro , Christian Brauner , Jan Kara , Kees Cook , Peter Xu , David Hildenbrand , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Xu Xin , Chengming Zhou , Hugh Dickins , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Rik van Riel , Dan Williams , Matthew Wilcox , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jason Gunthorpe , John Hubbard , Muchun Song , Oscar Salvador , Jann Horn , Pedro Falcato , Johannes Weiner , Qi Zheng , Shakeel Butt , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, sparclinux@vger.kernel.org, linux-sgx@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently Message-ID: References: <73764aaa-2186-4c8e-8523-55705018d842@lucifer.local> <69860c97-8a76-4ce5-b1d6-9d7c8370d9cd@lucifer.local> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Aug 04, 2025 at 12:54:21PM +0200, Uladzislau Rezki wrote: > Hello, Lorenzo! > > > So sorry Ulad, I meant to get back to you on this sooner! > > > > On Tue, Jul 29, 2025 at 08:39:01PM +0200, Uladzislau Rezki wrote: > > > On Tue, Jul 29, 2025 at 06:25:39AM +0100, Lorenzo Stoakes wrote: > > > > Andrew - FYI there's nothing to worry about here, the type remains > > > > precisely the same, and I'll send a patch to fix this trivial issue so when > > > > later this type changes vmalloc will be uaffected. > > > > > > > > On Tue, Jul 29, 2025 at 09:15:51AM +0900, Harry Yoo wrote: > > > > > [Adding Uladzislau to Cc] > > > > > > > > Ulad - could we PLEASE get rid of 'vm_flags' in vmalloc? It's the precise > > > > same name and (currently) type as vma->vm_flags and is already the source > > > > of confusion. > > > > > > > You mean all "vm_flags" variable names? "vm_struct" has flags as a > > > member. So you want: > > > > > > urezki@pc638:~/data/backup/coding/linux-not-broken.git$ grep -rn vm_flags mm/execmem.c > > > 29: pgprot_t pgprot, unsigned long vm_flags) > > > 39: vm_flags |= VM_DEFER_KMEMLEAK; > > > 41: if (vm_flags & VM_ALLOW_HUGE_VMAP) > > > 45: pgprot, vm_flags, NUMA_NO_NODE, > > > 51: pgprot, vm_flags, NUMA_NO_NODE, > > > 85: pgprot_t pgprot, unsigned long vm_flags) > > > 259: unsigned long vm_flags = VM_ALLOW_HUGE_VMAP; > > > 266: p = execmem_vmalloc(range, alloc_size, PAGE_KERNEL, vm_flags); > > > 376: unsigned long vm_flags = VM_FLUSH_RESET_PERMS; > > > 385: p = execmem_vmalloc(range, size, pgprot, vm_flags); > > > urezki@pc638:~/data/backup/coding/linux-not-broken.git$ grep -rn vm_flags mm/vmalloc.c > > > 3853: * @vm_flags: additional vm area flags (e.g. %VM_NO_GUARD) > > > 3875: pgprot_t prot, unsigned long vm_flags, int node, > > > 3894: if (vmap_allow_huge && (vm_flags & VM_ALLOW_HUGE_VMAP)) { > > > 3912: VM_UNINITIALIZED | vm_flags, start, end, node, > > > 3977: if (!(vm_flags & VM_DEFER_KMEMLEAK)) > > > 4621: vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP); > > > urezki@pc638:~/data/backup/coding/linux-not-broken.git$ grep -rn vm_flags mm/execmem.c > > > 29: pgprot_t pgprot, unsigned long vm_flags) > > > 39: vm_flags |= VM_DEFER_KMEMLEAK; > > > 41: if (vm_flags & VM_ALLOW_HUGE_VMAP) > > > 45: pgprot, vm_flags, NUMA_NO_NODE, > > > 51: pgprot, vm_flags, NUMA_NO_NODE, > > > 85: pgprot_t pgprot, unsigned long vm_flags) > > > 259: unsigned long vm_flags = VM_ALLOW_HUGE_VMAP; > > > 266: p = execmem_vmalloc(range, alloc_size, PAGE_KERNEL, vm_flags); > > > 376: unsigned long vm_flags = VM_FLUSH_RESET_PERMS; > > > 385: p = execmem_vmalloc(range, size, pgprot, vm_flags); > > > urezki@pc638:~/data/backup/coding/linux-not-broken.git$ grep -rn vm_flags ./include/linux/vmalloc.h > > > 172: pgprot_t prot, unsigned long vm_flags, int node, > > > urezki@pc638:~/data/backup/coding/linux-not-broken.git$ > > > > > > to rename all those "vm_flags" to something, for example, like "flags"? > > > > Yeah, sorry I know it's a churny pain, but I think it's such a silly source > > of confusion _in general_, not only this series where I made a mistake (of > > course entirely my fault but certainly more understandable given the > > naming), but in the past I've certainly sat there thinking 'hmmm wait' :) > > > > Really I think we should rename 'vm_struct' too, but if that causes _too > > much_ churn fair enough. Well, it's not that terrible :) ~/git/linux$ git grep -w vm_struct | wc -l 173 > > I think even though it's long-winded, 'vmalloc_flags' would be good, both > > in fields and local params as it makes things very very clear. > > > > Equally 'vm_struct' -> 'vmalloc_struct' would be a good change. Do we really need the _struct suffix? How about vmalloc_area? It also seems that struct vmap_area can be made private to mm/. > Uh.. This could be a pain :) I will have a look and see what we can do. > > Thanks! > > -- > Uladzislau Rezki -- Sincerely yours, Mike.