public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ray Bryant <raybry@sgi.com>
To: Rick Lindsley <ricklind@us.ibm.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
	lse-tech <lse-tech@lists.sourceforge.net>,
	holt@sgi.com, Dean Roe <roe@sgi.com>, Brian Sumner <bls@sgi.com>,
	John Hawkes <hawkes@tomahawk.engr.sgi.com>
Subject: Re: [Lse-tech] scalability of signal delivery for Posix Threads
Date: Mon, 22 Nov 2004 17:39:23 -0600	[thread overview]
Message-ID: <41A278AB.2050608@sgi.com> (raw)
In-Reply-To: <200411222127.iAMLRtN7020062@owlet.beaverton.ibm.com>

Rick Lindsley wrote:
> So with CLONE_SIGHAND, we share the handler assignments and which signals
> are blocked, but retain the ability for individual threads to receive
> a signal.  And when all of them receive signals in quick succession,
> we see lock contention because they're sharing the same (effectively)
> global lock to receive all of their (effectively) individual signals
> .. is that correct?
> 

Yes, I think that's whats happening, except that I think the blocked
signal list is per thread as well.  The shared sighand structure just
has the saved arguments from sigaction, as I remember.   (It's confusing:
the set of signals blocked during execution of the signal handler is
part of the sigaction structure and hence is global to the entire
thread group, whilst the set of signals blocked in general is per thread.)

> Are you contending on tasklist_lock, or on siglock?

Definately: siglock.  All of the profiling ticks occur at
unlock_irqrestore(&p->sighand->siglock) in the routines I
mentioned before.  [we don't have NMI profiling on Altix...
so profiling typically can't look inside
of code sections with interrupts suspended.]

> 
>     It seems to me that scalability would be improved if we moved the
>     siglock from the sighand structure to the task_struct.
> 
> Only if you want to keep its current semantics of it being a lock for
> all things signal.  Finer granularity would, it seems at first look,
> afford you the benefits you're looking for.  (But not without the cost of
> a fair amount of work to make sure the new locks are utilized correctly.)
> For the problem you're describing, it sounds like the contention is occuring
> at delivery, so a new lock for pending, blocked, and real_blocked might be
> in order.
> 
> Rick
> 

Yes, I was hoping to keep the current semantics of siglock as the lock for
all things signal, just make it local per thread, and require that all of the
siglocks be held to change the sighand structure.  That seemed like a change I
could manage.  My personal notion was that the slowdown of sigaction()
processing for multi-threaded POSIX programs was not that big of deal because
it doesn't happen very often, and for non-CLONE_SIGHAND threads the additional
cost would be minor.  But if the slowdown in the CLONE_SIGHAND case is not
acceptable then I'm stuck as to how to do this

-- 
Best Regards,
Ray
-----------------------------------------------
                   Ray Bryant
512-453-9679 (work)         512-507-7807 (cell)
raybry@sgi.com             raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
            so I installed Linux.
-----------------------------------------------

  reply	other threads:[~2004-11-22 23:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-22 15:51 scalability of signal delivery for Posix Threads Ray Bryant
2004-11-22 16:07 ` Matthew Wilcox
2004-11-22 19:49   ` [Lse-tech] " Ray Bryant
2004-11-22 19:53     ` Andi Kleen
2004-11-22 16:22 ` [Lse-tech] " Andi Kleen
2004-11-22 16:51   ` Andreas Schwab
2004-11-22 16:54     ` Andi Kleen
2004-11-22 18:56       ` Ray Bryant
2004-11-22 19:22       ` Ray Bryant
2004-11-22 17:23   ` Philip J. Mucci
2004-11-22 17:19 ` Robin Holt
2004-11-22 19:25   ` Ray Bryant
2004-11-23 20:42   ` Ray Bryant
2004-11-22 21:27 ` [Lse-tech] " Rick Lindsley
2004-11-22 23:39   ` Ray Bryant [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-11-22 21:26 Boehm, Hans
2004-11-22 21:34 ` Andi Kleen
2004-12-01 22:53   ` Brent Casavant
2004-11-22 23:01 Boehm, Hans

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=41A278AB.2050608@sgi.com \
    --to=raybry@sgi.com \
    --cc=bls@sgi.com \
    --cc=hawkes@tomahawk.engr.sgi.com \
    --cc=holt@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=ricklind@us.ibm.com \
    --cc=roe@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox