Re: Fw: potential /dev/urandom scalability improvement

From: Matt Mackall
Date: Thu Mar 25 2004 - 23:09:21 EST

On Thu, Mar 25, 2004 at 06:00:14PM -0800, Andrew Morton wrote:
> David Mosberger <davidm@xxxxxxxxxxxxxxxxx> wrote:
> >
> > The
> > patch below is updated to go on top of your patch and gives about the
> > same performance as I reported yesterday. For now, I defined an
> > inline prefetch_range(). If and when all architectures get updated to
> > define this directly, we can simply remove prefetch_range() from the
> > driver.
> We may as well stick prefetch_range() in prefetch.h.
> And Matt's patch series is not a thing I want to take on board at present,
> so let's stick with the straight scalability patch for now.

Sigh, I'll trim it back to some bits I think are critical.

> I moved the prefetch_range() call to outside the spinlock. Does that make
> sense?

I don't think that's actually a win. If there's contention, threads
racing to the lock will grab the same cache lines and all but one
thread's cache will end up invalidated by the time the lock is

Matt Mackall : : Linux development and consulting
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at