All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [rcu:willy-maple 189/202] mm/mmap.c:2830:18: warning: variable 'ma_lock' set but not used
Date: Wed, 03 Feb 2021 11:07:46 +0800	[thread overview]
Message-ID: <202102031140.3Ms6psce-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git willy-maple
head:   7e346d2845b4bd77663394f39fa70456e0084c86
commit: e40a951e09ed0e66dbd646f938df19c876915b9d [189/202] mm: Remove vma linked list.
config: alpha-defconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=e40a951e09ed0e66dbd646f938df19c876915b9d
        git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
        git fetch --no-tags rcu willy-maple
        git checkout e40a951e09ed0e66dbd646f938df19c876915b9d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   mm/mmap.c:2366:5: warning: no previous prototype for 'do_mas_align_munmap' [-Wmissing-prototypes]
    2366 | int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
         |     ^~~~~~~~~~~~~~~~~~~
   mm/mmap.c: In function '__do_sys_remap_file_pages':
>> mm/mmap.c:2830:18: warning: variable 'ma_lock' set but not used [-Wunused-but-set-variable]
    2830 |  struct ma_state ma_lock;
         |                  ^~~~~~~


vim +/ma_lock +2830 mm/mmap.c

  2824	
  2825		struct mm_struct *mm = current->mm;
  2826		struct vm_area_struct *vma;
  2827		unsigned long populate = 0;
  2828		unsigned long ret = -EINVAL;
  2829		struct file *file;
> 2830		struct ma_state ma_lock;
  2831		MA_STATE(mas, &mm->mm_mt, start, start);
  2832	
  2833		pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst.\n",
  2834			     current->comm, current->pid);
  2835	
  2836		if (prot)
  2837			return ret;
  2838	
  2839		start = start & PAGE_MASK;
  2840		size = size & PAGE_MASK;
  2841		if (start + size <= start)
  2842			return ret;
  2843	
  2844		/* Does pgoff wrap? */
  2845		if (pgoff + (size >> PAGE_SHIFT) < pgoff)
  2846			return ret;
  2847	
  2848		if (mmap_write_lock_killable(mm))
  2849			return -EINTR;
  2850	
  2851		mas_set(&mas, start);
  2852		vma = mas_walk(&mas);
  2853		ma_lock = mas;
  2854	
  2855		if (!vma || !(vma->vm_flags & VM_SHARED))
  2856			goto out;
  2857	
  2858		if (!vma->vm_file)
  2859			goto out;
  2860	
  2861		if (start + size > vma->vm_end) {
  2862			struct vm_area_struct *prev, *next;
  2863	
  2864			prev = vma;
  2865			mas_for_each(&mas, next, start + size) {
  2866				/* hole between vmas ? */
  2867				if (next->vm_start != prev->vm_end)
  2868					goto out;
  2869	
  2870				if (next->vm_file != vma->vm_file)
  2871					goto out;
  2872	
  2873				if (next->vm_flags != vma->vm_flags)
  2874					goto out;
  2875	
  2876				if (start + size <= next->vm_end)
  2877					break;
  2878	
  2879				prev = next;
  2880			}
  2881	
  2882			if (!next)
  2883				goto out;
  2884		}
  2885	
  2886		prot |= vma->vm_flags & VM_READ ? PROT_READ : 0;
  2887		prot |= vma->vm_flags & VM_WRITE ? PROT_WRITE : 0;
  2888		prot |= vma->vm_flags & VM_EXEC ? PROT_EXEC : 0;
  2889	
  2890		flags &= MAP_NONBLOCK;
  2891		flags |= MAP_SHARED | MAP_FIXED | MAP_POPULATE;
  2892	
  2893		file = get_file(vma->vm_file);
  2894		ret = do_mmap(vma->vm_file, start, size,
  2895				prot, flags, pgoff, &populate, NULL);
  2896		fput(file);
  2897	out:
  2898		mmap_write_unlock(mm);
  2899		if (populate)
  2900			mm_populate(ret, populate);
  2901		if (!IS_ERR_VALUE(ret))
  2902			ret = 0;
  2903		return ret;
  2904	}
  2905	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 13878 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [rcu:willy-maple 189/202] mm/mmap.c:2830:18: warning: variable 'ma_lock' set but not used
Date: Wed, 3 Feb 2021 11:07:46 +0800	[thread overview]
Message-ID: <202102031140.3Ms6psce-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git willy-maple
head:   7e346d2845b4bd77663394f39fa70456e0084c86
commit: e40a951e09ed0e66dbd646f938df19c876915b9d [189/202] mm: Remove vma linked list.
config: alpha-defconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=e40a951e09ed0e66dbd646f938df19c876915b9d
        git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
        git fetch --no-tags rcu willy-maple
        git checkout e40a951e09ed0e66dbd646f938df19c876915b9d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   mm/mmap.c:2366:5: warning: no previous prototype for 'do_mas_align_munmap' [-Wmissing-prototypes]
    2366 | int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
         |     ^~~~~~~~~~~~~~~~~~~
   mm/mmap.c: In function '__do_sys_remap_file_pages':
>> mm/mmap.c:2830:18: warning: variable 'ma_lock' set but not used [-Wunused-but-set-variable]
    2830 |  struct ma_state ma_lock;
         |                  ^~~~~~~


vim +/ma_lock +2830 mm/mmap.c

  2824	
  2825		struct mm_struct *mm = current->mm;
  2826		struct vm_area_struct *vma;
  2827		unsigned long populate = 0;
  2828		unsigned long ret = -EINVAL;
  2829		struct file *file;
> 2830		struct ma_state ma_lock;
  2831		MA_STATE(mas, &mm->mm_mt, start, start);
  2832	
  2833		pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst.\n",
  2834			     current->comm, current->pid);
  2835	
  2836		if (prot)
  2837			return ret;
  2838	
  2839		start = start & PAGE_MASK;
  2840		size = size & PAGE_MASK;
  2841		if (start + size <= start)
  2842			return ret;
  2843	
  2844		/* Does pgoff wrap? */
  2845		if (pgoff + (size >> PAGE_SHIFT) < pgoff)
  2846			return ret;
  2847	
  2848		if (mmap_write_lock_killable(mm))
  2849			return -EINTR;
  2850	
  2851		mas_set(&mas, start);
  2852		vma = mas_walk(&mas);
  2853		ma_lock = mas;
  2854	
  2855		if (!vma || !(vma->vm_flags & VM_SHARED))
  2856			goto out;
  2857	
  2858		if (!vma->vm_file)
  2859			goto out;
  2860	
  2861		if (start + size > vma->vm_end) {
  2862			struct vm_area_struct *prev, *next;
  2863	
  2864			prev = vma;
  2865			mas_for_each(&mas, next, start + size) {
  2866				/* hole between vmas ? */
  2867				if (next->vm_start != prev->vm_end)
  2868					goto out;
  2869	
  2870				if (next->vm_file != vma->vm_file)
  2871					goto out;
  2872	
  2873				if (next->vm_flags != vma->vm_flags)
  2874					goto out;
  2875	
  2876				if (start + size <= next->vm_end)
  2877					break;
  2878	
  2879				prev = next;
  2880			}
  2881	
  2882			if (!next)
  2883				goto out;
  2884		}
  2885	
  2886		prot |= vma->vm_flags & VM_READ ? PROT_READ : 0;
  2887		prot |= vma->vm_flags & VM_WRITE ? PROT_WRITE : 0;
  2888		prot |= vma->vm_flags & VM_EXEC ? PROT_EXEC : 0;
  2889	
  2890		flags &= MAP_NONBLOCK;
  2891		flags |= MAP_SHARED | MAP_FIXED | MAP_POPULATE;
  2892	
  2893		file = get_file(vma->vm_file);
  2894		ret = do_mmap(vma->vm_file, start, size,
  2895				prot, flags, pgoff, &populate, NULL);
  2896		fput(file);
  2897	out:
  2898		mmap_write_unlock(mm);
  2899		if (populate)
  2900			mm_populate(ret, populate);
  2901		if (!IS_ERR_VALUE(ret))
  2902			ret = 0;
  2903		return ret;
  2904	}
  2905	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 13878 bytes --]

             reply	other threads:[~2021-02-03  3:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  3:07 kernel test robot [this message]
2021-02-03  3:07 ` [rcu:willy-maple 189/202] mm/mmap.c:2830:18: warning: variable 'ma_lock' set but not used kernel test robot
2021-02-03 15:42 ` Liam Howlett
2021-02-03 15:42   ` Liam Howlett

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=202102031140.3Ms6psce-lkp@intel.com \
    --to=lkp@intel.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.