linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naoya Horiguchi <naoya.horiguchi@linux.dev>
To: zhenwei pi <pizhenwei@bytedance.com>
Cc: akpm@linux-foundation.org, naoya.horiguchi@nec.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Wu Fengguang <fengguang.wu@intel.com>
Subject: Re: [PATCH 1/4] mm/memory-failure.c: move clear_hwpoisoned_pages
Date: Fri, 6 May 2022 17:55:32 +0900	[thread overview]
Message-ID: <20220506085532.GA1356094@u2004> (raw)
In-Reply-To: <20220429142206.294714-2-pizhenwei@bytedance.com>

On Fri, Apr 29, 2022 at 10:22:03PM +0800, zhenwei pi wrote:
> clear_hwpoisoned_pages() clears HWPoison flag and decreases the number
> of poisoned pages, this actually works as part of memory failure.
> 
> Move this function from sparse.c to memory-failure.c, finally there
> is no CONFIG_MEMORY_FAILURE in sparse.c.
> 
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
>  mm/internal.h       | 11 +++++++++++
>  mm/memory-failure.c | 21 +++++++++++++++++++++
>  mm/sparse.c         | 27 ---------------------------
>  3 files changed, 32 insertions(+), 27 deletions(-)
> 
> diff --git a/mm/internal.h b/mm/internal.h
> index cf16280ce132..e8add8df4e0f 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -758,4 +758,15 @@ struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags);
>  
>  DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
>  
> +/*
> + * mm/memory-failure.c
> + */
> +#ifdef CONFIG_MEMORY_FAILURE
> +void clear_hwpoisoned_pages(struct page *memmap, int nr_pages);
> +#else
> +static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
> +{
> +}
> +#endif

This code may be put near the definitions of hwpoison_filter* in mm/internal.h
because they are also called from mm/memory-failure.

Otherwise, looks good to me.

Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>

  reply	other threads:[~2022-05-06  8:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 14:22 [PATCH 0/4] memory-failure: fix hwpoison_filter zhenwei pi
2022-04-29 14:22 ` [PATCH 1/4] mm/memory-failure.c: move clear_hwpoisoned_pages zhenwei pi
2022-05-06  8:55   ` Naoya Horiguchi [this message]
2022-04-29 14:22 ` [PATCH 2/4] mm/memofy-failure.c:: simplify num_poisoned_pages_dec zhenwei pi
2022-05-06  8:55   ` Naoya Horiguchi
2022-04-29 14:22 ` [PATCH 3/4] mm/memofy-failure.c: optimize hwpoison_filter zhenwei pi
2022-05-06  8:59   ` Naoya Horiguchi
2022-05-06 13:38     ` zhenwei pi
2022-05-06 16:28       ` David Hildenbrand
2022-05-07  0:28         ` zhenwei pi
2022-05-07  8:20           ` Naoya Horiguchi
2022-05-07  9:19             ` zhenwei pi
2022-04-29 14:22 ` [PATCH 4/4] mm/memofy-failure.c: add hwpoison_filter for soft offline zhenwei pi
2022-05-06  8:59   ` Naoya Horiguchi

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=20220506085532.GA1356094@u2004 \
    --to=naoya.horiguchi@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.com \
    --cc=pizhenwei@bytedance.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;
as well as URLs for NNTP newsgroup(s).