On Thu, 3 Apr 2014 17:35:17 +0300 "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> wrote: > Here's my attempt to cleanup of get_user_pages() code in order to make it > more maintainable. > > Tested on my laptop for few hours. No crashes so far ;) > > Let me know if it makes sense. Any suggestions are welcome. > > Kirill A. Shutemov (5): > mm: move get_user_pages()-related code to separate file > mm: extract in_gate_area() case from __get_user_pages() > mm: cleanup follow_page_mask() > mm: extract code to fault in a page from __get_user_pages() > mm: cleanup __get_user_pages() > > mm/Makefile | 2 +- > mm/gup.c | 638 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > mm/memory.c | 611 --------------------------------------------------------- Fair enough. We don't have anything like enough #includes in the new gup.c so there's a risk of Kconfig-dependent breakage. I plugged in a few obvious ones, but many more are surely missing. From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: mm/gup.c: tweaks - include some more header files, but many are still missed - fix some 80-col overflows by removing unneeded `inline' Cc: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/gup.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff -puN mm/gup.c~a mm/gup.c --- a/mm/gup.c~a +++ a/mm/gup.c @@ -1,3 +1,8 @@ +#include <linux/kernel.h> +#include <linux/errno.h> +#include <linux/err.h> +#include <linux/spinlock.h> + #include <linux/hugetlb.h> #include <linux/mm.h> #include <linux/rmap.h> @@ -6,8 +11,8 @@ #include "internal.h" -static inline struct page *no_page_table(struct vm_area_struct *vma, - unsigned int flags) +static struct page *no_page_table(struct vm_area_struct *vma, + unsigned int flags) { /* * When core dumping an enormous anonymous area that nobody @@ -208,7 +213,7 @@ struct page *follow_page_mask(struct vm_ return follow_page_pte(vma, address, pmd, flags); } -static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr) +static int stack_guard_page(struct vm_area_struct *vma, unsigned long addr) { return stack_guard_page_start(vma, addr) || stack_guard_page_end(vma, addr+PAGE_SIZE); _ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>