From: dzogin Date: Wed, 15 Jul 2009 13:20:56 +0000 (+0000) Subject: b=19529 X-Git-Tag: v1_8_2_01~1^5~21 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6d2baf29ee8b4a6c136a230e57625b3b2d19d9ff;p=fs%2Flustre-release.git b=19529 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. --- diff --git a/lnet/include/libcfs/linux/linux-mem.h b/lnet/include/libcfs/linux/linux-mem.h index d538ff0..8f0de46 100644 --- a/lnet/include/libcfs/linux/linux-mem.h +++ b/lnet/include/libcfs/linux/linux-mem.h @@ -110,6 +110,10 @@ extern void __cfs_free_pages(cfs_page_t *page, unsigned int order); #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.