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:	Thu, 30 Nov 2006 17:13:46 +0530
From:	Gautham R Shenoy <ego@...ibm.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Gautham R Shenoy <ego@...ibm.com>, akpm@...l.org,
	linux-kernel@...r.kernel.org, torvalds@...l.org, davej@...hat.com,
	dipankar@...ibm.com, vatsa@...ibm.com
Subject: Re: CPUFREQ-CPUHOTPLUG: Possible circular locking dependency

On Thu, Nov 30, 2006 at 12:03:15PM +0100, Ingo Molnar wrote:
> 
> * Gautham R Shenoy <ego@...ibm.com> wrote:
> 
> > a) cpufreq maintain's it's own cpumask in the variable
> > policy->affected_cpus and says : If a frequency change is issued to
> > any one of the cpu's in the affected_cpus mask, you change frequency
> > on all cpus in the mask. So this needs to be consistent with
> > cpu_online map and hence cpu hotplug aware. Furthermore, we don't want
> > cpus in this mask to go down when we are trying to change frequencies
> > on them. The function which drives the frequency change in
> > cpufreq-core is cpufreq_driver_target and it needs cpu-hotplug
> > protection.
> 
> couldnt this complexity be radically simplified by having new kernel
> infrastructure that does something like:
> 
>   " 'gather' all CPUs mentioned in <mask> via scheduling a separate
>     helper-kthread on every CPU that <mask> specifies, disable all
>    interrupts, and execute function <fn> once all CPUs have been
>    'gathered' - and release all CPUs once <fn> has executed on each of
>    them."
> 
> ?

This is what is currently being done by cpufreq:

a) get_some_cpu_hotplug_protection() [use either some global mechanism 
					or a persubsystem mutex]

b) actual_freq_change_driver_function(mask) 
/* You can check out cpufreq_p4_target() in
 * arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
 */
  
   {
	for_each_cpu_mask(i, mask) {
		cpumask_t this_cpu = cpumask_of_cpu(i);
         	set_cpus_allowed(current, this_cpu);
		function_to_change_frequency();
							
	}
  }

c) release_whatever_cpu_hotplug_protection()

> 
> This would be done totally serialized and while holding the hotplug
> lock, so no CPU could go away or arrive while this operation is going
> on.
> 

Isn't the above same as what you are suggesting? Or have I missed out
anything? 

> 	Ingo

regards
gautham.
-- 
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"
-
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