All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 7735/7934] mm/hugetlb.c:5565:14: warning: variable 'reserve_alloc' set but not used
Date: Mon, 19 Sep 2022 16:28:30 -0700	[thread overview]
Message-ID: <Yyj7HsJWfHDoU24U@monkey> (raw)
In-Reply-To: <202209200603.Hpvoa8Ii-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2863 bytes --]

On 09/20/22 06:30, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   4c9ca5b1597e3222177ba2a94658f78fa5ef4f58
> commit: 449f4bb2cb94b16a2014eeef41f4a50c8a3ecbdc [7735/7934] hugetlb: clean up code checking for fault/truncation races
> config: i386-defconfig (https://download.01.org/0day-ci/archive/20220920/202209200603.Hpvoa8Ii-lkp(a)intel.com/config)
> compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
> reproduce (this is a W=1 build):
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=449f4bb2cb94b16a2014eeef41f4a50c8a3ecbdc
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 449f4bb2cb94b16a2014eeef41f4a50c8a3ecbdc
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    mm/hugetlb.c: In function 'hugetlb_no_page':
> >> mm/hugetlb.c:5565:14: warning: variable 'reserve_alloc' set but not used [-Wunused-but-set-variable]
>     5565 |         bool reserve_alloc = false;
>          |              ^~~~~~~~~~~~~

Below patch will address warning,

>From 99366ab6e4d84426069f44f134921b3601ec1cbf Mon Sep 17 00:00:00 2001
From: Mike Kravetz <mike.kravetz@oracle.com>
Date: Mon, 19 Sep 2022 16:23:24 -0700
Subject: [PATCH] hugetlb: fix reserve_alloc set but not used compiler warning

Error path code checking the reserve_alloc variable was removed as it
was determined it was not necessary.  However, the variable itself was
not removed at the same time.  Remove now.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
 mm/hugetlb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9b8526d27c29..0c3c2c5ef994 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5536,7 +5536,6 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
 	spinlock_t *ptl;
 	unsigned long haddr = address & huge_page_mask(h);
 	bool new_page, new_pagecache_page = false;
-	bool reserve_alloc = false;
 
 	/*
 	 * Currently, we are forced to kill the process in the event the
@@ -5592,8 +5591,6 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
 		clear_huge_page(page, address, pages_per_huge_page(h));
 		__SetPageUptodate(page);
 		new_page = true;
-		if (HPageRestoreReserve(page))
-			reserve_alloc = true;
 
 		if (vma->vm_flags & VM_MAYSHARE) {
 			int err = hugetlb_add_to_page_cache(page, mapping, idx);
-- 
2.37.3

WARNING: multiple messages have this Message-ID (diff)
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 7735/7934] mm/hugetlb.c:5565:14: warning: variable 'reserve_alloc' set but not used
Date: Mon, 19 Sep 2022 16:28:30 -0700	[thread overview]
Message-ID: <Yyj7HsJWfHDoU24U@monkey> (raw)
In-Reply-To: <202209200603.Hpvoa8Ii-lkp@intel.com>

On 09/20/22 06:30, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   4c9ca5b1597e3222177ba2a94658f78fa5ef4f58
> commit: 449f4bb2cb94b16a2014eeef41f4a50c8a3ecbdc [7735/7934] hugetlb: clean up code checking for fault/truncation races
> config: i386-defconfig (https://download.01.org/0day-ci/archive/20220920/202209200603.Hpvoa8Ii-lkp@intel.com/config)
> compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
> reproduce (this is a W=1 build):
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=449f4bb2cb94b16a2014eeef41f4a50c8a3ecbdc
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 449f4bb2cb94b16a2014eeef41f4a50c8a3ecbdc
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    mm/hugetlb.c: In function 'hugetlb_no_page':
> >> mm/hugetlb.c:5565:14: warning: variable 'reserve_alloc' set but not used [-Wunused-but-set-variable]
>     5565 |         bool reserve_alloc = false;
>          |              ^~~~~~~~~~~~~

Below patch will address warning,

From 99366ab6e4d84426069f44f134921b3601ec1cbf Mon Sep 17 00:00:00 2001
From: Mike Kravetz <mike.kravetz@oracle.com>
Date: Mon, 19 Sep 2022 16:23:24 -0700
Subject: [PATCH] hugetlb: fix reserve_alloc set but not used compiler warning

Error path code checking the reserve_alloc variable was removed as it
was determined it was not necessary.  However, the variable itself was
not removed at the same time.  Remove now.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
 mm/hugetlb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9b8526d27c29..0c3c2c5ef994 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5536,7 +5536,6 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
 	spinlock_t *ptl;
 	unsigned long haddr = address & huge_page_mask(h);
 	bool new_page, new_pagecache_page = false;
-	bool reserve_alloc = false;
 
 	/*
 	 * Currently, we are forced to kill the process in the event the
@@ -5592,8 +5591,6 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
 		clear_huge_page(page, address, pages_per_huge_page(h));
 		__SetPageUptodate(page);
 		new_page = true;
-		if (HPageRestoreReserve(page))
-			reserve_alloc = true;
 
 		if (vma->vm_flags & VM_MAYSHARE) {
 			int err = hugetlb_add_to_page_cache(page, mapping, idx);
-- 
2.37.3



  reply	other threads:[~2022-09-19 23:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 22:30 [linux-next:master 7735/7934] mm/hugetlb.c:5565:14: warning: variable 'reserve_alloc' set but not used kernel test robot
2022-09-19 23:28 ` Mike Kravetz [this message]
2022-09-19 23:28   ` Mike Kravetz

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=Yyj7HsJWfHDoU24U@monkey \
    --to=mike.kravetz@oracle.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.