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>] [day] [month] [year] [list]
Message-Id: <1274384558-19680-1-git-send-regression-fweisbec@gmail.com>
Date:	Thu, 20 May 2010 21:42:38 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Paul Mackerras <paulus@...ba.org>,
	Stephane Eranian <eranian@...gle.com>,
	Robert Richter <robert.richter@....com>
Subject: [GIT PULL] perf fix (preempt count imbalance on buffer)

Ingo,

Please pull the perf/core branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	perf/core

Thanks,
	Frederic
---

Frederic Weisbecker (1):
      perf: Fix forgotten preempt_enable by nested writers


 kernel/perf_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

---
commit acd35a463cb2a8d2b28e094d718cf6e653ad7191
Author: Frederic Weisbecker <fweisbec@...il.com>
Date:   Thu May 20 21:28:34 2010 +0200

    perf: Fix forgotten preempt_enable by nested writers
    
    A writer that gets a reference to the buffer handle disables
    preemption. When we put that reference, we check if we are
    the outer most writer and if not, we simply return and defer
    the head update to the outer most writer. The problem here
    is that preemption is only reenabled by the outer most, that
    produces preemption count imbalance for every nested writer
    that exit.
    
    So just don't forget to always re-enable preemption when we
    put the buffer reference, whoever we are.
    
    Fixes lots of sleeping in atomic warnings, visible with lock
    events recording.
    
    Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
    Cc: Ingo Molnar <mingo@...e.hu>
    Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
    Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
    Cc: Paul Mackerras <paulus@...ba.org>
    Cc: Stephane Eranian <eranian@...gle.com>
    Cc: Robert Richter <robert.richter@....com>

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 2a060be..45b7aec 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2933,7 +2933,7 @@ again:
 	 */
 
 	if (!local_dec_and_test(&data->nest))
-		return;
+		goto out;
 
 	/*
 	 * Publish the known good head. Rely on the full barrier implied
@@ -2954,6 +2954,7 @@ again:
 	if (handle->wakeup != local_read(&data->wakeup))
 		perf_output_wakeup(handle);
 
+ out:
 	preempt_enable();
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ