Whamcloud - gitweb
LU-4357 libcfs: restore __GFP_WAIT flag to memalloc calls 23/9223/3
authorAnn Koehler <amk@cray.com>
Wed, 12 Feb 2014 17:14:00 +0000 (01:14 +0800)
committerEmoly Liu <emoly.liu@intel.com>
Thu, 20 Feb 2014 08:59:21 +0000 (16:59 +0800)
commite6b3d5de62b43a8702aa2dbda4a0bc6b6b10b5c2
treef3d220886bfbfec02b4d9be2dcdda6c3681d213c
parent38e67bc99804b98f88fcfd1adc0ef54f79549676
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
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