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: <1317412823.3375.34.camel@mfleming-mobl1.ger.corp.intel.com>
Date:	Fri, 30 Sep 2011 21:00:23 +0100
From:	Matt Fleming <matt@...sole-pimps.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org,
	Tony Luck <tony.luck@...el.com>
Subject: Re: [RFC][PATCH 0/5] Signal scalability series

On Fri, 2011-09-30 at 18:52 +0200, Oleg Nesterov wrote:
> And, this patch adds 4 new locks:
> 
> 	sighand_struct->action_lock
> 
> 	signal_struct->ctrl_lock
> 	signal_struct->shared_siglock
> 
> 	task_struct->siglock
> 
> Nice ;) For what? This should be justified, imho.

Well, sighand->siglock is seriously overused. It protects so much and I
think it's pretty confusing. It took me long enough to figure out how
many locks were really needed. But that's beside the point, having a
single lock doesn't scale at all, and that's what this series is about.

> Hmm. Just out of curiosity, I blindly applied the whole series and poke
> the _random_ function to look at, dequeue_signal(). And it looks wrong.
> 
> 	spin_lock_irqsave(&current->signal->ctrl_lock, flags);
> 	current->jobctl |= JOBCTL_STOP_DEQUEUED;
> 
> This signal->ctrl_lock can't help. A sig_kernel_stop() should be
> dequeued under the same lock, and we shouldn't release it unless we
> set JOBCTL_STOP_DEQUEUED. Otherwise we race with SIGCONT.

Hmm.. is that really a problem? Does the dequeue and setting
JOBCTL_STOP_DEQUEUED actually need to be atomic? Does it matter if we
have SIGCONT on the signal queue when we set JOBCTL_STOP_DEQUEUED?

> May be do_signal_stop() does something special? At first flance it doesn't.
> But wait, it does while_each_thread() under ->ctrl_lock, why this is safe?

Why is it not safe? What scenario are you thinking of where that isn't
safe?

> May be I was just lucky ;)

I doubt luck has anything to do with it ;-)

Thanks for the review!

-- 
Matt Fleming, Intel Open Source Technology Center

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