[lkml]   [2013]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] perf, x86: Optimize intel_pmu_pebs_fixup_ip()
On Wed, Oct 16, 2013 at 01:52:27PM -0700, Andi Kleen wrote:
> > So avoid having to call copy_from_user_nmi() for every instruction.
> > Since we already limit the max basic block size, we can easily
> > pre-allocate a piece of memory to copy the entire thing into in one
> > go.
> It would be better/more generic if you split copy_from_user_nmi() into
> init() copy() end()
> (and some state that checks if the underlying page changes)
> Then first you don't need the buffer and it could be also
> be applied to the other cases, like the stack unwinding,
> where copying everything is likely too slow.

You'd need to make an iterator interface because of the kmap_atomic crap
needed for 32bit.

But yes, something like that might work, it shouldn't be that hard to
cobble on top of that GUP patch I send out the other day.

The only real nasty part is where an instruction straddles a page
boundary, in that case the iterator stuff fails to be fully transparant
and you need a temp copy of sorts.

Anyway; if you want to have a go at this, feel free.

 \ /
  Last update: 2013-10-16 23:21    [W:0.212 / U:4.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site