linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: huang ying <huang.ying.caritas@gmail.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linux-mm@kvack.org, Peter Zijlstra <peterz@infradead.org>,
	 Huang Ying <ying.huang@intel.com>
Subject: Re: [PATCH 1/3] mm: prefix page_cpupid_reset_last as non-atomic
Date: Mon, 21 Dec 2020 09:53:45 +0800	[thread overview]
Message-ID: <CAC=cRTNaAf3Y3WYPsF3rc-gKzi-rTmpttNRQwXGmaHiOrrUzoA@mail.gmail.com> (raw)
In-Reply-To: <20201220050340.849754-1-npiggin@gmail.com>

Hi, Nicholas,

On Sun, Dec 20, 2020 at 1:03 PM Nicholas Piggin <npiggin@gmail.com> 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@gmail.com>
> ---
>  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


      parent reply	other threads:[~2020-12-21  1:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20  5:03 Nicholas Piggin
2020-12-20  5:03 ` [PATCH 2/3] mm: add page_cpupid_reset_last atomic variant Nicholas Piggin
2020-12-20  5:03 ` [PATCH 3/3] mm: skip page_cpupid_reset_last atomic update if the value is already reset Nicholas Piggin
2020-12-21  1:53 ` huang ying [this message]

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='CAC=cRTNaAf3Y3WYPsF3rc-gKzi-rTmpttNRQwXGmaHiOrrUzoA@mail.gmail.com' \
    --to=huang.ying.caritas@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=ying.huang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox