From: Michal Hocko <mhocko@kernel.org>
To: Jiang Biao <jiang.biao2@zte.com.cn>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
hillf.zj@alibaba-inc.com, minchan@kernel.org,
ying.huang@intel.com, mgorman@techsingularity.net,
n-horiguchi@ah.jp.nec.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn
Subject: Re: [PATCH v2] mm: fix page_freeze_refs and page_unfreeze_refs in comments.
Date: Thu, 26 Jul 2018 09:36:27 +0200 [thread overview]
Message-ID: <20180726073627.GT28386@dhcp22.suse.cz> (raw)
In-Reply-To: <1532590226-106038-1-git-send-email-jiang.biao2@zte.com.cn>
On Thu 26-07-18 15:30:26, Jiang Biao wrote:
> page_freeze_refs/page_unfreeze_refs have already been relplaced by
> page_ref_freeze/page_ref_unfreeze , but they are not modified in
> the comments.
>
> Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
This looks better.
Acked-by: Michal Hocko <mhocko@suse.com>
Thanks!
> ---
> v1: fix comments in vmscan.
> v2: fix other two places and fix typoes.
>
> mm/ksm.c | 4 ++--
> mm/memory-failure.c | 2 +-
> mm/vmscan.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/mm/ksm.c b/mm/ksm.c
> index a6d43cf..4c39cb67 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -703,7 +703,7 @@ static struct page *get_ksm_page(struct stable_node *stable_node, bool lock_it)
> * We cannot do anything with the page while its refcount is 0.
> * Usually 0 means free, or tail of a higher-order page: in which
> * case this node is no longer referenced, and should be freed;
> - * however, it might mean that the page is under page_freeze_refs().
> + * however, it might mean that the page is under page_ref_freeze().
> * The __remove_mapping() case is easy, again the node is now stale;
> * but if page is swapcache in migrate_page_move_mapping(), it might
> * still be our page, in which case it's essential to keep the node.
> @@ -714,7 +714,7 @@ static struct page *get_ksm_page(struct stable_node *stable_node, bool lock_it)
> * work here too. We have chosen the !PageSwapCache test to
> * optimize the common case, when the page is or is about to
> * be freed: PageSwapCache is cleared (under spin_lock_irq)
> - * in the freeze_refs section of __remove_mapping(); but Anon
> + * in the ref_freeze section of __remove_mapping(); but Anon
> * page->mapping reset to NULL later, in free_pages_prepare().
> */
> if (!PageSwapCache(page))
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 9d142b9..c83a174 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1167,7 +1167,7 @@ int memory_failure(unsigned long pfn, int flags)
> * R/W the page; let's pray that the page has been
> * used and will be freed some time later.
> * In fact it's dangerous to directly bump up page count from 0,
> - * that may make page_freeze_refs()/page_unfreeze_refs() mismatch.
> + * that may make page_ref_freeze()/page_ref_unfreeze() mismatch.
> */
> if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p)) {
> if (is_free_buddy_page(p)) {
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 03822f8..02d0c20 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -744,7 +744,7 @@ static int __remove_mapping(struct address_space *mapping, struct page *page,
> refcount = 2;
> if (!page_ref_freeze(page, refcount))
> goto cannot_free;
> - /* note: atomic_cmpxchg in page_freeze_refs provides the smp_rmb */
> + /* note: atomic_cmpxchg in page_ref_freeze provides the smp_rmb */
> if (unlikely(PageDirty(page))) {
> page_ref_unfreeze(page, refcount);
> goto cannot_free;
> --
> 2.7.4
>
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2018-07-26 7:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 7:30 Jiang Biao
2018-07-26 7:36 ` Michal Hocko [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=20180726073627.GT28386@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hillf.zj@alibaba-inc.com \
--cc=jiang.biao2@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=minchan@kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=ying.huang@intel.com \
--cc=zhong.weidong@zte.com.cn \
/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