Whamcloud - gitweb
LU-4357 libcfs: restore __GFP_WAIT flag to memalloc calls 82/9382/2
authorAnn Koehler <amk@cray.com>
Wed, 12 Feb 2014 17:14:00 +0000 (01:14 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 26 Feb 2014 23:21:54 +0000 (23:21 +0000)
commit840b32801ad9735d9914afb37dcbcb915d96f703
tree320777b1dada233ee6823e16353b2612cc641f10
parent17a521aff30bc4ef67c40bf7203be2addb84b609
LU-4357 libcfs: restore __GFP_WAIT flag to memalloc calls

In 2.4, the flags passed to the memory allocation functions are
translated from CFS enumeration values types to the kernel GFP
values by calling cfs_alloc_flags_to_gfp(). This function adds
__GFP_WAIT to all flags except CFS_ALLOC_ATOMIC. In 2.5, when
the cfs wrappers were dropped, cfs_alloc_flags_to_gfp() was
removed and the CFS_ALLOC_xxxx was simply replaced with __GFP_xxxx.
This means that most memory allocation calls are missing the
__GFP_WAIT flag. The result is that Lustre experiences more ENOMEM
errors, many of which the higher levels of Lustre do not handle
robustly.
Notes GFP_NOFS = __GFP_WAIT | __GFP_IO. So the patch replaces
__GFP_IO with GFP_NOFS.
Patch does not add __GFP_WAIT to GFP_IOFS. GFP_IOFS was not used in
2.4 so it has never been used with __GFP_WAIT.

Lustre-commit: e6b3d5de62b43a8702aa2dbda4a0bc6b6b10b5c2
Lustre-change: http://review.whamcloud.com/9223

Signed-off-by: Ann Koehler <amk@cray.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I8f0341c34e595d437c06a4564a11e4c52bd4363a
Reviewed-on: http://review.whamcloud.com/9382
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
46 files changed:
libcfs/include/libcfs/libcfs_private.h
lnet/klnds/gnilnd/gnilnd_proc.c
lnet/klnds/o2iblnd/o2iblnd.c
lustre/include/obd_class.h
lustre/include/obd_support.h
lustre/lclient/lcommon_cl.c
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_resource.c
lustre/llite/file.c
lustre/llite/super25.c
lustre/llite/vvp_dev.c
lustre/llite/xattr_cache.c
lustre/lod/lod_dev.c
lustre/lov/lov_dev.c
lustre/lov/lov_ea.c
lustre/lov/lov_lock.c
lustre/lov/lov_object.c
lustre/lov/lovsub_dev.c
lustre/lov/lovsub_lock.c
lustre/lov/lovsub_object.c
lustre/mdd/mdd_object.c
lustre/mdt/mdt_handler.c
lustre/obdclass/cl_lock.c
lustre/obdclass/cl_object.c
lustre/obdclass/cl_page.c
lustre/obdclass/genops.c
lustre/obdecho/echo_client.c
lustre/ofd/ofd_dev.c
lustre/osc/osc_dev.c
lustre/osc/osc_io.c
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_quota_fmt.c
lustre/osd-zfs/osd_object.c
lustre/osp/osp_dev.c
lustre/ptlrpc/client.c
lustre/ptlrpc/nrs.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/sec.c
lustre/ptlrpc/sec_bulk.c
lustre/ptlrpc/service.c
lustre/quota/lquota_entry.c
lustre/quota/qsd_writeback.c