lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 12 Jan 2016 06:23:07 -0600 (CST)
From:	Christoph Lameter <cl@...ux.com>
To:	Shiraz Hashim <shiraz.linux.kernel@...il.com>
cc:	Sasha Levin <sasha.levin@...cle.com>,
	Michal Hocko <mhocko@...e.cz>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: mm, vmstat: kernel BUG at mm/vmstat.c:1408!

On Tue, 12 Jan 2016, Shiraz Hashim wrote:

> > +       refresh_cpu_vm_stats(false);
> > +       cancel_delayed_work(this_cpu_ptr(&vmstat_work));
> >
>
> shouldn't this be cancel_delayed_work_sync ?

Hmmm... This is executed with preemption off and the work is on the same
cpu. If it would be able to run concurrently then we would need this.

Ok but it could run from the timer interrupt if that is still on and
occuring shortly before we go idle. Guess this needs to be similar to
the code we execute on cpu down in the vmstat notifiers (see
vmstat_cpuup_callback).

Does this fix it? I have not been able to reproduce the issue so far.

Patch against -next.



Subject: vmstat: Use delayed work_sync and avoid loop.

Signed-off-by: Christoph Lameter <cl@...ux.com>

Index: linux/mm/vmstat.c
===================================================================
--- linux.orig/mm/vmstat.c
+++ linux/mm/vmstat.c
@@ -1419,11 +1419,9 @@ void quiet_vmstat(void)
 	if (system_state != SYSTEM_RUNNING)
 		return;

-	do {
-		if (!cpumask_test_and_set_cpu(smp_processor_id(), cpu_stat_off))
-			cancel_delayed_work(this_cpu_ptr(&vmstat_work));
-
-	} while (refresh_cpu_vm_stats(false));
+	refresh_cpu_vm_stats(false);
+	cancel_delayed_work_sync(this_cpu_ptr(&vmstat_work));
+	cpumask_set_cpu(smp_processor_id(), cpu_stat_off);
 }

 /*




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ