All of lore.kernel.org
 help / color / mirror / Atom feed
* How to measure enable_kernel_fpu overhead?
@ 2011-06-03 17:26 George Spelvin
  2011-06-04 20:17 ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: George Spelvin @ 2011-06-03 17:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux

I'm working on some crypto primitives, and have MMX and SSE2 accelerated
versions.  I plan on writing AltiVec (PPC) and NEON (ARM) ones, too.

But the performance varies, so I think I need to do some run-time
benchmarking, like the RAID6 code.

But what's even more annoying is that unlike the RAID6 code, I can't
assume I'll alawys be working on large blocks.  So it's not so much about
choosing one version as choosing a size threshold at which to switch over.

Which leads us into the overhead of enable_kernel_fpu(),
enable_kernel_altivec(), and whatever the ARM equivalent is.
(Um, did a little searching... does it even exist?)

To complicate it a little more, there are at two timing cases, depending
on the value of current_thread_info()->status & TS_USEDFPU.  (For PowerPC,
it's current->thread.regs->msr & MSR_VEC.)

There may be additional timing variation depending on how clever XSAVE
is with e.g. the high half of the ymm registers.


So I think the thing to do is benchmark a few different sizes in the two
timing cases and fit a linear function to the results.  (More simply,
subtract the timings from the integer code and find the X-intercept of
that function.)

But I'm not sure how to create, a suitably dirty user FPU state.
Especially as it might be early boot and there might not be any user
processes yet to save it to.

Does anyone have any suggestions?

Thank you!

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <BANLkTimyCodUvBUEVUJcb8TALF5x3H3UEQ@mail.gmail.com>]

end of thread, other threads:[~2011-06-05 15:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-03 17:26 How to measure enable_kernel_fpu overhead? George Spelvin
2011-06-04 20:17 ` Andi Kleen
2011-06-05  0:23   ` George Spelvin
2011-06-05  0:31     ` Andi Kleen
2011-06-05  1:50       ` George Spelvin
     [not found] <BANLkTimyCodUvBUEVUJcb8TALF5x3H3UEQ@mail.gmail.com>
2011-06-05 15:51 ` George Spelvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.