提交 40113370 编写于 作者: M Mel Gorman 提交者: Linus Torvalds

mm: page_alloc: remove GFP_IOFS

GFP_IOFS was intended to be shorthand for clearing two flags, not a set of
allocation flags.  There is only one user of this flag combination now and
there appears to be no reason why Lustre had to be protected from reclaim
stalls.  As none of the sites appear to be atomic, this patch simply
deletes GFP_IOFS and converts Lustre to using GFP_KERNEL, GFP_NOFS or
GFP_NOIO as appropriate.
Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d0164adc
...@@ -1245,7 +1245,7 @@ lnet_new_rtrbuf(lnet_rtrbufpool_t *rbp, int cpt) ...@@ -1245,7 +1245,7 @@ lnet_new_rtrbuf(lnet_rtrbufpool_t *rbp, int cpt)
for (i = 0; i < npages; i++) { for (i = 0; i < npages; i++) {
page = alloc_pages_node( page = alloc_pages_node(
cfs_cpt_spread_node(lnet_cpt_table(), cpt), cfs_cpt_spread_node(lnet_cpt_table(), cpt),
__GFP_ZERO | GFP_IOFS, 0); GFP_KERNEL | __GFP_ZERO, 0);
if (page == NULL) { if (page == NULL) {
while (--i >= 0) while (--i >= 0)
__free_page(rb->rb_kiov[i].kiov_page); __free_page(rb->rb_kiov[i].kiov_page);
......
...@@ -860,7 +860,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats, ...@@ -860,7 +860,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
bulk->bk_iovs[i].kiov_offset = 0; bulk->bk_iovs[i].kiov_offset = 0;
bulk->bk_iovs[i].kiov_len = len; bulk->bk_iovs[i].kiov_len = len;
bulk->bk_iovs[i].kiov_page = bulk->bk_iovs[i].kiov_page =
alloc_page(GFP_IOFS); alloc_page(GFP_KERNEL);
if (bulk->bk_iovs[i].kiov_page == NULL) { if (bulk->bk_iovs[i].kiov_page == NULL) {
lstcon_rpc_put(*crpc); lstcon_rpc_put(*crpc);
......
...@@ -146,7 +146,7 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink) ...@@ -146,7 +146,7 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
int nob; int nob;
pg = alloc_pages_node(cfs_cpt_spread_node(lnet_cpt_table(), cpt), pg = alloc_pages_node(cfs_cpt_spread_node(lnet_cpt_table(), cpt),
GFP_IOFS, 0); GFP_KERNEL, 0);
if (pg == NULL) { if (pg == NULL) {
CERROR("Can't allocate page %d of %d\n", i, bulk_npg); CERROR("Can't allocate page %d of %d\n", i, bulk_npg);
srpc_free_bulk(bk); srpc_free_bulk(bk);
......
...@@ -319,7 +319,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a ...@@ -319,7 +319,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a
struct libcfs_ioctl_data *data; struct libcfs_ioctl_data *data;
int err = 0; int err = 0;
LIBCFS_ALLOC_GFP(buf, 1024, GFP_IOFS); LIBCFS_ALLOC_GFP(buf, 1024, GFP_KERNEL);
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -810,7 +810,7 @@ int cfs_trace_allocate_string_buffer(char **str, int nob) ...@@ -810,7 +810,7 @@ int cfs_trace_allocate_string_buffer(char **str, int nob)
if (nob > 2 * PAGE_CACHE_SIZE) /* string must be "sensible" */ if (nob > 2 * PAGE_CACHE_SIZE) /* string must be "sensible" */
return -EINVAL; return -EINVAL;
*str = kmalloc(nob, GFP_IOFS | __GFP_ZERO); *str = kmalloc(nob, GFP_KERNEL | __GFP_ZERO);
if (*str == NULL) if (*str == NULL)
return -ENOMEM; return -ENOMEM;
......
...@@ -82,7 +82,7 @@ static struct hlist_head *alloc_rmtperm_hash(void) ...@@ -82,7 +82,7 @@ static struct hlist_head *alloc_rmtperm_hash(void)
struct hlist_head *hash; struct hlist_head *hash;
int i; int i;
hash = kmem_cache_alloc(ll_rmtperm_hash_cachep, GFP_IOFS | __GFP_ZERO); hash = kmem_cache_alloc(ll_rmtperm_hash_cachep, GFP_NOFS | __GFP_ZERO);
if (!hash) if (!hash)
return NULL; return NULL;
......
...@@ -1112,7 +1112,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc, ...@@ -1112,7 +1112,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
LASSERT(cfg->cfg_instance != NULL); LASSERT(cfg->cfg_instance != NULL);
LASSERT(cfg->cfg_sb == cfg->cfg_instance); LASSERT(cfg->cfg_sb == cfg->cfg_instance);
inst = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS); inst = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
if (!inst) if (!inst)
return -ENOMEM; return -ENOMEM;
...@@ -1308,14 +1308,14 @@ static int mgc_process_recover_log(struct obd_device *obd, ...@@ -1308,14 +1308,14 @@ static int mgc_process_recover_log(struct obd_device *obd,
if (cfg->cfg_last_idx == 0) /* the first time */ if (cfg->cfg_last_idx == 0) /* the first time */
nrpages = CONFIG_READ_NRPAGES_INIT; nrpages = CONFIG_READ_NRPAGES_INIT;
pages = kcalloc(nrpages, sizeof(*pages), GFP_NOFS); pages = kcalloc(nrpages, sizeof(*pages), GFP_KERNEL);
if (pages == NULL) { if (pages == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
for (i = 0; i < nrpages; i++) { for (i = 0; i < nrpages; i++) {
pages[i] = alloc_page(GFP_IOFS); pages[i] = alloc_page(GFP_KERNEL);
if (pages[i] == NULL) { if (pages[i] == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
...@@ -1466,7 +1466,7 @@ static int mgc_process_cfg_log(struct obd_device *mgc, ...@@ -1466,7 +1466,7 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
if (cld->cld_cfg.cfg_sb) if (cld->cld_cfg.cfg_sb)
lsi = s2lsi(cld->cld_cfg.cfg_sb); lsi = s2lsi(cld->cld_cfg.cfg_sb);
env = kzalloc(sizeof(*env), GFP_NOFS); env = kzalloc(sizeof(*env), GFP_KERNEL);
if (!env) if (!env)
return -ENOMEM; return -ENOMEM;
......
...@@ -1562,7 +1562,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa, ...@@ -1562,7 +1562,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
(oa->o_valid & OBD_MD_FLFLAGS) != 0 && (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
(oa->o_flags & OBD_FL_DEBUG_CHECK) != 0); (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
gfp_mask = ((ostid_id(&oa->o_oi) & 2) == 0) ? GFP_IOFS : GFP_HIGHUSER; gfp_mask = ((ostid_id(&oa->o_oi) & 2) == 0) ? GFP_KERNEL : GFP_HIGHUSER;
LASSERT(rw == OBD_BRW_WRITE || rw == OBD_BRW_READ); LASSERT(rw == OBD_BRW_WRITE || rw == OBD_BRW_READ);
LASSERT(lsm != NULL); LASSERT(lsm != NULL);
......
...@@ -346,7 +346,7 @@ static struct osc_extent *osc_extent_alloc(struct osc_object *obj) ...@@ -346,7 +346,7 @@ static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
{ {
struct osc_extent *ext; struct osc_extent *ext;
ext = kmem_cache_alloc(osc_extent_kmem, GFP_IOFS | __GFP_ZERO); ext = kmem_cache_alloc(osc_extent_kmem, GFP_NOFS | __GFP_ZERO);
if (ext == NULL) if (ext == NULL)
return NULL; return NULL;
......
...@@ -134,7 +134,6 @@ struct vm_area_struct; ...@@ -134,7 +134,6 @@ struct vm_area_struct;
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
#define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM)
#define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE) #define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE)
#define GFP_IOFS (__GFP_IO | __GFP_FS | __GFP_KSWAPD_RECLAIM)
#define GFP_TRANSHUGE ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ #define GFP_TRANSHUGE ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) & \ __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) & \
~__GFP_KSWAPD_RECLAIM) ~__GFP_KSWAPD_RECLAIM)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册