#define PF_UMH                 0x02000000      /* I'm an Usermodehelper process */
 #define PF_NO_SETAFFINITY      0x04000000      /* Userland is not allowed to meddle with cpus_allowed */
 #define PF_MCE_EARLY           0x08000000      /* Early kill for mce process policy */
+#define PF_MEMALLOC_NOCMA      0x10000000      /* All allocation request will have _GFP_MOVABLE cleared */
 #define PF_MUTEX_TESTER                0x20000000      /* Thread belongs to the rt mutex tester */
 #define PF_FREEZER_SKIP                0x40000000      /* Freezer should not count it as freezable */
 #define PF_SUSPEND_TASK                0x80000000      /* This thread called freeze_processes() and should not be frozen */
 
  * Applies per-task gfp context to the given allocation flags.
  * PF_MEMALLOC_NOIO implies GFP_NOIO
  * PF_MEMALLOC_NOFS implies GFP_NOFS
+ * PF_MEMALLOC_NOCMA implies no allocation from CMA region.
  */
 static inline gfp_t current_gfp_context(gfp_t flags)
 {
-       /*
-        * NOIO implies both NOIO and NOFS and it is a weaker context
-        * so always make sure it makes precedence
-        */
-       if (unlikely(current->flags & PF_MEMALLOC_NOIO))
-               flags &= ~(__GFP_IO | __GFP_FS);
-       else if (unlikely(current->flags & PF_MEMALLOC_NOFS))
-               flags &= ~__GFP_FS;
+       if (unlikely(current->flags &
+                    (PF_MEMALLOC_NOIO | PF_MEMALLOC_NOFS | PF_MEMALLOC_NOCMA))) {
+               /*
+                * NOIO implies both NOIO and NOFS and it is a weaker context
+                * so always make sure it makes precedence
+                */
+               if (current->flags & PF_MEMALLOC_NOIO)
+                       flags &= ~(__GFP_IO | __GFP_FS);
+               else if (current->flags & PF_MEMALLOC_NOFS)
+                       flags &= ~__GFP_FS;
+#ifdef CONFIG_CMA
+               if (current->flags & PF_MEMALLOC_NOCMA)
+                       flags &= ~__GFP_MOVABLE;
+#endif
+       }
        return flags;
 }
 
        current->flags = (current->flags & ~PF_MEMALLOC) | flags;
 }
 
+#ifdef CONFIG_CMA
+static inline unsigned int memalloc_nocma_save(void)
+{
+       unsigned int flags = current->flags & PF_MEMALLOC_NOCMA;
+
+       current->flags |= PF_MEMALLOC_NOCMA;
+       return flags;
+}
+
+static inline void memalloc_nocma_restore(unsigned int flags)
+{
+       current->flags = (current->flags & ~PF_MEMALLOC_NOCMA) | flags;
+}
+#else
+static inline unsigned int memalloc_nocma_save(void)
+{
+       return 0;
+}
+
+static inline void memalloc_nocma_restore(unsigned int flags)
+{
+}
+#endif
+
 #ifdef CONFIG_MEMCG
 /**
  * memalloc_use_memcg - Starts the remote memcg charging scope.