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, 27 Oct 2015 16:37:15 -0700
From:	Stephane Eranian <eranian@...gle.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [PATCH v2] perf/core: fix RCU issues with cgroup monitoring mode

On Tue, Oct 27, 2015 at 1:24 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Tue, 2015-10-27 at 20:25 +0100, Stephane Eranian wrote:
>> This patch eliminates all known RCU violations detected
>> by the RCU  checker (PROVE_RCU). The impact code paths
>> were all related to cgroup mode monitoring and involved
>> access a task's cgrp.
>>
>> V2 is updated to include suggestions from PeterZ to eliminate
>> some of the warnings without grabbing the rcu_read lock because
>> we know we are already holding the ctx->lock which prevents
>> the cgroup from disappearing while we are accessing it.
>> The trick, as suggested by Peter, is to modify the
>> perf_cgroup_from_task() to take an extra boolean parameter
>> to allow bypassing the lockdep test in the task_subsys_cstate()
>> macros. This patch uses this approach to update all calls the
>> perf_cgroup_from_task().
>> V2 Patch relative to:
>> 8b3c8e6 Revert "rculist: Make list_entry_rcu() use lockless_dereference()"
>>
>> Signed-off-by: Stephane Eranian <eranian@...gle.com>
>> ---
>
>
> Instead trusting caller to provide correct 'safe' boolean,
> what about using lockdep_is_held() ?
>
But that macro is already embedded into the  task_css_set() macro.
What we are saying here is that we have another way of ensuring the
cgroup cannot disappear here, and thus the rcu lockdep detects we
are not holding the rcu read lock but we know this is okay. We are
trying to avoid grabbing the rcu read lock when it is not really needed
to guarantee correct execution. So we are just shutting up the lockdep
in these particular cases by passing true as the safe argument value.

> This way, you keep full lockep support.
>
> A random example is
>
> #define rcu_dereference_rtnl(p) rcu_dereference_check(p, lockdep_rtnl_is_held())
>
>
>
--
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