X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=mm%2Fpage_alloc.c;h=7e5e775e97f400d8a050effc41f68a8261bd9a23;hb=38acd9b8acf90f0cce094e1f5465522a96a66c67;hp=73f5d4556b3d0b7218bea0cb9bb0fdd1f1cb3cdd;hpb=4b43a3bc20ec6ecebb651f48a670373f9dfa1dbb;p=sfrench%2Fcifs-2.6.git diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 73f5d4556b3d..7e5e775e97f4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2684,6 +2684,7 @@ void free_unref_page_list(struct list_head *list) { struct page *page, *next; unsigned long flags, pfn; + int batch_count = 0; /* Prepare pages for freeing */ list_for_each_entry_safe(page, next, list, lru) { @@ -2700,6 +2701,16 @@ void free_unref_page_list(struct list_head *list) set_page_private(page, 0); trace_mm_page_free_batched(page); free_unref_page_commit(page, pfn); + + /* + * Guard against excessive IRQ disabled times when we get + * a large list of pages to free. + */ + if (++batch_count == SWAP_CLUSTER_MAX) { + local_irq_restore(flags); + batch_count = 0; + local_irq_save(flags); + } } local_irq_restore(flags); }