The patch titled Subject: mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again has been added to the -mm tree. Its filename is mm-clear-pages_scanned-only-if-draining-a-pcp-adds-pages-to-the-buddy-allocator-again.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 *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Subject: mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again commit 2ff754fa8f ("mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again") fixed one free_pcppages_bulk() misuse. But two another miuse still exist. This patch fixes it. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Acked-by: David Rientjes <rientjes@xxxxxxxxxx> Acked-by: Mel Gorman <mel@xxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Reviewed-by: Minchan Kim <minchan@xxxxxxxxxx> Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff -puN mm/page_alloc.c~mm-clear-pages_scanned-only-if-draining-a-pcp-adds-pages-to-the-buddy-allocator-again mm/page_alloc.c --- a/mm/page_alloc.c~mm-clear-pages_scanned-only-if-draining-a-pcp-adds-pages-to-the-buddy-allocator-again +++ a/mm/page_alloc.c @@ -1157,8 +1157,10 @@ void drain_zone_pages(struct zone *zone, to_drain = pcp->batch; else to_drain = pcp->count; - free_pcppages_bulk(zone, to_drain, pcp); - pcp->count -= to_drain; + if (to_drain > 0) { + free_pcppages_bulk(zone, to_drain, pcp); + pcp->count -= to_drain; + } local_irq_restore(flags); } #endif @@ -3914,7 +3916,8 @@ static int __zone_pcp_update(void *data) pcp = &pset->pcp; local_irq_save(flags); - free_pcppages_bulk(zone, pcp->count, pcp); + if (pcp->count > 0) + free_pcppages_bulk(zone, pcp->count, pcp); setup_pageset(pset, batch); local_irq_restore(flags); } _ Subject: Subject: mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator again Patches currently in -mm which might be from kosaki.motohiro@xxxxxxxxxxxxxx are linux-next.patch memory-hotplug-fix-invalid-memory-access-caused-by-stale-kswapd-pointer.patch memory-hotplug-fix-invalid-memory-access-caused-by-stale-kswapd-pointer-fix.patch c-r-prctl-less-paranoid-prctl_set_mm_exe_file.patch hugetlb-rename-max_hstate-to-hugetlb_max_hstate.patch hugetlb-dont-use-err_ptr-with-vm_fault-values.patch hugetlb-add-an-inline-helper-for-finding-hstate-index.patch hugetlb-use-mmu_gather-instead-of-a-temporary-linked-list-for-accumulating-pages.patch hugetlb-avoid-taking-i_mmap_mutex-in-unmap_single_vma-for-hugetlb.patch hugetlb-simplify-migrate_huge_page.patch hugetlb-add-a-list-for-tracking-in-use-hugetlb-pages.patch hugetlb-make-some-static-variables-global.patch mm-hugetlb-add-new-hugetlb-cgroup.patch hugetlb-cgroup-add-the-cgroup-pointer-to-page-lru.patch hugetlb-cgroup-add-charge-uncharge-routines-for-hugetlb-cgroup.patch hugetlb-cgroup-add-support-for-cgroup-removal.patch hugetlb-cgroup-add-hugetlb-cgroup-control-files.patch hugetlb-cgroup-migrate-hugetlb-cgroup-info-from-oldpage-to-new-page-during-migration.patch hugetlb-cgroup-add-hugetlb-controller-documentation.patch mm-oom-do-not-schedule-if-current-has-been-killed.patch mm-fadvise-dont-return-einval-when-filesystem-cannot-implement-fadvise.patch mm-fadvise-dont-return-einval-when-filesystem-cannot-implement-fadvise-checkpatch-fixes.patch mm-clear-pages_scanned-only-if-draining-a-pcp-adds-pages-to-the-buddy-allocator-again.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