This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Handle various cache size
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 7 Sep 2010 19:21:45 -0700
- Subject: Re: PATCH: Handle various cache size
- References: <182447172.355761283903324576.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com><158461380.355841283903425520.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
On Tue, Sep 7, 2010 at 4:50 PM, Ulrich Drepper <drepper@redhat.com> wrote:
> ----- "H.J. Lu" <hongjiu.lu@intel.com> wrote:
>> ? ? ? * sysdeps/i386/i686/multiarch/memset-sse2.S: Handle various
>> ? ? ? cache size.
>
> I don't like this. ?As Jakub mentioned elsewhere, doing this work all the time the function is called is unnecessarily expensive. ?I haven't looked how exactly the code uses the cache size. ?My guess is that odd cache sizes can be handled in some way without additional overhead.
>
> If this is not the case then a special new variable should be introduced in cacheinfo. ?Then the memset code should use this rounded cache size variable.
>
Those odd cache sizes are hard to use for optimized string/memory functions,
which are the major users of those values. I think they should be rounded to
multiple of 1KB, 512B or 256B. If we want to provide the raw cache size
values, we should introduce new values so that we don't have to change
all those optimized string/memory functions,
--
H.J.