Re: cache info

Kaz Kojima <[email protected]> Sat, 20 Mar 2004 16:12:22 +0900 (JST)
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.ports.sh.general
Message-ID <[email protected]>
Paul Mundt <[email protected]> wrote:
>> (1)  SH specific system call to get the cache info,
>> (2)  interface (including system call) to read hurmless CPU
>>      registers,
>> (3)  special device,
>> (4)  ...
>> 
>> Perhaps (1) is cleaner as an interface than another methods though
>> I'm a bit concerned with SH specific system call number.  We have
>> "holes" in system call numbers but there might be no guarantee
>> that they won't be used for another purpose.
>> 
>> Thoughts?  Implementations will be more welcome :-)
> 
> Since the system call interface is likely going to be the cleanest approach
> for this sort of thing, why not implement this as a vsyscall? There was a
> recent thread on l-k about using vsyscalls for optimized routines on ppc/ppc64,
> so exposing this sort of thing through a vsyscall doesn't seem particularly
> evil (especially if glibc is going to need this) -- note that x86_64 already
> does a number of things in this fashion, gettimeofday(), time(), etc.
> 
> The interface on the kernel side would be relatively simple, since would just
> populate the cache info by way of detect_cpu_and_cache_system() as normal,
> and then hand this data back by way of a vsyscall page.

Indeed, vsyscall is interesting.  But it seems not appropriate
that implementing vsyscall for the query function for cache info.
This function will never be called often and there is no problem
even if it is slow.
I need a quick implementation of this query function and it'd be
better to back port that to 2.4 so that the newer glibc can be
used for 2.4 too.  vsyscall looks not adequate for such case.

Of course, I encourage someone to implement vsyscall in 2.6 :-)
It would be nice in general.  Thanks for your comment.

Regards,
	kaz


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click