All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Harry Yoo <harry.yoo@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	"David S . Miller" <davem@davemloft.net>,
	Andreas Larsson <andreas@gaisler.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Kees Cook <kees@kernel.org>, Peter Xu <peterx@redhat.com>,
	David Hildenbrand <david@redhat.com>, Zi Yan <ziy@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Xu Xin <xu.xin16@zte.com.cn>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	Hugh Dickins <hughd@google.com>, Vlastimil Babka <vbabka@suse.cz>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Rik van Riel <riel@surriel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	John Hubbard <jhubbard@nvidia.com>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>, Jann Horn <jannh@google.com>,
	Pedro Falcato <pfalcato@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	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
Date: Tue, 5 Aug 2025 12:37:57 +0300	[thread overview]
Message-ID: <aJHQ9XCLtibFjt93@kernel.org> (raw)
In-Reply-To: <aJCRXVP-ZFEPtl1Y@pc636>

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.

  reply	other threads:[~2025-08-05  9:38 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 19:42 [PATCH 0/3] use vm_flags_t consistently Lorenzo Stoakes
2025-06-18 19:42 ` [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument Lorenzo Stoakes
2025-06-19  8:42   ` Christian Brauner
2025-06-19  8:49     ` Lorenzo Stoakes
2025-06-20 18:46       ` Pedro Falcato
2025-06-19 11:31   ` Vlastimil Babka
2025-06-19 12:18     ` Lorenzo Stoakes
2025-06-19 12:12   ` Oscar Salvador
2025-06-19 12:20     ` Lorenzo Stoakes
2025-06-19 12:25   ` Lorenzo Stoakes
2025-06-23 14:16     ` David Hildenbrand
2025-06-20 18:31   ` Pedro Falcato
2025-06-23 14:32   ` Zi Yan
2025-06-23 15:17   ` Catalin Marinas
2025-06-25  5:55   ` Anshuman Khandual
2025-06-18 19:42 ` [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently Lorenzo Stoakes
2025-06-18 21:17   ` Kees Cook
2025-06-19  7:44   ` Jan Kara
2025-06-19  8:37   ` Christian Brauner
2025-06-19 11:48   ` Vlastimil Babka
2025-06-19 12:06   ` Oscar Salvador
2025-06-20 18:49   ` Pedro Falcato
2025-06-23 14:17   ` David Hildenbrand
2025-06-23 14:33   ` Zi Yan
2025-06-25  6:00   ` Anshuman Khandual
2025-07-29  0:15   ` Harry Yoo
2025-07-29  5:25     ` Lorenzo Stoakes
2025-07-29 18:39       ` Uladzislau Rezki
2025-08-01 11:20         ` Lorenzo Stoakes
2025-08-04 10:54           ` Uladzislau Rezki
2025-08-05  9:37             ` Mike Rapoport [this message]
2025-08-05 16:13               ` Uladzislau Rezki
2025-08-25 21:37                 ` Kees Cook
2025-08-27 16:59                   ` Uladzislau Rezki
2025-06-18 19:42 ` [PATCH 3/3] mm: update architecture and driver code to use vm_flags_t Lorenzo Stoakes
2025-06-19  8:43   ` Christian Brauner
2025-06-19 11:48   ` Vlastimil Babka
2025-06-19 12:18   ` Oscar Salvador
2025-06-20 18:47   ` Pedro Falcato
2025-06-23 14:18   ` David Hildenbrand
2025-06-23 14:34   ` Zi Yan
2025-06-23 15:17   ` Catalin Marinas
2025-06-24 20:44   ` Jarkko Sakkinen
2025-06-25  6:08   ` Anshuman Khandual
2025-06-19  5:47 ` [PATCH 0/3] use vm_flags_t consistently Mike Rapoport
2025-06-25  2:55 ` Anshuman Khandual
2025-06-25  4:50   ` Andrew Morton
2025-06-25  6:47     ` Lorenzo Stoakes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aJHQ9XCLtibFjt93@kernel.org \
    --to=rppt@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@gaisler.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bp@alien8.de \
    --cc=brauner@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=chengming.zhou@linux.dev \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=harry.yoo@oracle.com \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=kees@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=luto@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=muchun.song@linux.dev \
    --cc=npache@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=osalvador@suse.de \
    --cc=peterx@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pfalcato@suse.de \
    --cc=riel@surriel.com \
    --cc=rostedt@goodmis.org \
    --cc=ryan.roberts@arm.com \
    --cc=shakeel.butt@linux.dev \
    --cc=sparclinux@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=xu.xin16@zte.com.cn \
    --cc=zhengqi.arch@bytedance.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.