Whamcloud - gitweb
LU-4423 mem: remove GFP_IOFS 56/18956/4
authorMel Gorman <mgorman@techsingularity.net>
Fri, 1 Apr 2016 23:37:57 +0000 (19:37 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 4 May 2016 15:01:39 +0000 (15:01 +0000)
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.

Linux-commit : 40113370836e8e79befa585277296ed42781ef31

Change-Id: Ie17d225583f9b48ec2558a85bb6e4e9957010c14
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/18956
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
13 files changed:
libcfs/include/libcfs/linux/linux-mem.h
libcfs/libcfs/tracefile.c
lnet/lnet/router.c
lnet/selftest/conrpc.c
lnet/selftest/rpc.c
lustre/llite/remote_perm.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_nids.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/osc/osc_cache.c
lustre/osd-ldiskfs/osd_handler.c
lustre/target/tgt_main.c

index 4663f57..58d3c4f 100644 (file)
 # include <linux/mm_inline.h>
 #endif
 
-/* GFP_IOFS was added in 2.6.33 kernel */
-#ifndef GFP_IOFS
-#define GFP_IOFS       (__GFP_IO | __GFP_FS)
-#endif
-
 /*
  * Shrinker
  */
index 2baecb8..df3a8b9 100644 (file)
@@ -793,7 +793,7 @@ int cfs_trace_allocate_string_buffer(char **str, int nob)
        if (nob > 2 * PAGE_CACHE_SIZE)  /* string must be "sensible" */
                 return -EINVAL;
 
-       *str = kmalloc(nob, GFP_IOFS | __GFP_ZERO);
+       *str = kmalloc(nob, GFP_KERNEL | __GFP_ZERO);
         if (*str == NULL)
                 return -ENOMEM;
 
index 3c284e9..958729c 100644 (file)
@@ -1323,7 +1323,7 @@ lnet_new_rtrbuf(lnet_rtrbufpool_t *rbp, int cpt)
 
        for (i = 0; i < npages; i++) {
                page = cfs_page_cpt_alloc(lnet_cpt_table(), cpt,
-                                         __GFP_ZERO | GFP_IOFS);
+                                         GFP_KERNEL | __GFP_ZERO);
                 if (page == NULL) {
                         while (--i >= 0)
                                __free_page(rb->rb_kiov[i].kiov_page);
index 2207fa5..b00b80a 100644 (file)
@@ -858,7 +858,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
                        bulk->bk_iovs[i].kiov_offset = 0;
                        bulk->bk_iovs[i].kiov_len    = len;
                        bulk->bk_iovs[i].kiov_page   =
-                               alloc_page(GFP_IOFS);
+                               alloc_page(GFP_KERNEL);
 
                        if (bulk->bk_iovs[i].kiov_page == NULL) {
                                lstcon_rpc_put(*crpc);
index 8d81792..8e2cfbe 100644 (file)
@@ -144,7 +144,7 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
                struct page *pg;
                int         nob;
 
-               pg = cfs_page_cpt_alloc(lnet_cpt_table(), cpt, GFP_IOFS);
+               pg = cfs_page_cpt_alloc(lnet_cpt_table(), cpt, GFP_KERNEL);
                if (pg == NULL) {
                        CERROR("Can't allocate page %d of %d\n", i, bulk_npg);
                        srpc_free_bulk(bk);
index 01f0be8..c708b00 100644 (file)
@@ -90,7 +90,7 @@ static struct hlist_head *alloc_rmtperm_hash(void)
 
        OBD_SLAB_ALLOC_GFP(hash, ll_rmtperm_hash_cachep,
                           REMOTE_PERM_HASHSIZE * sizeof(*hash),
-                          GFP_IOFS);
+                          GFP_NOFS);
         if (!hash)
                 return NULL;
 
index 3c83dc0..0d1ea9f 100644 (file)
@@ -1587,7 +1587,7 @@ static int mgc_process_recover_log(struct obd_device *obd,
                 GOTO(out, rc = -ENOMEM);
 
         for (i = 0; i < nrpages; i++) {
-               pages[i] = alloc_page(GFP_IOFS);
+               pages[i] = alloc_page(GFP_KERNEL);
                 if (pages[i] == NULL)
                         GOTO(out, rc = -ENOMEM);
         }
index fa61f7f..4420b64 100644 (file)
@@ -146,7 +146,7 @@ static int mgs_nidtbl_read(struct obd_export *exp, struct mgs_nidtbl *tbl,
 
                        if (units_in_page == 0) {
                                /* allocate a new page */
-                               pages[index] = alloc_page(GFP_IOFS);
+                               pages[index] = alloc_page(GFP_KERNEL);
                                if (pages[index] == NULL) {
                                        rc = -ENOMEM;
                                        break;
index f5df05a..587d580 100644 (file)
@@ -277,7 +277,7 @@ static int echo_map_nb_to_lb(struct obdo *oa, struct obd_ioobj *obj,
                              struct niobuf_local *lb, int cmd, int *left)
 {
        gfp_t gfp_mask = (ostid_id(&obj->ioo_oid) & 1) ?
-                       GFP_HIGHUSER : GFP_IOFS;
+                       GFP_HIGHUSER : GFP_KERNEL;
        int ispersistent = ostid_id(&obj->ioo_oid) == ECHO_PERSISTENT_OBJID;
        int debug_setup = (!ispersistent &&
                           (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
@@ -648,7 +648,7 @@ int echo_persistent_pages_init(void)
 
        for (i = 0; i < ECHO_PERSISTENT_PAGES; i++) {
                gfp_t gfp_mask = (i < ECHO_PERSISTENT_PAGES/2) ?
-                       GFP_IOFS : GFP_HIGHUSER;
+                       GFP_KERNEL : GFP_HIGHUSER;
 
                pg = alloc_page(gfp_mask);
                if (pg == NULL) {
index 68e4318..c29bb65 100644 (file)
@@ -2332,7 +2332,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
                   (oa->o_valid & OBD_MD_FLFLAGS) != 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);
 
index 57e83e2..72a3350 100644 (file)
@@ -322,7 +322,7 @@ static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
 {
        struct osc_extent *ext;
 
-       OBD_SLAB_ALLOC_PTR_GFP(ext, osc_extent_kmem, GFP_IOFS);
+       OBD_SLAB_ALLOC_PTR_GFP(ext, osc_extent_kmem, GFP_NOFS);
        if (ext == NULL)
                return NULL;
 
index 316429b..af861fd 100644 (file)
@@ -6261,7 +6261,7 @@ static int osd_mount(const struct lu_env *env,
        if (opts != NULL && strstr(opts, "force_over_256tb") != NULL)
                force_over_256tb = 1;
 
-       __page = alloc_page(GFP_IOFS);
+       __page = alloc_page(GFP_KERNEL);
        if (__page == NULL)
                GOTO(out, rc = -ENOMEM);
        page = (unsigned long)page_address(__page);
index 391f295..b478b3d 100644 (file)
@@ -394,7 +394,7 @@ int tgt_mod_init(void)
 {
        ENTRY;
 
-       tgt_page_to_corrupt = alloc_page(GFP_IOFS);
+       tgt_page_to_corrupt = alloc_page(GFP_KERNEL);
 
        tgt_key_init_generic(&tgt_thread_key, NULL);
        lu_context_key_register_many(&tgt_thread_key, NULL);