Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754218AbbKLKAO (ORCPT ); Thu, 12 Nov 2015 05:00:14 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33305 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753644AbbKLKAM (ORCPT ); Thu, 12 Nov 2015 05:00:12 -0500 From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: acme@redhat.com, peterz@infradead.org, mingo@elte.hu, ak@linux.intel.com, edumazet@google.com Subject: [PATCH v3 0/2] perf/core: rcu fixes Date: Thu, 12 Nov 2015 11:00:02 +0100 Message-Id: <1447322404-10920-1-git-send-email-eranian@google.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1284 Lines: 33 This short patch series fixes some issues with RCU locking in the generic perf layer. Patch 1 fixes cgroup switching rcu issues related to the fact that perf_cgroup_sched_out() and perf_cgroup_sched_in() were missing some rcu read lock to protect the reference to the cgroup. Consequently, we moved the rcu readlock out of perf_cgroup_switch() to avoid double calls. Patch 2 reinforces the testing for the rcu locking in perf cgorup code. Either we have to hold the rcu read lock or we must have the ctx->lock which guarantees the task cannot leave the cgroup. Thanks to Peter and Eric from their suggestions on how to fix this correctly. Stephane Eranian (2): perf/core: fix RCU problem with cgroup context switching code perf/core: robustify perf_cgroup_from_task rcu checks arch/x86/kernel/cpu/perf_event_intel_cqm.c | 2 +- include/linux/perf_event.h | 6 ++++-- kernel/events/core.c | 31 ++++++++++++++++++++---------- 3 files changed, 26 insertions(+), 13 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/