Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-21 Thread Andrea Arcangeli
On Sat, Nov 18, 2017 at 09:45:31PM +, Al Viro wrote: > in __get_user_pages_locked(), or am I missing something subtle there? Andrea? You're not missing anything as far as the logic is concerned. However see the __always_inline, I added "notify_drop" purely to optimize away such branch at

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-21 Thread Andrea Arcangeli
On Sat, Nov 18, 2017 at 09:45:31PM +, Al Viro wrote: > in __get_user_pages_locked(), or am I missing something subtle there? Andrea? You're not missing anything as far as the logic is concerned. However see the __always_inline, I added "notify_drop" purely to optimize away such branch at

mthca misuse of get_user_pages() (was Re: [git pull] vfs.git get_user_pages_fast() conversion)

2017-11-19 Thread Al Viro
On Fri, Nov 17, 2017 at 09:32:15PM +, Al Viro wrote: [snip] > drivers/infiniband/hw/mthca/mthca_memfree.c:475:ret = > get_user_pages(uaddr & PAGE_MASK, 1, FOLL_WRITE, pages, NULL); [snip] > Itanic > one is almost certainly buggered - we are not holding ->mmap_sem there. So's the

mthca misuse of get_user_pages() (was Re: [git pull] vfs.git get_user_pages_fast() conversion)

2017-11-19 Thread Al Viro
On Fri, Nov 17, 2017 at 09:32:15PM +, Al Viro wrote: [snip] > drivers/infiniband/hw/mthca/mthca_memfree.c:475:ret = > get_user_pages(uaddr & PAGE_MASK, 1, FOLL_WRITE, pages, NULL); [snip] > Itanic > one is almost certainly buggered - we are not holding ->mmap_sem there. So's the

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-18 Thread Dan Williams
On Fri, Nov 17, 2017 at 1:32 PM, Al Viro wrote: > On Fri, Nov 17, 2017 at 12:50:47PM -0800, Linus Torvalds wrote: > >> Not because the conversion was wrong, but because the original code is >> so broken. >> >> In particular, that "1" that is unchanged in the arguments is

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-18 Thread Dan Williams
On Fri, Nov 17, 2017 at 1:32 PM, Al Viro wrote: > On Fri, Nov 17, 2017 at 12:50:47PM -0800, Linus Torvalds wrote: > >> Not because the conversion was wrong, but because the original code is >> so broken. >> >> In particular, that "1" that is unchanged in the arguments is correct >> in the

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-18 Thread Al Viro
On Fri, Nov 17, 2017 at 09:32:15PM +, Al Viro wrote: > And for get_user_pages() itself it's even more ridiculous - vmalist (the last > argument) is non-NULL in only one caller. Which uses it only to check if all > of the VMAs happen to be hugetlb ones, apparently. > > FWIW, I wanted to trim

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-18 Thread Al Viro
On Fri, Nov 17, 2017 at 09:32:15PM +, Al Viro wrote: > And for get_user_pages() itself it's even more ridiculous - vmalist (the last > argument) is non-NULL in only one caller. Which uses it only to check if all > of the VMAs happen to be hugetlb ones, apparently. > > FWIW, I wanted to trim

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-17 Thread Al Viro
On Fri, Nov 17, 2017 at 12:50:47PM -0800, Linus Torvalds wrote: > Not because the conversion was wrong, but because the original code is > so broken. > > In particular, that "1" that is unchanged in the arguments is correct > in the conversion, but it was completely wrong in the original, even >

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-17 Thread Al Viro
On Fri, Nov 17, 2017 at 12:50:47PM -0800, Linus Torvalds wrote: > Not because the conversion was wrong, but because the original code is > so broken. > > In particular, that "1" that is unchanged in the arguments is correct > in the conversion, but it was completely wrong in the original, even >

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-17 Thread Linus Torvalds
On Thu, Nov 16, 2017 at 7:02 PM, Al Viro wrote: > A bunch of places switched to get_user_pages_fast(). I really would have liked a bit of a commentary. Looking at the individual patches, I notice this, for example: - down_read(>mm->mmap_sem); -

Re: [git pull] vfs.git get_user_pages_fast() conversion

2017-11-17 Thread Linus Torvalds
On Thu, Nov 16, 2017 at 7:02 PM, Al Viro wrote: > A bunch of places switched to get_user_pages_fast(). I really would have liked a bit of a commentary. Looking at the individual patches, I notice this, for example: - down_read(>mm->mmap_sem); - page_nr =

[git pull] vfs.git get_user_pages_fast() conversion

2017-11-16 Thread Al Viro
A bunch of places switched to get_user_pages_fast(). The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e: Linux 4.14-rc1 (2017-09-16 15:47:51 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git

[git pull] vfs.git get_user_pages_fast() conversion

2017-11-16 Thread Al Viro
A bunch of places switched to get_user_pages_fast(). The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e: Linux 4.14-rc1 (2017-09-16 15:47:51 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git