drivers/base/memory: pass a block_id to init_memory_block()
[platform/kernel/linux-rpi.git] / mm / swap.c
index 26fc9b5..45fdbfb 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -321,11 +321,6 @@ static inline void activate_page_drain(int cpu)
 {
 }
 
-static bool need_activate_page_drain(int cpu)
-{
-       return false;
-}
-
 void activate_page(struct page *page)
 {
        struct zone *zone = page_zone(page);
@@ -654,13 +649,15 @@ void lru_add_drain(void)
        put_cpu();
 }
 
+#ifdef CONFIG_SMP
+
+static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
+
 static void lru_add_drain_per_cpu(struct work_struct *dummy)
 {
        lru_add_drain();
 }
 
-static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work);
-
 /*
  * Doesn't need any cpu hotplug locking because we do rely on per-cpu
  * kworkers being shut down before our page_alloc_cpu_dead callback is
@@ -703,6 +700,12 @@ void lru_add_drain_all(void)
 
        mutex_unlock(&lock);
 }
+#else
+void lru_add_drain_all(void)
+{
+       lru_add_drain();
+}
+#endif
 
 /**
  * release_pages - batched put_page()
@@ -737,15 +740,20 @@ void release_pages(struct page **pages, int nr)
                if (is_huge_zero_page(page))
                        continue;
 
-               /* Device public page can not be huge page */
-               if (is_device_public_page(page)) {
+               if (is_zone_device_page(page)) {
                        if (locked_pgdat) {
                                spin_unlock_irqrestore(&locked_pgdat->lru_lock,
                                                       flags);
                                locked_pgdat = NULL;
                        }
-                       put_devmap_managed_page(page);
-                       continue;
+                       /*
+                        * ZONE_DEVICE pages that return 'false' from
+                        * put_devmap_managed_page() do not require special
+                        * processing, and instead, expect a call to
+                        * put_page_testzero().
+                        */
+                       if (put_devmap_managed_page(page))
+                               continue;
                }
 
                page = compound_head(page);