thp: limit number of object to scan on deferred_split_scan()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 3 Feb 2016 00:57:15 +0000 (16:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Feb 2016 16:28:43 +0000 (08:28 -0800)
commite3ae19535c665771e2c03cdd63df9bc4d6b37941
treed25d4a9c455874aac68e34e37d46fcb8d50b05ae
parentcb8d68ec16a511f8be7e1028fd8f869ef7c6a1a8
thp: limit number of object to scan on deferred_split_scan()

If we have a lot of pages in queue to be split, deferred_split_scan()
can spend unreasonable amount of time under spinlock with disabled
interrupts.

Let's cap number of pages to split on scan by sc->nr_to_scan.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c