mm/memory hotplug: postpone the reset of obsolete pgdat
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / mm / page-writeback.c
index bcd929093e64c36b849bc5495e206ad5b659e420..73cbc5dc150b18ffa807761abb1af872757ed6bb 100644 (file)
@@ -202,7 +202,8 @@ static unsigned long zone_dirtyable_memory(struct zone *zone)
        nr_pages = zone_page_state(zone, NR_FREE_PAGES);
        nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
 
-       nr_pages += zone_reclaimable_pages(zone);
+       nr_pages += zone_page_state(zone, NR_INACTIVE_FILE);
+       nr_pages += zone_page_state(zone, NR_ACTIVE_FILE);
 
        return nr_pages;
 }
@@ -255,7 +256,8 @@ static unsigned long global_dirtyable_memory(void)
        x = global_page_state(NR_FREE_PAGES);
        x -= min(x, dirty_balance_reserve);
 
-       x += global_reclaimable_pages();
+       x += global_page_state(NR_INACTIVE_FILE);
+       x += global_page_state(NR_ACTIVE_FILE);
 
        if (!vm_highmem_is_dirtyable)
                x -= highmem_dirtyable_memory(x);
@@ -2024,11 +2026,12 @@ int __set_page_dirty_nobuffers(struct page *page)
        if (!TestSetPageDirty(page)) {
                struct address_space *mapping = page_mapping(page);
                struct address_space *mapping2;
+               unsigned long flags;
 
                if (!mapping)
                        return 1;
 
-               spin_lock_irq(&mapping->tree_lock);
+               spin_lock_irqsave(&mapping->tree_lock, flags);
                mapping2 = page_mapping(page);
                if (mapping2) { /* Race with truncate? */
                        BUG_ON(mapping2 != mapping);
@@ -2037,7 +2040,7 @@ int __set_page_dirty_nobuffers(struct page *page)
                        radix_tree_tag_set(&mapping->page_tree,
                                page_index(page), PAGECACHE_TAG_DIRTY);
                }
-               spin_unlock_irq(&mapping->tree_lock);
+               spin_unlock_irqrestore(&mapping->tree_lock, flags);
                if (mapping->host) {
                        /* !PageAnon && !swapper_space */
                        __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);