linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "HORIGUCHI NAOYA (堀口 直也)" <naoya.horiguchi@nec.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6] mm, hwpoison: use __PageMovable() to detect non-lru movable pages
Date: Tue, 6 Sep 2022 09:07:16 +0800	[thread overview]
Message-ID: <5a4fd4a3-da5c-5e83-c36b-4de0d9dce903@huawei.com> (raw)
In-Reply-To: <20220905145322.42d218d0d7d32d3c5f515027@linux-foundation.org>

On 2022/9/6 5:53, Andrew Morton wrote:
> On Mon, 5 Sep 2022 15:29:34 +0800 Miaohe Lin <linmiaohe@huawei.com> wrote:
> 
>> The above code change could be applied to the mm-tree directly. Or should I resend
>> the v2 series? Which one is more convenient for you? They're all fine to me. ;)
> 
> I got it, thanks.

Many thanks for doing this. That's very kind of you.

Thanks,
Miaohe Lin


> 
> From: Miaohe Lin <linmiaohe@huawei.com>
> Subject: mm-hwpoison-use-__pagemovable-to-detect-non-lru-movable-pages-fix
> Date: Mon, 5 Sep 2022 14:53:41 +0800
> 
> fixes per Naoya Horiguchi
> 
> Link: https://lkml.kernel.org/r/1f7ee86e-7d28-0d8c-e0de-b7a5a94519e8@huawei.com
> Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  mm/memory-failure.c |   16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> --- a/mm/memory-failure.c~mm-hwpoison-use-__pagemovable-to-detect-non-lru-movable-pages-fix
> +++ a/mm/memory-failure.c
> @@ -2404,24 +2404,26 @@ EXPORT_SYMBOL(unpoison_memory);
>  static bool isolate_page(struct page *page, struct list_head *pagelist)
>  {
>  	bool isolated = false;
> -	bool lru = !__PageMovable(page);
>  
>  	if (PageHuge(page)) {
>  		isolated = !isolate_hugetlb(page, pagelist);
>  	} else {
> +		bool lru = !__PageMovable(page);
> +
>  		if (lru)
>  			isolated = !isolate_lru_page(page);
>  		else
> -			isolated = !isolate_movable_page(page, ISOLATE_UNEVICTABLE);
> +			isolated = !isolate_movable_page(page,
> +							 ISOLATE_UNEVICTABLE);
>  
> -		if (isolated)
> +		if (isolated) {
>  			list_add(&page->lru, pagelist);
> +			if (lru)
> +				inc_node_page_state(page, NR_ISOLATED_ANON +
> +						    page_is_file_lru(page));
> +		}
>  	}
>  
> -	if (isolated && lru)
> -		inc_node_page_state(page, NR_ISOLATED_ANON +
> -				    page_is_file_lru(page));
> -
>  	/*
>  	 * If we succeed to isolate the page, we grabbed another refcount on
>  	 * the page, so we can safely drop the one we got from get_any_pages().
> _
> 
> .
> 



  reply	other threads:[~2022-09-06  1:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 12:35 [PATCH 0/6] A few cleanup patches for memory-failure Miaohe Lin
2022-08-30 12:35 ` [PATCH 1/6] mm, hwpoison: use ClearPageHWPoison() in memory_failure() Miaohe Lin
2022-09-05  5:23   ` HORIGUCHI NAOYA(堀口 直也)
2022-08-30 12:36 ` [PATCH 2/6] mm, hwpoison: use __PageMovable() to detect non-lru movable pages Miaohe Lin
2022-09-05  5:22   ` HORIGUCHI NAOYA(堀口 直也)
2022-09-05  6:53     ` Miaohe Lin
2022-09-05  7:15       ` HORIGUCHI NAOYA(堀口 直也)
2022-09-05  7:29         ` Miaohe Lin
2022-09-05 21:53           ` Andrew Morton
2022-09-06  1:07             ` Miaohe Lin [this message]
2022-08-30 12:36 ` [PATCH 3/6] mm, hwpoison: use num_poisoned_pages_sub() to decrease num_poisoned_pages Miaohe Lin
2022-09-05  5:24   ` HORIGUCHI NAOYA(堀口 直也)
2022-08-30 12:36 ` [PATCH 4/6] mm, hwpoison: avoid unneeded page_mapped_in_vma() overhead in collect_procs_anon() Miaohe Lin
2022-09-05  5:24   ` HORIGUCHI NAOYA(堀口 直也)
2022-08-30 12:36 ` [PATCH 5/6] mm, hwpoison: check PageTable() explicitly in hwpoison_user_mappings() Miaohe Lin
2022-09-05  5:25   ` HORIGUCHI NAOYA(堀口 直也)
2022-08-30 12:36 ` [PATCH 6/6] mm, hwpoison: cleanup some obsolete comments Miaohe Lin
2022-09-05  5:25   ` HORIGUCHI NAOYA(堀口 直也)

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=5a4fd4a3-da5c-5e83-c36b-4de0d9dce903@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.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