[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e7d08b99f133e901dfdf5c42d86a717062fb166d.camel@intel.com>
Date: Mon, 7 Dec 2020 23:55:00 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "seanjc@...gle.com" <seanjc@...gle.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"peterz@...radead.org" <peterz@...radead.org>,
"jeyu@...nel.org" <jeyu@...nel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"rppt@...nel.org" <rppt@...nel.org>,
"ast@...nel.org" <ast@...nel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"Weiny, Ira" <ira.weiny@...el.com>,
"x86@...nel.org" <x86@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"Reshetova, Elena" <elena.reshetova@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"luto@...nel.org" <luto@...nel.org>
Subject: Re: [PATCH RFC 01/10] vmalloc: Add basic perm alloc implementation
On Fri, 2020-12-04 at 15:24 -0800, Sean Christopherson wrote:
> On Fri, Nov 20, 2020, Rick Edgecombe wrote:
> > +struct perm_allocation {
> > + struct page **pages;
> > + virtual_perm cur_perm;
> > + virtual_perm orig_perm;
> > + struct vm_struct *area;
> > + unsigned long offset;
> > + unsigned long size;
> > + void *writable;
> > +};
> > +
> > +/*
> > + * Allocate a special permission kva region. The region may not be
> > mapped
> > + * until a call to perm_writable_finish(). A writable region will
> > be mapped
> > + * immediately at the address returned by perm_writable_addr().
> > The allocation
> > + * will be made between the start and end virtual addresses.
> > + */
> > +struct perm_allocation *perm_alloc(unsigned long vstart, unsigned
> > long vend, unsigned long page_cnt,
> > + virtual_perm perms);
>
> IMO, 'perm' as the root namespace is too generic, and perm_ is
> already very
> prevelant throughout the kernel. E.g. it's not obvious when looking
> at the
> callers that perm_alloc() is the first step in setting up an
> alternate kernel
> VA->PA mapping.
>
> I don't have a suggestion for a more intuitive name, but in the
> absence of a
> perfect name, I'd vote for an acronym that is easy to
> grep. Something like
> pvmap? That isn't currently used in the kernel, though I can't help
> but read it
> as "paravirt map"...
Good point, thanks.
After Christoph's comments to return a vm_struct pointer, I was going
to try to pick some more vmalloc-like names. Like vmalloc_perm(),
vmalloc_writable_finish(), etc. Still have to play around with it some
more.
Powered by blists - more mailing lists