Re: x86: page enter optimization

2016-10-14 Thread Jean-Yves Migeon
Le 2016-10-11 14:42, Maxime Villard a écrit : Userland is pageable, so when mmap is called with one page, the kernel does not yet make the page officially available to the CPU. Rather, it waits for the page to fault, and at fault time it will make it valid for real. It means the kernel code pat

Re: x86: page enter optimization

2016-10-14 Thread Joerg Sonnenberger
On Fri, Oct 14, 2016 at 07:22:50PM +0200, Maxime Villard wrote: > Le 11/10/2016 à 18:26, Joerg Sonnenberger a écrit : > > On Tue, Oct 11, 2016 at 02:42:00PM +0200, Maxime Villard wrote: > > > All this to say that in pmap_enter_ma on x86, an optimization is > > > possible. In > > > this function, n

Re: x86: page enter optimization

2016-10-14 Thread Maxime Villard
Le 11/10/2016 à 18:26, Joerg Sonnenberger a écrit : On Tue, Oct 11, 2016 at 02:42:00PM +0200, Maxime Villard wrote: All this to say that in pmap_enter_ma on x86, an optimization is possible. In this function, new_pve and new_sparepve are always allocated, but not always needed. The reason it is

Re: x86: page enter optimization

2016-10-14 Thread Joerg Sonnenberger
On Fri, Oct 14, 2016 at 08:56:18PM +0200, Maxime Villard wrote: > We would either be leaking memory or freeing some we allocated for no > reason, the latter meaning we still didn't fix the issue for real. I'm not > sure multiplying critical sections is a good idea. I don't think we normally migrat

Re: x86: page enter optimization

2016-10-14 Thread Maxime Villard
Le 14/10/2016 à 12:03, Jean-Yves Migeon a écrit : I would benchmark both (with and without the "overhead" introduced); a while back when implementing PAE I did not expect the paddr_t promotion from 32 to 64 bits to have that much of an impact on pmap performance, but the first attempt induced mor

Re: x86: page enter optimization

2016-10-14 Thread Maxime Villard
Le 14/10/2016 à 20:34, Joerg Sonnenberger a écrit : On Fri, Oct 14, 2016 at 07:22:50PM +0200, Maxime Villard wrote: Le 11/10/2016 à 18:26, Joerg Sonnenberger a écrit : On Tue, Oct 11, 2016 at 02:42:00PM +0200, Maxime Villard wrote: All this to say that in pmap_enter_ma on x86, an optimization