mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm: hugepage: make hstate_is_gigantic() inline
@ 2017-05-22 12:46 Arnd Bergmann
  2017-05-22 12:56 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-05-22 12:46 UTC (permalink / raw)
  To: Andrew Morton, Aneesh Kumar K.V, Anshuman Khandual
  Cc: Arnd Bergmann, Mike Kravetz, Michal Hocko, Naoya Horiguchi,
	Andrea Arcangeli, zhong jiang, Kirill A. Shutemov, linux-kernel

Ignoring the argument of both alloc_huge_page_node() and hstate_is_gigantic()
causes a harmless warning:

mm/memory-failure.c: In function 'new_page':
mm/memory-failure.c:1493:18: error: unused variable 'hstate' [-Werror=unused-variable]

Turning one into an inline function makes the compiler see that the variable is
not meant to be unused.

Fixes: d81a077951f8 ("mm/madvise: enable (soft|hard) offline of HugeTLB pages at PGD level")
Fixes: 39b80148ffd7 ("mm/follow_page_mask: add support for hugepage directory entry")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/hugetlb.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 76b9ddcd8c3c..c92a1f0c7240 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -532,7 +532,11 @@ struct hstate {};
 #define vma_mmu_pagesize(v) PAGE_SIZE
 #define huge_page_order(h) 0
 #define huge_page_shift(h) PAGE_SHIFT
-#define hstate_is_gigantic(h) 0
+static inline bool hstate_is_gigantic(struct hstate *h)
+{
+	return false;
+}
+
 static inline unsigned int pages_per_huge_page(struct hstate *h)
 {
 	return 1;
-- 
2.9.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: hugepage: make hstate_is_gigantic() inline
  2017-05-22 12:46 [PATCH] mm: hugepage: make hstate_is_gigantic() inline Arnd Bergmann
@ 2017-05-22 12:56 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2017-05-22 12:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Aneesh Kumar K.V, Anshuman Khandual, Mike Kravetz,
	Naoya Horiguchi, Andrea Arcangeli, zhong jiang,
	Kirill A. Shutemov, linux-kernel

On Mon 22-05-17 14:46:57, Arnd Bergmann wrote:
> Ignoring the argument of both alloc_huge_page_node() and hstate_is_gigantic()
> causes a harmless warning:
> 
> mm/memory-failure.c: In function 'new_page':
> mm/memory-failure.c:1493:18: error: unused variable 'hstate' [-Werror=unused-variable]
> 
> Turning one into an inline function makes the compiler see that the variable is
> not meant to be unused.
> 
> Fixes: d81a077951f8 ("mm/madvise: enable (soft|hard) offline of HugeTLB pages at PGD level")
> Fixes: 39b80148ffd7 ("mm/follow_page_mask: add support for hugepage directory entry")

Both these sha1 are unstable because they are in Andrew's mmotm tree and
will change in future next trees. I would just drop them.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

the patch itself looks OK

> ---
>  include/linux/hugetlb.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 76b9ddcd8c3c..c92a1f0c7240 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -532,7 +532,11 @@ struct hstate {};
>  #define vma_mmu_pagesize(v) PAGE_SIZE
>  #define huge_page_order(h) 0
>  #define huge_page_shift(h) PAGE_SHIFT
> -#define hstate_is_gigantic(h) 0
> +static inline bool hstate_is_gigantic(struct hstate *h)
> +{
> +	return false;
> +}
> +
>  static inline unsigned int pages_per_huge_page(struct hstate *h)
>  {
>  	return 1;
> -- 
> 2.9.0
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-22 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 12:46 [PATCH] mm: hugepage: make hstate_is_gigantic() inline Arnd Bergmann
2017-05-22 12:56 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®