Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-21 Thread Nicholas Piggin
Christoph Hellwig's on June 21, 2019 6:15 pm: > On Thu, Jun 20, 2019 at 10:21:46AM -0700, Linus Torvalds wrote: >> Hmm. Honestly, I've never seen anything like that in any kernel profiles. >> >> Compared to the problems I _do_ see (which is usually the obvious >> cache misses, and locking), it mus

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-21 Thread Nicholas Piggin
Linus Torvalds's on June 21, 2019 3:21 am: > On Thu, Jun 20, 2019 at 5:19 AM Nicholas Piggin wrote: >> >> The processor aliasing problem happens because the struct will >> be initialised with stores using one base register (e.g., stack >> register), and then same memory is loaded using a different

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-21 Thread Christoph Hellwig
On Thu, Jun 20, 2019 at 10:21:46AM -0700, Linus Torvalds wrote: > Hmm. Honestly, I've never seen anything like that in any kernel profiles. > > Compared to the problems I _do_ see (which is usually the obvious > cache misses, and locking), it must either be in the noise or it's > some problem spec

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-20 Thread Linus Torvalds
On Thu, Jun 20, 2019 at 5:19 AM Nicholas Piggin wrote: > > The processor aliasing problem happens because the struct will > be initialised with stores using one base register (e.g., stack > register), and then same memory is loaded using a different > register (e.g., parameter register). Hmm. Hon

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-20 Thread Nicholas Piggin
Linus Torvalds's on June 12, 2019 11:09 am: > On Tue, Jun 11, 2019 at 2:55 PM Nicholas Piggin wrote: >> >> What does this do for performance? I've found this pattern can be >> bad for store aliasing detection. > > I wouldn't expect it to be noticeable, and the lack of argument > reloading etc sho

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-11 Thread Nadav Amit
> On Jun 11, 2019, at 5:52 PM, Nicholas Piggin wrote: > > Christoph Hellwig's on June 12, 2019 12:41 am: >> Instead of passing a set of always repeated arguments down the >> get_user_pages_fast iterators, create a struct gup_args to hold them and >> pass that by reference. This leads to an over

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-11 Thread Linus Torvalds
On Tue, Jun 11, 2019 at 2:55 PM Nicholas Piggin wrote: > > What does this do for performance? I've found this pattern can be > bad for store aliasing detection. I wouldn't expect it to be noticeable, and the lack of argument reloading etc should make up for it. Plus inlining makes it a non-issue

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-11 Thread Nicholas Piggin
Christoph Hellwig's on June 12, 2019 12:41 am: > Instead of passing a set of always repeated arguments down the > get_user_pages_fast iterators, create a struct gup_args to hold them and > pass that by reference. This leads to an over 100 byte .text size > reduction for x86-64. What does this do

[PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-11 Thread Christoph Hellwig
Instead of passing a set of always repeated arguments down the get_user_pages_fast iterators, create a struct gup_args to hold them and pass that by reference. This leads to an over 100 byte .text size reduction for x86-64. Signed-off-by: Christoph Hellwig --- mm/gup.c | 338 +++