[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1247150580.21295.937.camel@calx>
Date: Thu, 09 Jul 2009 09:43:00 -0500
From: Matt Mackall <mpm@...enic.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Anton Vorontsov <avorontsov@...mvista.com>,
Andrew Morton <akpm@...ux-foundation.org>, oleg@...hat.com,
mingo@...e.hu, linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] netpoll: Fix carrier detection for drivers that are
using phylib
On Thu, 2009-07-09 at 16:31 +0200, Peter Zijlstra wrote:
> On Thu, 2009-07-09 at 09:18 -0500, Matt Mackall wrote:
> >
> > Sorry if I was unclear. I'm suggesting setting the count so the existing
> > PREEMPT_ACTIVE test here fires:
> >
> > int __sched _cond_resched(void)
> > {
> > if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) &&
> > system_state == SYSTEM_RUNNING) {
> > __cond_resched();
> > return 1;
> > }
> > return 0;
> > }
>
> Right, /me read preempt and thought a simple preempt inc but didn't read
> the code. Shame on me.
>
> So something like (utterly untested and such)
Yeah, that's what I had in mind. Probably throw in a define:
/* for disabling scheduling in early boot */
#define PREEMPT_EARLY (1 + PREEMPT_ACTIVE)
and slap a comment on the sub_preempt_count().
Does anything actually use scheduler_running yet? Perhaps my tree is
old.
Also, might_sleep's use of system_state probably bears revisiting.
--
http://selenic.com : development and support for Mercurial and Linux
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists