Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

heads-up: new FPU context switch framework on x86



Hi -
as suggested in postings to the x86 technical mailing lists 6 weeks ago
(eg. http://mail-index.netbsd.org/port-i386/2013/09/09/msg003166.html)
I've now committed the "x86_use_pcu" part to -current.
The machine specific code which does the bookkeeping which coprocessor
holds the floating point context of which process is now replaced by
the common pcu(9) code. This affects the i386, amd64 and xen ports.

The new code does basically the same, lazy context switching. A
technical difference is that it doesn't use a dedicated IPI anymore
to get the FPU state of another CPU. Instead, the xcall(9) framework
is used which uses a kernel thread for its work, which needs to be
scheduled to. This likely results in a higher latency, but only
if FPU using processes are migrated between CPUs which is hard to
trigger for benchmarks and happens rarely enough in practice to
be significant.

There should be no visible difference for userland programs.
If you find problems, please tell. I didn't see any in weeks of use
with native code. Didn't test emulations -- with the old "sigcontext"
signal delivery scheme, it is generally unsafe to use the FPU in
signal handlers. The new code is not expected to improve this,
but it should at least not make it worse. I didn't test old binaries,
so if someone can test it, please do.

best regards
Matthias


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------



Home | Main Index | Thread Index | Old Index