Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level

2015-06-03 Thread Michael S. Tsirkin
On Thu, May 21, 2015 at 03:19:58PM +0200, Paolo Bonzini wrote: > phys_page_set_level is writing zeroes to a struct that has just been > filled in by phys_map_node_alloc. Instead, tell phys_map_node_alloc > whether to fill in the page "as a leaf" or "as a non-leaf". > > memcpy is faster than struc

Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level

2015-06-03 Thread Paolo Bonzini
On 03/06/2015 06:30, Richard Henderson wrote: > On 05/21/2015 06:19 AM, Paolo Bonzini wrote: >> memcpy is faster than struct assignment, which copies each bitfield >> individually. Arguably a compiler bug, but memcpy is super-special >> cased anyway so what could go wrong? > > The compiler has

Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level

2015-06-02 Thread Richard Henderson
On 05/21/2015 06:19 AM, Paolo Bonzini wrote: memcpy is faster than struct assignment, which copies each bitfield individually. Arguably a compiler bug, but memcpy is super-special cased anyway so what could go wrong? The compiler has the option of doing the copy either way. Any way to actual

Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level

2015-05-22 Thread Stefan Hajnoczi
On Thu, May 21, 2015 at 03:19:58PM +0200, Paolo Bonzini wrote: > phys_page_set_level is writing zeroes to a struct that has just been > filled in by phys_map_node_alloc. Instead, tell phys_map_node_alloc > whether to fill in the page "as a leaf" or "as a non-leaf". > > memcpy is faster than struc

[Qemu-devel] [PATCH] exec: optimize phys_page_set_level

2015-05-21 Thread Paolo Bonzini
phys_page_set_level is writing zeroes to a struct that has just been filled in by phys_map_node_alloc. Instead, tell phys_map_node_alloc whether to fill in the page "as a leaf" or "as a non-leaf". memcpy is faster than struct assignment, which copies each bitfield individually. Arguably a compil