Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 16:29:46 -0800
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Attilio Rao <attilio@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.org, Ivan Voras <ivoras@fer.hr>, freebsd-arch@FreeBSD.org
Subject:   Re: [PATCH] Mantaining turnstile aligned to 128 bytes in i386 CPUs
Message-ID:  <45AD6DFA.6030808@FreeBSD.org>
In-Reply-To: <3bbf2fe10701161525j6ad9292y93502b8df0f67aa9@mail.gmail.com>
References:  <3bbf2fe10607250813w8ff9e34pc505bf290e71758@mail.gmail.com>	<3bbf2fe10607251004wf94e238xb5ea7a31c973817f@mail.gmail.com>	<3bbf2fe10607261127p3f01a6c3w80027754f7d4e594@mail.gmail.com>	<3bbf2fe10607281004o6727e976h19ee7e054876f914@mail.gmail.com>	<3bbf2fe10701160851r79b04464m2cbdbb7f644b22b6@mail.gmail.com>	<20070116154258.568e1aaf@pleiades.nextvenue.com>	<b1fa29170701161355lc021b90o35fa5f9acb5749d@mail.gmail.com>	<eoji7s$cit$2@sea.gmane.org>	<b1fa29170701161425n7bcfe1e5m1b8c671caf3758db@mail.gmail.com>	<eojlnb$qje$1@sea.gmane.org> <3bbf2fe10701161525j6ad9292y93502b8df0f67aa9@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Attilio Rao wrote:
> 2007/1/17, Ivan Voras <ivoras@fer.hr>:
>> Kip Macy wrote:
>> > On 1/16/07, Ivan Voras <ivoras@fer.hr> wrote:
>> >> But it does seem to hurt the performance a bit - maybe it's time to 
>> add
>> >> another CPU option like I586_CPU and I686_CPU?
>> >
>> > Unless there is a compelling reason not to do so, I think that that
>> > would be a good idea.
>>
>> Maybe even someone finds a way to get optimized versions of memcpy in
>> the kernel :)
>>
>> I was thinking: AFAIK the only major stopper is context saving of the
>> various "auxiliary" registers - FPU, MMX, SSE, right? But is it an
>> all-or-nothing situation? I.e. does it make sense (can it be done?) to
>> just elect to save the MMX context? (AFAIK they are different registers
>> than SSE, but overlay FPU registers?) The idea is to save something
>> smaller than the full set.
> 
> When I implemented fpu copy into the kernel I had a lot of thinking
> about this and I think it is possible at least with some restrictions.
> For example, for an xmm copy you would just save 8 registers content
> but you  have to ensure no pending FPU exceptions will break your
> kernel and so you should preserve a clean copy of FPU state or, treact
> the corner cases you can get.
> For xmm, after some very productive discussions with bde@, we arrived
> at the conclusion that should be pretty safe to just have an 16 byte
> aligned buffer for registers saving (in this way you can use 8 movdqa
> for saving them) but I didn't end to play with it.
> (My implementation should deal with the problem of pinning the
> scheduler too, in order to avoid a wrong reading of per-cpu datas).

I might be wrong, but I think the DragonFly has solved this issue (i.e. 
optimized memcpy in the kernel) somehow quite some time ago.

-Maxim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45AD6DFA.6030808>