public inbox for [email protected]
 help / color / mirror / Atom feed
From: Naoya Horiguchi <[email protected]>
To: kernel test robot <[email protected]>
Cc: Naoya Horiguchi <[email protected]>,
	[email protected], Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	[email protected],
	Andrew Morton <[email protected]>,
	Linux Memory Management List <[email protected]>
Subject: Re: [ammarfaizi2-block:akpm/mm/mm-unstable 480/484] drivers/base/memory.c:186:34: error: 'struct memory_block' has no member named 'nr_hwpoison'
Date: Fri, 23 Sep 2022 17:18:27 +0900	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Fri, Sep 23, 2022 at 12:00:13PM +0800, kernel test robot wrote:
> tree:   https://github.com/ammarfaizi2/linux-block akpm/mm/mm-unstable
> head:   1dee68cfead9a3a85e244a274b4e85620abd5331
> commit: 69b496f03bb46c7ce743aff0d976c078d753d6d6 [480/484] mm/hwpoison: introduce per-memory_block hwpoison counter
> config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220923/[email protected]/config)
> compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
> reproduce (this is a W=1 build):
>         # https://github.com/ammarfaizi2/linux-block/commit/69b496f03bb46c7ce743aff0d976c078d753d6d6
>         git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
>         git fetch --no-tags ammarfaizi2-block akpm/mm/mm-unstable
>         git checkout 69b496f03bb46c7ce743aff0d976c078d753d6d6
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <[email protected]>
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/base/memory.c: In function 'memory_block_online':
> >> drivers/base/memory.c:186:34: error: 'struct memory_block' has no member named 'nr_hwpoison'
>      186 |         if (atomic_long_read(&mem->nr_hwpoison))
>          |                                  ^~
>    drivers/base/memory.c: In function 'remove_memory_block_devices':
>    drivers/base/memory.c:870:61: error: 'struct memory_block' has no member named 'nr_hwpoison'
>      870 |                 clear_hwpoisoned_pages(atomic_long_read(&mem->nr_hwpoison));
>          |                                                             ^~
> 

Thanks for the report, I should've used the accessor memblk_nr_poison()
to acccess to ->nr_hwpoison.  The following diff should fix this.

Thanks,
Naoya Horiguchi
---
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index c9bde4c4ffdf..f470bbfc68d0 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -183,7 +183,7 @@ static int memory_block_online(struct memory_block *mem)
 	struct zone *zone;
 	int ret;
 
-	if (atomic_long_read(&mem->nr_hwpoison))
+	if (memblk_nr_poison(start_pfn))
 		return -EHWPOISON;
 
 	zone = zone_for_pfn_range(mem->online_type, mem->nid, mem->group,
@@ -867,7 +867,7 @@ void remove_memory_block_devices(unsigned long start, unsigned long size)
 		mem = find_memory_block_by_id(block_id);
 		if (WARN_ON_ONCE(!mem))
 			continue;
-		clear_hwpoisoned_pages(atomic_long_read(&mem->nr_hwpoison));
+		clear_hwpoisoned_pages(memblk_nr_poison(start));
 		unregister_memory_block_under_nodes(mem);
 		remove_memory_block(mem);
 	}
@@ -1199,4 +1199,9 @@ unsigned long memblk_nr_poison(unsigned long pfn)
 	return 0;
 }
 
+#else
+unsigned long memblk_nr_poison(unsigned long pfn)
+{
+	return 0;
+}
 #endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2fe42bb9a517..5445943bbb4b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -3282,7 +3282,6 @@ extern int __get_huge_page_for_hwpoison(unsigned long pfn, int flags);
 extern void num_poisoned_pages_inc(unsigned long pfn);
 extern void memblk_nr_poison_inc(unsigned long pfn);
 extern void memblk_nr_poison_sub(unsigned long pfn, long i);
-extern unsigned long memblk_nr_poison(unsigned long pfn);
 extern void clear_hwpoisoned_pages(long nr_poison);
 #else
 static inline int __get_huge_page_for_hwpoison(unsigned long pfn, int flags)
@@ -3298,6 +3297,7 @@ static inline void clear_hwpoisoned_pages(long nr_poison)
 {
 }
 #endif
+extern unsigned long memblk_nr_poison(unsigned long pfn);
 
 #ifndef arch_memory_failure
 static inline int arch_memory_failure(unsigned long pfn, int flags)

      reply	other threads:[~2022-09-23  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23  4:00 [ammarfaizi2-block:akpm/mm/mm-unstable 480/484] drivers/base/memory.c:186:34: error: 'struct memory_block' has no member named 'nr_hwpoison' kernel test robot
2022-09-23  8:18 ` Naoya Horiguchi [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=20220923081827.GA1357512@ik1-406-35019.vs.sakura.ne.jp \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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