Re: [PATCH 1/3] mm: prefix page_cpupid_reset_last as non-atomic

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

 



Hi, Nicholas,

On Sun, Dec 20, 2020 at 1:03 PM Nicholas Piggin <npiggin@xxxxxxxxx> wrote:
>
> Add a __ prefix to indicate that it should be used in non-atomic
> situations (where the page is not subject to concurrent flags
> access, following the pattern of the other page flags modifications).
>
> This prepares for an atomic version.
>
> Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
> ---
>  include/linux/mm.h | 6 +++---
>  mm/page_alloc.c    | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 855161080f18..5b3fc2c8fd8b 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1358,7 +1358,7 @@ static inline int page_cpupid_last(struct page *page)
>  {
>         return page->_last_cpupid;
>  }
> -static inline void page_cpupid_reset_last(struct page *page)
> +static inline void __page_cpupid_reset_last(struct page *page)
>  {
>         page->_last_cpupid = -1 & LAST_CPUPID_MASK;

How about replace all these

  -1 & LAST_CPUPID_MASK

and

  (1 << LAST_CPUPID_SHIFT) - 1)

with

  LAST_CPUPID_MASK

I think that can improve the code readability a little.

Best Regards,
Huang, Ying




[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