linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nico Pache <npache@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Rafael Aquini <aquini@redhat.com>,
	Waiman Long <longman@redhat.com>, Baoquan He <bhe@redhat.com>,
	Christoph von Recklinghausen <crecklin@redhat.com>,
	Don Dutile <ddutile@redhat.com>,
	"Herton R . Krzesinski" <herton@redhat.com>,
	David Rientjes <rientjes@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Joel Savitz <jsavitz@redhat.com>,
	Darren Hart <dvhart@infradead.org>,
	stable@kernel.org
Subject: Re: [PATCH v8] oom_kill.c: futex: Don't OOM reap the VMA containing the robust_list_head
Date: Fri, 8 Apr 2022 22:41:17 +0800	[thread overview]
Message-ID: <202204082258.E7EPbAYz-lkp@intel.com> (raw)
In-Reply-To: <20220408032809.3696798-1-npache@redhat.com>

Hi Nico,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hnaz-mm/master]
[also build test WARNING on linus/master v5.18-rc1 next-20220408]
[cannot apply to linux/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Nico-Pache/oom_kill-c-futex-Don-t-OOM-reap-the-VMA-containing-the-robust_list_head/20220408-112952
base:   https://github.com/hnaz/linux-mm master
config: x86_64-randconfig-s022 (https://download.01.org/0day-ci/archive/20220408/202204082258.E7EPbAYz-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/intel-lab-lkp/linux/commit/70c1e2a404ac47b7c9b8bd1e9c4d3e72f19e6c62
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Nico-Pache/oom_kill-c-futex-Don-t-OOM-reap-the-VMA-containing-the-robust_list_head/20220408-112952
        git checkout 70c1e2a404ac47b7c9b8bd1e9c4d3e72f19e6c62
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/oom_kill.c:606:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *robust_list @@     got struct robust_list_head [noderef] __user *robust_list @@
   mm/oom_kill.c:606:21: sparse:     expected void *robust_list
   mm/oom_kill.c:606:21: sparse:     got struct robust_list_head [noderef] __user *robust_list
   mm/oom_kill.c: note: in included file (through include/linux/rculist.h, include/linux/sched/signal.h, include/linux/oom.h):
   include/linux/rcupdate.h:726:9: sparse: sparse: context imbalance in 'find_lock_task_mm' - wrong count at exit
   mm/oom_kill.c:222:28: sparse: sparse: context imbalance in 'oom_badness' - unexpected unlock
   include/linux/rcupdate.h:726:9: sparse: sparse: context imbalance in 'dump_task' - unexpected unlock
   include/linux/rcupdate.h:726:9: sparse: sparse: context imbalance in '__oom_kill_process' - unexpected unlock
   mm/oom_kill.c:1243:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *robust_list @@     got struct robust_list_head [noderef] __user *robust_list @@
   mm/oom_kill.c:1243:21: sparse:     expected void *robust_list
   mm/oom_kill.c:1243:21: sparse:     got struct robust_list_head [noderef] __user *robust_list
   mm/oom_kill.c:1232:20: sparse: sparse: context imbalance in '__se_sys_process_mrelease' - unexpected unlock
--
>> mm/mmap.c:3138:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *robust_list @@     got struct robust_list_head [noderef] __user *robust_list @@
   mm/mmap.c:3138:21: sparse:     expected void *robust_list
   mm/mmap.c:3138:21: sparse:     got struct robust_list_head [noderef] __user *robust_list

vim +606 mm/oom_kill.c

   575	
   576	/*
   577	 * Reaps the address space of the give task.
   578	 *
   579	 * Returns true on success and false if none or part of the address space
   580	 * has been reclaimed and the caller should retry later.
   581	 */
   582	static bool oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
   583	{
   584		bool ret = true;
   585		void *robust_list = NULL;
   586	
   587		if (!mmap_read_trylock(mm)) {
   588			trace_skip_task_reaping(tsk->pid);
   589			return false;
   590		}
   591	
   592		/*
   593		 * MMF_OOM_SKIP is set by exit_mmap when the OOM reaper can't
   594		 * work on the mm anymore. The check for MMF_OOM_SKIP must run
   595		 * under mmap_lock for reading because it serializes against the
   596		 * mmap_write_lock();mmap_write_unlock() cycle in exit_mmap().
   597		 */
   598		if (test_bit(MMF_OOM_SKIP, &mm->flags)) {
   599			trace_skip_task_reaping(tsk->pid);
   600			goto out_unlock;
   601		}
   602	
   603		trace_start_task_reaping(tsk->pid);
   604	
   605	#ifdef CONFIG_FUTEX
 > 606		robust_list = tsk->robust_list;
   607	#endif
   608		/* failed to reap part of the address space. Try again later */
   609		ret = __oom_reap_task_mm(mm, robust_list);
   610		if (!ret)
   611			goto out_finish;
   612	
   613		pr_info("oom_reaper: reaped process %d (%s), now anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n",
   614				task_pid_nr(tsk), tsk->comm,
   615				K(get_mm_counter(mm, MM_ANONPAGES)),
   616				K(get_mm_counter(mm, MM_FILEPAGES)),
   617				K(get_mm_counter(mm, MM_SHMEMPAGES)));
   618	out_finish:
   619		trace_finish_task_reaping(tsk->pid);
   620	out_unlock:
   621		mmap_read_unlock(mm);
   622	
   623		return ret;
   624	}
   625	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

      parent reply	other threads:[~2022-04-08 14:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  3:28 [PATCH v8] oom_kill.c: futex: Don't OOM reap the VMA containing the robust_list_head Nico Pache
2022-04-08  8:15 ` Peter Zijlstra
2022-04-08  8:37   ` Thomas Gleixner
2022-04-08  8:52     ` Nico Pache
2022-04-08  9:36       ` Michal Hocko
2022-04-08  9:40         ` Nico Pache
2022-04-08  9:59           ` Michal Hocko
2022-04-08 10:36             ` Nico Pache
2022-04-08 10:51               ` Michal Hocko
2022-04-08 11:26                 ` Nico Pache
2022-04-08 11:48                   ` Michal Hocko
2022-04-08  8:41   ` Nico Pache
2022-04-08 13:54     ` Thomas Gleixner
2022-04-08 16:13       ` Joel Savitz
2022-04-08 21:41         ` Thomas Gleixner
2022-04-11  6:48           ` Michal Hocko
2022-04-11  7:47             ` Thomas Gleixner
2022-04-11  9:08               ` Michal Hocko
2022-04-12  0:02                 ` Nico Pache
2022-04-13 16:00                 ` Nico Pache
2022-04-11 23:51       ` Nico Pache
2022-04-12 16:20         ` Thomas Gleixner
2022-04-12 17:03           ` Nico Pache
2022-04-08 14:41 ` kernel test robot [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=202204082258.E7EPbAYz-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=bhe@redhat.com \
    --cc=crecklin@redhat.com \
    --cc=dave@stgolabs.net \
    --cc=ddutile@redhat.com \
    --cc=dvhart@infradead.org \
    --cc=herton@redhat.com \
    --cc=jsavitz@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=longman@redhat.com \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=npache@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /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).