]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/zsmalloc.c
mm, oom_reaper: skip mm structs with mmu notifiers
[mirror_ubuntu-bionic-kernel.git] / mm / zsmalloc.c
index 62457eb823306111a44f172897cbc7aecd56134c..7c38e850a8fc5ce0c4f64090e9f9ac6ef6de7203 100644 (file)
@@ -551,20 +551,23 @@ static int get_size_class_index(int size)
        return min_t(int, ZS_SIZE_CLASSES - 1, idx);
 }
 
+/* type can be of enum type zs_stat_type or fullness_group */
 static inline void zs_stat_inc(struct size_class *class,
-                               enum zs_stat_type type, unsigned long cnt)
+                               int type, unsigned long cnt)
 {
        class->stats.objs[type] += cnt;
 }
 
+/* type can be of enum type zs_stat_type or fullness_group */
 static inline void zs_stat_dec(struct size_class *class,
-                               enum zs_stat_type type, unsigned long cnt)
+                               int type, unsigned long cnt)
 {
        class->stats.objs[type] -= cnt;
 }
 
+/* type can be of enum type zs_stat_type or fullness_group */
 static inline unsigned long zs_stat_get(struct size_class *class,
-                               enum zs_stat_type type)
+                               int type)
 {
        return class->stats.objs[type];
 }
@@ -1969,6 +1972,14 @@ int zs_page_migrate(struct address_space *mapping, struct page *newpage,
        unsigned int obj_idx;
        int ret = -EAGAIN;
 
+       /*
+        * We cannot support the _NO_COPY case here, because copy needs to
+        * happen under the zs lock, which does not work with
+        * MIGRATE_SYNC_NO_COPY workflow.
+        */
+       if (mode == MIGRATE_SYNC_NO_COPY)
+               return -EINVAL;
+
        VM_BUG_ON_PAGE(!PageMovable(page), page);
        VM_BUG_ON_PAGE(!PageIsolated(page), page);