Re: [patch] Latency Tracer, voluntary-preempt-2.6.8-rc4-O6

Lee Revell
2004-08-19T22:49:17Z

On Thu, 2004-08-19 at 18:32, Lee Revell wrote:
> On Thu, 2004-08-19 at 15:30, Theodore Ts'o wrote:
> > On Thu, Aug 19, 2004 at 07:19:58AM -0400, Lee Revell wrote:
> > > > I doubt SHA_CODE_SIZE will make a sufficient difference to avoid the
> > > > latency problems. What we would need to do is to change the code so
> > > > that the rekey operation in __check_and_rekey takes place in a
> > > > workqueue. Say, something like this (warning, I haven't tested this
> > > > patch; if it breaks, you get to keep both pieces):
> > > >
> > >
> > > Tested, works for me. This should probably be pushed upstream, as well
> > > as added to -P5, correct? Is there any disadvantage to doing it this
> > > way?
> >
> > Great, I will be pushing this upstream very shortly.
> >
>
> Hmm, turns out that this does not fix the problem:
>
> http://krustophenia.net/testresults.php?dataset=2.6.8.1-P4#/var/www/2.6.8.1-P4/extract_entropy_latency_trace.txt
>

Looking at the code, it's obvious why this doesn't fix the problem - you
are still doing 380 usecs (with SHA_CODE_SIZE 3) to 780 usecs (with
SHA_CODE_SIZE 0) worth of work inside the spinlock, it is just being
deferred via a workqueue, rather than executing right away. So this
improves the average case, but does not help the worst case scenario at
all. 380 usecs is too long to hold a spinlock.

Lee