Re: [patch] x86, mm: pass in 'total' to __copy_from_user_*nocache()

From: Nick Piggin
Date: Sun Mar 01 2009 - 09:20:26 EST


On Sunday 01 March 2009 05:52:19 Linus Torvalds wrote:
> On Sat, 28 Feb 2009, Ingo Molnar wrote:
> > OTOH, given how draconian non-temporal stores are, i'm leaning
> > towards removing them from the x86 code altogether. If it matter
> > to performance somewhere it can be reintroduced, based on really
> > well backed up numbers.
>
> It would be interesting to see if we could instead base the decision on
> what we really do care about, namely going to do IO.
>
> And the thing is, in this path we _do_ kind of know that. The caller
> (normally generic_perform_write) already does that whole
> balance_dirty_pages_ratelimited() thing.

>
> So rather than passing in the "total_size" thing, we _could_ pass in
> something that is based on
>
> - are we O_DIRECT? If so: use uncached

Zero copies in that case :) O_SYNC, you mean.


> - perhaps: are we really _really_ large? If so: use uncached, we know the
> caches aren't going to capture it.

But how large, and which caches? I wouldn't expect very many apps at all
to pass buffers larger than even quite small LLC sizes.


> - are we starting writeout due to dirty page balancing: if so, use
> uncached.

Although that should tend to write out oldest written data, wheras
the newly written data might still benefit from being warm in cache
(eg. in the cpp|cc|as|ld case).


> But on the other hand, I could personally certainly also imagine just not
> doing that whole uncached thing at all. Myself, I tend to care about the
> peformance of the cached case much more than some odd iozone thing. But
> others will have different priorities..

FWIW I agree with you. rep mov I think gives the CPU a good window into
proceedings and usually should do a good job.

--
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/