[PATCH] mm: cma: sync everything after EBUSY

Edward Wu
2022-06-15T02:15:55Z

index eaa4b5c920a2..eefd725064e1 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -31,6 +31,7 @@
#include <linux/highmem.h>
#include <linux/io.h>
#include <linux/kmemleak.h>
+#include <linux/syscalls.h>
#include <trace/events/cma.h>

#include "cma.h"
@@ -410,6 +411,24 @@ static void cma_debug_show_areas(struct cma *cma)
static inline void cma_debug_show_areas(struct cma *cma) { }
#endif

+void cma_sync_work(struct work_struct *work)
+{
+ ksys_sync();
+ kfree(work);
+ pr_debug("%s(): EBUSY Sync complete\n", __func__);
+}
+
+void cma_ebusy_sync_pinned_pages(void)