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]
Message-ID: <48647652.5050001@qualcomm.com>
Date:	Thu, 26 Jun 2008 22:10:42 -0700
From:	Max Krasnyansky <maxk@...lcomm.com>
To:	Paul Menage <menage@...gle.com>
CC:	Vegard Nossum <vegard.nossum@...il.com>, Paul Jackson <pj@....com>,
	a.p.zijlstra@...llo.nl, linux-kernel@...r.kernel.org,
	Gautham shenoy <ego@...ibm.com>
Subject: Re: [RFC][PATCH] CPUSets: Move most calls to rebuild_sched_domains()
 to the workqueue

Paul Menage wrote:
> On Thu, Jun 26, 2008 at 1:34 PM, Paul Menage <menage@...gle.com> wrote:
>> void get_online_cpus(void)
>> {
>>        might_sleep();
>>        if (cpu_hotplug.active_writer == current)
>>                return;
>>        down_read(&cpu_hotplug.lock);
>> }
>>
>> void put_online_cpus(void)
>> {
>>        if (cpu_hotplug.active_writer == current)
>>                return;
>>        up_read(&cpu_hotplug.lock);
>> }
>>
>> static void cpu_hotplug_begin(void)
>> {
>>        down_write(&cpu_hotplug.lock);
>>        cpu_hotplug.active_writer = current;
>> }
>>
>> static void cpu_hotplug_done(void)
>> {
>>        cpu_hotplug.active_writer = NULL;
>>        up_write(&cpu_hotplug.lock);
>> }
>>
>> I think that combined with moving the async rebuild_sched_domains to a
>> separate thread should solve the problem, but I'm wondering why
>> cpu_hotplug.lock was implemented this way in the first place.
> 
> Oh, I guess that doesn't work because of recursive calls to
> get_online_cpus(). Maybe we need a down_read_recursive() that skips
> ahead of waiting writers if the lock is already held in read mode?

Instead of changing cpu_hotplug locking should we maybe try to avoid using
cgroup_lock in rebuild_sched_domains() ?
There is a comment in cpuset.c that says
 * If a task is only holding callback_mutex, then it has read-only
 * access to cpusets.

I'm not sure if it's still valid. rebuild_sched_domains() only needs read only
access, it does not really modify any cpuset structures.

Max


--
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