mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Mayhar <fmayhar@google.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Roland McGrath <roland@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang.
Date: Wed, 10 Sep 2008 10:50:58 -0700	[thread overview]
Message-ID: <1221069058.25218.10.camel@bobble.smo.corp.google.com> (raw)
In-Reply-To: <20080910121251.GB220@tv-sign.ru>

On Wed, 2008-09-10 at 16:12 +0400, Oleg Nesterov wrote:
> On 09/09, Frank Mayhar wrote:
> >
> > On Tue, 2008-09-09 at 20:01 +0400, Oleg Nesterov wrote:
> >
> > > As for this particular function, it seems to me that ->signal == NULL
> > > is not possible, no?
> >
> > That's not completely clear to me.  I'm allowing for the possibility
> > that it might be called during, say, process teardown.  It's used in so
> > many places that I'm uncomfortable leaving the == NULL check out.
> 
> Please see my reply to Roland.

I saw it.  I dunno, I'm more of the "belt-and-suspenders" mindset.  I'll
add a comment, thought, that this is probably a "can't happen" but we
check it anyway.

> > > Btw, this function has a lot of callers, perhaps it is better to
> > > uninline it.
> >
> > If that's the consensus I'll do so.  I assumed that speed was more
> > important than space in this case.  Am I mistaken?
> 
> Are you sure inline will be faster? It has a lot of calllers, think
> about i-cache. And the function call is not that expensive.

Hmm.  It just seems to me that making it inline enables the optimizer to
do smarter things with the flow of control.  The routine isn't all that
long, disassembling the posix_cpu_timers_exit_group() routine gives a
good view of it and it appears to be around 120 bytes.  Certainly less
than 200 bytes (all of posix_cpu_timers_exit_group() is only 201 bytes).
That doesn't seem like a cache buster but I defer to those who are more
familiar with this stuff.

> > > So, the first CLONE_THREAD creates ->cputime.totals. After that
> > > thread_group_cputime_account_xxx() start to use it even if the task
> > > doesn't have the attached cpu timers.
> > >
> > > Stupid question: can't we allocate .totals in posix_cpu_timer_create() /
> > > set_process_cpu_timer() ?
> >
> > That was the original plan but we (that is, Roland and I) decided to
> > eliminate the separate storage for the dead-threads totals.  It's now
> > all kept in the totals field, for the whole thread group.
> 
> I see, thanks.

You're welcome.  I actually like the new method of keeping track of this
stuff; it seems cleaner and certainly removes the requirement of walking
the thread group to add it up.  Should help some microbenchmarks, at
least. :-)
-- 
Frank Mayhar <fmayhar@google.com>
Google, Inc.


  reply	other threads:[~2008-09-10 17:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 20:44 Frank Mayhar
2008-09-09  7:03 ` Ingo Molnar
2008-09-09 16:01   ` Oleg Nesterov
2008-09-09 16:13     ` Oleg Nesterov
2008-09-09 20:29     ` Frank Mayhar
2008-09-10 12:12       ` Oleg Nesterov
2008-09-10 17:50         ` Frank Mayhar [this message]
2008-09-10 16:32       ` Oleg Nesterov
2008-09-10  4:04     ` Roland McGrath
2008-09-10 11:44       ` Oleg Nesterov
2008-09-10  3:59 ` Roland McGrath

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=1221069058.25218.10.camel@bobble.smo.corp.google.com \
    --to=fmayhar@google.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome