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:	Sat, 20 Aug 2011 10:40:09 +0800
From:	Ming Lei <tom.leiming@...il.com>
To:	Thomas Renninger <trenn@...e.de>
Cc:	rostedt@...dmis.org, fweisbec@...il.com, jean.pihet@...oldbits.com,
	mingo@...hat.com, linux-kernel@...r.kernel.org,
	linux-omap@...r.kernel.org, Len Brown <lenb@...nel.org>
Subject: Re: [PATCH 3/3] trace points: power: remove 'cpu_id' from trace_cpu_idle

Hi,

2011/8/20 Thomas Renninger <trenn@...e.de>:
> On Friday, August 19, 2011 05:04:04 PM tom.leiming@...il.com wrote:
>> From: Ming Lei <tom.leiming@...il.com>
>>
>> This patch removes the 'cpu_id' parameter of the cpu_idle
>> trace point, based on the ideas below:
>>
>> - the cpu_id which is passed to trace point is always the current
>>   cpu
> Are you sure this will always be true?

It is sure at least now,  the only place to pass 'dev->cpu' is inside
cpuidle_idle_call,
but the cpuidle_device is got from __this_cpu_read(cpuidle_devices),
so it should
be true for such case.

>
>> - the current cpu info has been included into the trace result
>>   already
>> - smp_processor_id() can't be used safely in preemptible context.
>
> The cpuid has been added to idle events on purpose for example to be
> able to pass C-state dependencies.
> 2 cores may only enter a deeper sleep state if the 2nd core enters it
> as well.
> There may be architectures where you could trigger a sleep state on
> a foreign cpu.
>
> This may not be used now, but if the kernel does want to use it, you do
> not want to adjust a dozen userspace apps.
>
> Not sure how to quickly solve the:
> "smp_processor_id() can't be used safely in preemptible context."
> problem, though.
> A convention could be declared that if -1 is passed, it's the same cpu
> entering the sleep state as the running one. This will probably
> break userspace apps as well...
>
> Best would be to clean up x86 and let idle routines always be entered
> from cpuidle subsystem which knows the cpu id already and eliminate
> all idle functions in arch/x86/kernel/process.c.
>
>   Thomas
>
> PS: I do not care about patch 1 and 2 as these events are ARM specific
> afaik. But I vote against this one.
>


thanks,
-- 
Ming Lei
--
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