mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Mayhar <fmayhar@google.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Lameter <cl@linux-foundation.org>,
	Doug Chapman <doug.chapman@hp.com>,
	mingo@elte.hu, roland@redhat.com, adobriyan@gmail.com,
	akpm@linux-foundation.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: regression introduced by - timers: fix itimer/many thread hang
Date: Mon, 10 Nov 2008 10:00:09 -0800	[thread overview]
Message-ID: <1226340009.19109.17.camel@bobble.smo.corp.google.com> (raw)
In-Reply-To: <1226328152.7685.192.camel@twins>

On Mon, 2008-11-10 at 15:42 +0100, Peter Zijlstra wrote:
> On Mon, 2008-11-10 at 08:38 -0600, Christoph Lameter wrote:
> > Can we at least somehow make sure that nothing significantly happens in a
> > timer interrupt on a processor if the thread has not scheduled any events
> > or not odone any system calls?
> Do threads actually scale that far? I thought mmap_sem contention and
> other shared state would render threads basically useless on these very
> large machines.
> 
> But afaiu this stuff, the per-cpu loop is only done when an itimer is
> actually active.

Correct.

> The detail I've not looked at is, if when this itimer is indeed active
> and we are running 256 threads of the same application on all cpus do we
> then do the per-cpu loop for each tick on each cpu?

The answer to this question is, "that depends."  You can have an itimer
for a single thread or for the whole thread group.  In the former case,
it never happens; it only does the loops for the thread group case.  If
there is a thread group itimer then of course we have to sum the tick
count across all CPUs to determine whether the timer has expired.

Personally, I would argue that it's silly to have an itimer running when
you have many threads, and if you care about performance it's even
_more_ silly.  But it's sillier yet to be able to wedge the kernel by
running a program in user space.

As far as Christoph's concern regarding latency for 8- and 16-processor
systems, my belief (supported by data I can't discuss, sigh) is that the
loop adds negligible latency.  In fact, it can't really be discussed in
this way since the existing implementation adds *lots* of latency when
an itimer is running, since it sums the values across all threads.  I
never collected latency versus number of threads data but it's bad
enough that at about 4500 threads (on a dual amd64) it took longer than
a tick to do a tick's worth of processing.
-- 
Frank Mayhar <fmayhar@google.com>
Google, Inc.


  parent reply	other threads:[~2008-11-10 18:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1224694989.8431.23.camel@oberon>
     [not found] ` <1225132746.14792.13.camel@bobble.smo.corp.google.com>
     [not found]   ` <1225219114.24204.37.camel@oberon>
2008-11-06  1:58     ` Frank Mayhar
2008-11-06 11:03       ` Peter Zijlstra
2008-11-06 15:03         ` Christoph Lameter
2008-11-06 15:08           ` Peter Zijlstra
2008-11-06 16:08             ` Christoph Lameter
2008-11-06 23:52             ` Frank Mayhar
2008-11-07  8:35               ` Ingo Molnar
2008-11-07 10:29               ` Peter Zijlstra
2008-11-07 18:10                 ` Frank Mayhar
2008-11-07 20:26                   ` Peter Zijlstra
2008-11-10 14:38                     ` Christoph Lameter
2008-11-10 14:42                       ` Peter Zijlstra
2008-11-10 15:41                         ` Christoph Lameter
2008-11-10 18:00                         ` Frank Mayhar [this message]
2008-11-14  2:42                           ` Roland McGrath
2008-11-14 16:41                             ` Oleg Nesterov
2008-11-17 14:36                               ` Oleg Nesterov
2008-11-17 18:16                                 ` Roland McGrath
2008-11-17 22:18                                   ` Oleg Nesterov
2008-11-17 21:49                                     ` Roland McGrath
2008-11-11  0:20                         ` Ingo Oeser
2008-11-11 13:58                           ` Christoph Lameter
2008-11-21 18:42                 ` Petr Tesarik
2008-11-21 19:26                   ` Frank Mayhar
2008-11-23 14:24                   ` Peter Zijlstra
2008-11-24  8:46                     ` Petr Tesarik
2008-11-24  9:33                       ` Peter Zijlstra
2008-11-24 12:32                         ` Petr Tesarik
2008-11-24 12:59                           ` Peter Zijlstra
2008-11-24 16:06                             ` Peter Zijlstra
2008-11-06 16:31         ` [PATCH] revert: " Peter Zijlstra
2008-11-06 21:44           ` Ingo Molnar
2008-11-06 21:53             ` Christoph Lameter
2008-11-07 10:19               ` Peter Zijlstra
2008-11-13 16:00           ` Doug Chapman
2008-11-13 16:08             ` Ingo Molnar
2008-11-14 14:10               ` Doug Chapman
     [not found] <20081105191211.c0316b94.akpm@linux-foundation.org>
2008-11-06 12:59 ` regression introduced by - " 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=1226340009.19109.17.camel@bobble.smo.corp.google.com \
    --to=fmayhar@google.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=doug.chapman@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.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

all inboxes | Powered by JetHome®