The patch titled Subject: mm/gup.c: document return value has been added to the -mm tree. Its filename is mm-gup-document-return-value.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-gup-document-return-value.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-gup-document-return-value.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: "Michael S. Tsirkin" <mst@xxxxxxxxxx> Subject: mm/gup.c: document return value __get_user_pages_fast handles errors differently from get_user_pages_fast: the former always returns the number of pages pinned, the later might return a negative error code. Link: http://lkml.kernel.org/r/1522962072-182137-6-git-send-email-mst@xxxxxxxxxx Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Huang Ying <ying.huang@xxxxxxxxx> Cc: Jonathan Corbet <corbet@xxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Thorsten Leemhuis <regressions@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN arch/mips/mm/gup.c~mm-gup-document-return-value arch/mips/mm/gup.c --- a/arch/mips/mm/gup.c~mm-gup-document-return-value +++ a/arch/mips/mm/gup.c @@ -178,6 +178,8 @@ static int gup_pud_range(pgd_t pgd, unsi /* * Like get_user_pages_fast() except its IRQ-safe in that it won't fall * back to the regular GUP. + * Note a difference with get_user_pages_fast: this always returns the + * number of pages pinned, 0 if no pages were pinned. */ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) diff -puN arch/s390/mm/gup.c~mm-gup-document-return-value arch/s390/mm/gup.c --- a/arch/s390/mm/gup.c~mm-gup-document-return-value +++ a/arch/s390/mm/gup.c @@ -220,6 +220,8 @@ static inline int gup_p4d_range(pgd_t *p /* * Like get_user_pages_fast() except its IRQ-safe in that it won't fall * back to the regular GUP. + * Note a difference with get_user_pages_fast: this always returns the + * number of pages pinned, 0 if no pages were pinned. */ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) diff -puN arch/sh/mm/gup.c~mm-gup-document-return-value arch/sh/mm/gup.c --- a/arch/sh/mm/gup.c~mm-gup-document-return-value +++ a/arch/sh/mm/gup.c @@ -160,6 +160,8 @@ static int gup_pud_range(pgd_t pgd, unsi /* * Like get_user_pages_fast() except its IRQ-safe in that it won't fall * back to the regular GUP. + * Note a difference with get_user_pages_fast: this always returns the + * number of pages pinned, 0 if no pages were pinned. */ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) diff -puN arch/sparc/mm/gup.c~mm-gup-document-return-value arch/sparc/mm/gup.c --- a/arch/sparc/mm/gup.c~mm-gup-document-return-value +++ a/arch/sparc/mm/gup.c @@ -193,6 +193,10 @@ static int gup_pud_range(pgd_t pgd, unsi return 1; } +/* + * Note a difference with get_user_pages_fast: this always returns the + * number of pages pinned, 0 if no pages were pinned. + */ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) { diff -puN mm/gup.c~mm-gup-document-return-value mm/gup.c --- a/mm/gup.c~mm-gup-document-return-value +++ a/mm/gup.c @@ -1740,7 +1740,9 @@ bool gup_fast_permitted(unsigned long st /* * Like get_user_pages_fast() except it's IRQ-safe in that it won't fall back to - * the regular GUP. It will only return non-negative values. + * the regular GUP. + * Note a difference with get_user_pages_fast: this always returns the + * number of pages pinned, 0 if no pages were pinned. */ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) diff -puN mm/util.c~mm-gup-document-return-value mm/util.c --- a/mm/util.c~mm-gup-document-return-value +++ a/mm/util.c @@ -297,8 +297,10 @@ void arch_pick_mmap_layout(struct mm_str /* * Like get_user_pages_fast() except its IRQ-safe in that it won't fall * back to the regular GUP. - * If the architecture not support this function, simply return with no - * page pinned + * Note a difference with get_user_pages_fast: this always returns the + * number of pages pinned, 0 if no pages were pinned. + * If the architecture does not support this function, simply return with no + * pages pinned. */ int __weak __get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) _ Patches currently in -mm which might be from mst@xxxxxxxxxx are mm-gup_benchmark-handle-gup-failures.patch gup-return-efault-on-access_ok-failure.patch mm-gup-document-return-value.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html