lkml.org 
[lkml]   [2020]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 01/10] vmalloc: Add basic perm alloc implementation
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"...

\
 
 \ /
  Last update: 2020-12-05 00:29    [W:0.125 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site