Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jan 2007 22:15:07 +0100
From:      "Attilio Rao" <attilio@freebsd.org>
To:        "Ivan Voras" <ivoras@fer.hr>
Cc:        freebsd-current@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: Optimized copy&move (was: Re: [PATCH] Mantaining turnstile aligned to 128 bytes in i386 CPUs)
Message-ID:  <3bbf2fe10701171315g696bca4fi3bf676b62c06f4d@mail.gmail.com>
In-Reply-To: <45AE7BF8.10703@fer.hr>
References:  <3bbf2fe10607250813w8ff9e34pc505bf290e71758@mail.gmail.com> <b1fa29170701161355lc021b90o35fa5f9acb5749d@mail.gmail.com> <eoji7s$cit$2@sea.gmane.org> <b1fa29170701161425n7bcfe1e5m1b8c671caf3758db@mail.gmail.com> <eojlnb$qje$1@sea.gmane.org> <b1fa29170701161534n1f6c3803tbb8ca60996d200d9@mail.gmail.com> <eojok9$449$1@sea.gmane.org> <20070117134022.V18339@besplex.bde.org> <20070117224812.Q23194@besplex.bde.org> <45AE7BF8.10703@fer.hr>

next in thread | previous in thread | raw e-mail | index | archive | help
2007/1/17, Ivan Voras <ivoras@fer.hr>:
> Bruce Evans wrote:
>
> > And MMX/XMM registers ar not needed to get movnt on machines with SSE2,
> > since movnti is part of SSE2.  This reduces the advantages of using MMX/XMM
> > registers on P4's and A64's in 32-bit mode to the non-nt parts of the
> > above (fully cached case), which I think are less important than the nt
> > parts.
>
> Hmm, I'm looking at i386/i386/support.s and there are several versions
> of bcopy and bmove functions, including some that optimize by using FPU
> registers (large_i586_bcopy_loop), and a version that uses movnti
> (sse2_pagezero), but I can't find the bit of magic which glues them to
> bzero() call.
>
> Also, as as I can tell by the comments, the FPU version works by
> manually saving context... why is this possible (i.e. won't something
> preempt it?)

They are just broken.
My implementation, which follows DragonFlyBSD patterns, just use a bts
(which is atomic) in order to set a "lock" and avoid thread migration
with scheduler pinning. This is enough to solve concurrency problems.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein



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