Re: [PATCH 07/12] mempolicy: mpol_shared_policy_init() without pseudo-vma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 25, 2023 at 01:29:28AM -0700, Hugh Dickins wrote:
> +		/* alloc node covering entire file; adds ref to new */

This comment is confusing.  sp_alloc initialises the refcount of 'n' to 1.
Which is the same memory referred to by the name 'new' in __mpol_dup(),
but in this function, the name "new" refers to the mempolicy called
"old" in __mpol_dup().

> +		n = sp_alloc(0, MAX_LFS_FILESIZE >> PAGE_SHIFT, new);
> +		if (n)
> +			sp_insert(sp, n);
>  put_new:
>  		mpol_put(new);			/* drop initial ref */
>  free_scratch:

This is all a bit inefficient, really.  We call mpol_new() to get a
new mpol, then we set it up, then we dup it, then we free it.  It'd
be nice if we could donate it instead of copying it.  Maybe you'll
do something like that later.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux