Whamcloud - gitweb
LU-4357 libcfs: restore __GFP_WAIT flag to memalloc calls 23/9223/5
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:10:35 +0000 (23:10 +0000)
commitf2a404d1fec2287ef9ffda105727e8cd3f8e0b7b
tree32e6563a7b0c659ee03b3a446b6de58442919efb
parent11317196203c26f8c9e4d2a8261859b1c7a76c9d
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.

Signed-off-by: Ann Koehler <amk@cray.com>
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: Ib241b39674129a27fea53c23c8ce3e74d165372a
Reviewed-on: http://review.whamcloud.com/9223
Tested-by: Jenkins
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@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