LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	mingo@elte.hu, tglx@linutronix.de, len.brown@intel.com,
	venkatesh.pallipadi@intel.com, abelay@novell.com,
	a.p.zijlstra@chello.nl, ak@suse.de
Subject: Re: [PATCH] Kick CPUS that might be sleeping in cpus_idle_wait
Date: Wed, 9 Jan 2008 19:05:17 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0801091900140.5064@gandalf.stny.rr.com> (raw)
In-Reply-To: <20080109154251.c70798d5.akpm@linux-foundation.org>


On Wed, 9 Jan 2008, Andrew Morton wrote:

>
> > Subject: [PATCH] Kick CPUS that might be sleeping in cpus_idle_wait
>
> s/cpus_/cpu_/

I've been up to 4am writing patches. I must be seeing double :-/

> >  {
> >  	unsigned int cpu, this_cpu = get_cpu();
> > @@ -228,6 +232,13 @@ void cpu_idle_wait(void)
> >  				cpu_clear(cpu, map);
> >  		}
> >  		cpus_and(map, map, cpu_online_map);
> > +		/*
> > +		 * We waited 1 sec, if a CPU still did not call idle
> > +		 * it may be because it is in idle and not waking up
> > +		 * because it has nothing to do.
> > +		 * Give all the remaining CPUS a kick.
> > +		 */
> > +		smp_call_function_mask(map, do_nothing, 0, 0);
> >  	} while (!cpus_empty(map));
> >
> >  	set_cpus_allowed(current, tmp);
>
> This seems rather hacky.  Although it may turn out to be the most efficient
> fix, dunno.

s/seems/is/

>
> I'd have thought that the right fix would be to plug the race which you
> described at the top-of-thread.  That might require some redesign, but it
> sounds like the design is wrong anyway.
>
> Maybe your proposed fix is suitable for a 2.6.24 bandaid..

I was thinking the same thing.

>
> <looks at cpu_idle_wait()>
>
> <pokes his tongue out at the person who put in a global,
> exported-to-modules interface and didn't bother documenting it>
>
> OK, it's called infrequently, so a few extra IPIs there won't hurt.
>
>
> btw, it's pretty damn sad that cpu_idle_wait() will always stall for at
> least one second.  That's a huge amount of time and I bet it's thousands of
> times longer than is actually needed..
>

I didn't like that either. But I was focusing on something else, and I was
getting sick and tired of my box hanging on bootup every once in a while
(usually when I reboot and walk away, just to come back to find the box
hung).

So this was my band-aid, and since it was only happening on the box
running with my patches, I thought it may have been something I did. But
then it finally hung on a reboot to a vanilla kernel, so I decided to at
least send my band-aid out.

If anything, this should get some notice and we can have a proper fix for
.25.

-- Steve


  reply	other threads:[~2008-01-10  0:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08  2:27 [RFC PATCH] kick sleeping idle CPUS on cpu_idle_wait Steven Rostedt
2008-01-08  3:33 ` Andi Kleen
2008-01-09 20:42   ` [PATCH] Kick CPUS that might be sleeping in cpus_idle_wait Steven Rostedt
2008-01-09 22:12     ` Steven Rostedt
2008-01-10 13:45       ` Ingo Molnar
2008-01-10 14:43         ` Steven Rostedt
2008-01-10 17:31           ` Pallipadi, Venkatesh
2008-01-10 18:03             ` Steven Rostedt
2008-01-09 23:42     ` Andrew Morton
2008-01-10  0:05       ` Steven Rostedt [this message]
2008-01-10  0:12     ` Pallipadi, Venkatesh
     [not found]     ` <B5B0CFF685D7DF46A05CF1678CFB42ED20E00653@orsmsx423.amr.corp.intel.com>
2008-02-08  1:05       ` [PATCH] x86: Simplify cpu_idle_wait Venki Pallipadi
2008-02-08 10:28         ` Andi Kleen
2008-02-08 17:24           ` Venki Pallipadi
2008-02-08 18:45             ` Andi Kleen
2008-02-09  9:33             ` Thomas Gleixner
2008-04-10 16:49               ` Venki Pallipadi

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=Pine.LNX.4.58.0801091900140.5064@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=abelay@novell.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=venkatesh.pallipadi@intel.com \
    --subject='Re: [PATCH] Kick CPUS that might be sleeping in cpus_idle_wait' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).