Re: [rfc 19/45] cpu alloc: NFS statistics

From: Mathieu Desnoyers
Date: Tue Nov 20 2007 - 19:53:21 EST


* Trond Myklebust (trond.myklebust@xxxxxxxxxx) wrote:
>
> On Tue, 2007-11-20 at 16:50 -0500, Mathieu Desnoyers wrote:
> > Then my original point is valid : put_no_resched() will cause unwanted
> > scheduler latencies. It's designed only to be used from within the
> > scheduler code itself. The correct approach would be a standard
> > put_cpu().
> >
> > Or am I missing something ?
>
> Then someone who cares about scheduler latency had better audit the code
> and figure out which calls are made under spinlock, and which aren't:
> it's not on my personal list of high priorities. I'll be happy to review
> any patches, though.
>

put_cpu() will work flawlessly when nested within a spinlock. the
spinlock disabled itself preemption, and a nested preemption
disable/enable/check will end up incrementing/decrementing the preempt
cours. The check at the end will just not call the scheduler when nested
within a spinlock.

If this is what you are worried about, then you shouldn't. I am a bit
surprised about your reaction though.. so I probably missed
something/don't understand correctly your fear about check_resched
within a spinlock.

Mathieu

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/