i=andrew.perepechko
i=adilger
Description: Avoid deadlock for local client writes
Details : Use new OBD_BRW_MEMALLOC flag to notify OST about writes in the
memory freeing context. This allows OST threads to set the
PF_MEMALLOC flag on task structures in order to allocate memory
from reserved pools and complete IO.
Use GFP_HIGHUSER for OST allocations for non-local client writes,
so that the OST threads generate memory pressure and allow
inactive pages to be reclaimed.
#define __cfs_free_page(page) __cfs_free_pages(page, 0)
#define cfs_free_page(p) __free_pages(p, 0)
+#define libcfs_memory_pressure_get() (current->flags & PF_MEMALLOC)
+#define libcfs_memory_pressure_set() do { current->flags |= PF_MEMALLOC; } while(0)
+#define libcfs_memory_pressure_clr() do { current->flags &= ~PF_MEMALLOC; } while (0)
+
/*
* In Linux there is no way to determine whether current execution context is
* blockable.