The patch titled page_fault-retry-with-nopage_retry-fix has been added to the -mm tree. Its filename is page_fault-retry-with-nopage_retry-fix.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/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: page_fault-retry-with-nopage_retry-fix From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Hugh Dickins <hugh@xxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Lee Schermerhorn <lee.schermerhorn@xxxxxx> Cc: Mike Waychison <mikew@xxxxxxxxxx> Cc: Nick Piggin <npiggin@xxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Cc: Rohit Seth <rohitseth@xxxxxxxxxx> Cc: Török Edwin <edwintorok@xxxxxxxxx> Cc: Ying Han <yinghan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/pagemap.h | 3 +++ mm/filemap.c | 38 ++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff -puN include/linux/pagemap.h~page_fault-retry-with-nopage_retry-fix include/linux/pagemap.h --- a/include/linux/pagemap.h~page_fault-retry-with-nopage_retry-fix +++ a/include/linux/pagemap.h @@ -232,6 +232,9 @@ extern struct page * find_get_page(struc pgoff_t index); extern struct page * find_lock_page(struct address_space *mapping, pgoff_t index); +extern unsigned find_lock_page_retry(struct address_space *mapping, + pgoff_t offset, struct vm_area_struct *vma, + struct page **ppage, int retry) extern struct page * find_or_create_page(struct address_space *mapping, pgoff_t index, gfp_t gfp_mask); unsigned find_get_pages(struct address_space *mapping, pgoff_t start, diff -puN mm/filemap.c~page_fault-retry-with-nopage_retry-fix mm/filemap.c --- a/mm/filemap.c~page_fault-retry-with-nopage_retry-fix +++ a/mm/filemap.c @@ -714,51 +714,53 @@ repeat: EXPORT_SYMBOL(find_lock_page); /** - * find_lock_page_retry - locate, pin and lock a pagecache page, if retry - * flag is on, and page is already locked by someone else, return a hint of - * retry. + * find_lock_page_retry - locate, pin and lock a pagecache page * @mapping: the address_space to search * @offset: the page index * @vma: vma in which the fault was taken - * @page: zero if page not present, otherwise point to the page in - * pagecache. + * @ppage: zero if page not present, otherwise point to the page in pagecache. * @retry: 1 indicate caller tolerate a retry. * - * Return *page==NULL if page is not in pagecache. Otherwise return *page + * If retry flag is on, and page is already locked by someone else, return a + * hint of retry. + * + * Return *ppage==NULL if page is not in pagecache. Otherwise return *ppage * points to the page in the pagecache with ret=VM_FAULT_RETRY indicate a - * hint to caller for retry, or ret=0 which means page is succefully + * hint to caller for retry, or ret=0 which means page is successfully * locked. */ unsigned find_lock_page_retry(struct address_space *mapping, pgoff_t offset, - struct vm_area_struct *vma, struct page **page, + struct vm_area_struct *vma, struct page **ppage, int retry) { unsigned int ret = 0; + struct page *page; repeat: - *page = find_get_page(mapping, offset); - if (*page) { + page = find_get_page(mapping, offset); + if (page) { if (!retry) - lock_page(*page); + lock_page(page); else { - if (!trylock_page(*page)) { + if (!trylock_page(page)) { struct mm_struct *mm = vma->vm_mm; up_read(&mm->mmap_sem); - wait_on_page_locked(*page); + wait_on_page_locked(page); down_read(&mm->mmap_sem); - page_cache_release(*page); + page_cache_release(page); return VM_FAULT_RETRY; } } - if (unlikely((*page)->mapping != mapping)) { - unlock_page(*page); - page_cache_release(*page); + if (unlikely(page->mapping != mapping)) { + unlock_page(page); + page_cache_release(page); goto repeat; } - VM_BUG_ON((*page)->index != offset); + VM_BUG_ON(page->index != offset); } + *ppage = page; return ret; } EXPORT_SYMBOL(find_lock_page_retry); _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are origin.patch mm-backing-devc-remove-recently-added-warn_on.patch revert-percpu-counter-clean-up-percpu_counter_sum_and_set.patch revert-percpu_counter-new-function-percpu_counter_sum_and_set.patch ksym_symbol_len-fixes.patch mm-remove-the-might_sleep-from-lock_page.patch make-linx-next-apply.patch linux-next.patch next-remove-localversion.patch linux-next-git-rejects.patch tick-schedc-suppress-needless-timer-reprogramming.patch linux-timexh-cleanup-for-userspace.patch drivers-input-touchscreen-ucb1400_tsc-needs-gpio.patch pci-uninline-pci_ioremap_bar.patch raw-fix-rawctl-compat-ioctls-breakage-on-amd64-and-itanic-checkpatch-fixes.patch scsi-dpt_i2o-is-bust-on-ia64.patch mm-invoke-oom-killer-from-page-fault-fix.patch mm-invoke-oom-killer-from-page-fault-fix-fix-2.patch mm-write_cache_pages-more-terminate-quickly.patch swapfile-change-discard-pgoff_t-to-sector_t-fix.patch fs-truncate-blocks-outside-i_size-after-o_direct-write-error-fix.patch vmscan-shrink_active_list-reduce-lru_lock-hold-time.patch page_fault-retry-with-nopage_retry-fix.patch init-properly-placing-noinline-keyword.patch add-pr_prefix-to-pr_xyz-macros-checkpatch-fixes.patch poll-allow-f_op-poll-to-sleep-take6.patch binfmtsh-include-listh-fix.patch max3100-spi-uart-driver-select-serial_core-fix.patch spi_gpio-driver-cleanups.patch kprobes-support-probing-module-__exit-function-fix.patch kprobes-support-probing-module-__exit-function-fix-2.patch nfs-optimize-attribute-timeouts-for-noac-and-actimeo=0-checkpatch-fixes.patch nfs-optimize-attribute-timeouts-for-noac-and-actimeo=0-checkpatch-fixes-checkpatch-fixes.patch rtc-au1000-on-chip-counter0-as-rtc-driver-fix.patch cgroups-skip-processes-from-other-namespaces-when-listing-a-cgroup-checkpatch-fixes.patch memcg-introduce-charge-commit-cancel-style-of-functions-fix.patch memcg-new-force_empty-to-free-pages-under-group-fix-fix.patch memcg-swap-cgroup-for-remembering-usage.patch memory-cgroup-resource-counters-for-hierarchy-v4-checkpatch-fixes.patch memory-cgroup-hierarchical-reclaim-v4-checkpatch-fixes.patch memcg-avoid-unnecessary-system-wide-oom-killer-fix.patch edac-struct-device-replace-bus_id-with-dev_name-dev_set_name-checkpatch-fixes.patch edac-x38-use-the-architectures-readq-function-fix.patch parport-ieee1284-use-del_timer_sync-in-parport_wait_event-checkpatch-fixes.patch romfs-romfs_iget-unsigned-ino-=-0-is-always-true-checkpatch-fixes.patch filesystem-freeze-implement-generic-freeze-feature-fix.patch ldisc-n_tty-export-all-n_tty-ldisc-methods-fix.patch nilfs2-inode-operations-fix.patch nilfs2-pathname-operations-fix.patch nilfs2-super-block-operations-fix.patch reiser4.patch reiser4-tree_lock-fixes.patch reiser4-tree_lock-fixes-fix.patch reiser4-semaphore-fix.patch slb-drop-kmem-cache-argument-from-constructor-reiser4.patch reiser4-suid.patch reiser4-track-upstream-changes.patch reiser4-remove-simple_prepare_write-usage-checkpatch-fixes.patch nr_blockdev_pages-in_interrupt-warning.patch slab-leaks3-default-y.patch put_bh-debug.patch shrink_slab-handle-bad-shrinkers.patch getblk-handle-2tb-devices.patch getblk-handle-2tb-devices-fix.patch undeprecate-pci_find_device.patch notify_change-callers-must-hold-i_mutex.patch drivers-net-bonding-bond_sysfsc-suppress-uninitialized-var-warning.patch w1-build-fix.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