All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org, Tony Luck <tony.luck@intel.com>
Subject: Re: [RFC][PATCH 0/5] Signal scalability series
Date: Fri, 30 Sep 2011 21:00:23 +0100	[thread overview]
Message-ID: <1317412823.3375.34.camel@mfleming-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20110930165206.GA22048@redhat.com>

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


  parent reply	other threads:[~2011-09-30 20:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 15:12 [RFC][PATCH 0/5] Signal scalability series Matt Fleming
2011-09-30 15:12 ` [RFC][PATCH 1/5] signal: Document signal locking rules Matt Fleming
2011-09-30 15:12 ` [RFC][PATCH 2/5] signal: Add rwlock to protect sighand->action Matt Fleming
2011-09-30 15:25   ` Peter Zijlstra
2011-09-30 15:56   ` Matt Fleming
2011-09-30 15:12 ` [RFC][PATCH 3/5] signal: Reduce sighand->siglock hold time in get_signal_to_deliver() Matt Fleming
2011-09-30 15:12 ` [RFC][PATCH 4/5] signal: Add signal->ctrl_lock for job control Matt Fleming
2011-09-30 15:30   ` Peter Zijlstra
2011-09-30 15:36     ` Matt Fleming
2011-09-30 15:12 ` [RFC][PATCH 5/5] signal: Split siglock into shared_siglock and per-thread siglock Matt Fleming
2011-09-30 16:52 ` [RFC][PATCH 0/5] Signal scalability series Oleg Nesterov
2011-09-30 18:54   ` Oleg Nesterov
2011-09-30 20:00   ` Matt Fleming [this message]
2011-09-30 23:56     ` Tejun Heo
2011-10-01 10:16       ` Matt Fleming
2011-10-01 13:03         ` Peter Zijlstra
2011-10-03  1:38           ` Tejun Heo
2011-10-03 13:56             ` Thomas Gleixner
2011-10-04  7:37               ` Tejun Heo
2011-10-03 13:07           ` Oleg Nesterov
2011-10-03 15:22             ` Peter Zijlstra
2011-10-04 17:14               ` Oleg Nesterov
2011-10-04 17:52                 ` Oleg Nesterov
2011-10-04 17:54                 ` Linus Torvalds
2011-10-04 18:13                   ` Oleg Nesterov
2011-10-03 13:16     ` Oleg Nesterov
2011-10-04  8:56       ` Matt Fleming
2011-10-04 17:29         ` Oleg Nesterov
2011-09-30 22:30 ` Andi Kleen
2011-10-01  9:35   ` Matt Fleming
2011-10-03 15:28     ` Linus Torvalds
2011-10-03 15:43       ` Matt Fleming
2011-10-03 16:35         ` Oleg Nesterov
2011-10-03 20:58           ` Matt Fleming
2011-10-03 21:45             ` Linus Torvalds
2011-10-03 22:13             ` Thomas Gleixner
2011-10-04  8:20               ` Matt Fleming
2011-10-04 17:39               ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317412823.3375.34.camel@mfleming-mobl1.ger.corp.intel.com \
    --to=matt@console-pimps.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=tj@kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.