diff options
author | Ka-Cheong Poon <ka-cheong.poon@oracle.com> | 2018-07-31 01:48:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-01 12:32:35 -0400 |
commit | f394ad28feffbeebab77c8bf9a203bd49b957c9a (patch) | |
tree | 1e85d5122dbbcb011ba917afaa162c4bd3a7aebe | |
parent | fea49f60c9b748abf4a1a9b2e9391d0c5b003848 (diff) |
rds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead
Currently, rds_ib_conn_alloc() calls rds_ib_recv_alloc_caches()
without passing along the gfp_t flag. But rds_ib_recv_alloc_caches()
and rds_ib_recv_alloc_cache() should take a gfp_t parameter so that
rds_ib_recv_alloc_cache() can call alloc_percpu_gfp() using the
correct flag instead of calling alloc_percpu().
Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/rds/ib.h | 2 | ||||
-rw-r--r-- | net/rds/ib_cm.c | 2 | ||||
-rw-r--r-- | net/rds/ib_recv.c | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/net/rds/ib.h b/net/rds/ib.h index beb95b893f78..73427ff439f9 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h | |||
@@ -400,7 +400,7 @@ void rds_ib_mr_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc); | |||
400 | int rds_ib_recv_init(void); | 400 | int rds_ib_recv_init(void); |
401 | void rds_ib_recv_exit(void); | 401 | void rds_ib_recv_exit(void); |
402 | int rds_ib_recv_path(struct rds_conn_path *conn); | 402 | int rds_ib_recv_path(struct rds_conn_path *conn); |
403 | int rds_ib_recv_alloc_caches(struct rds_ib_connection *ic); | 403 | int rds_ib_recv_alloc_caches(struct rds_ib_connection *ic, gfp_t gfp); |
404 | void rds_ib_recv_free_caches(struct rds_ib_connection *ic); | 404 | void rds_ib_recv_free_caches(struct rds_ib_connection *ic); |
405 | void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp); | 405 | void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp); |
406 | void rds_ib_inc_free(struct rds_incoming *inc); | 406 | void rds_ib_inc_free(struct rds_incoming *inc); |
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index a33b82dc0804..0d654d99fe41 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
@@ -1102,7 +1102,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp) | |||
1102 | if (!ic) | 1102 | if (!ic) |
1103 | return -ENOMEM; | 1103 | return -ENOMEM; |
1104 | 1104 | ||
1105 | ret = rds_ib_recv_alloc_caches(ic); | 1105 | ret = rds_ib_recv_alloc_caches(ic, gfp); |
1106 | if (ret) { | 1106 | if (ret) { |
1107 | kfree(ic); | 1107 | kfree(ic); |
1108 | return ret; | 1108 | return ret; |
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 557ccbb1ce00..d300186b8dc0 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c | |||
@@ -98,12 +98,12 @@ static void rds_ib_cache_xfer_to_ready(struct rds_ib_refill_cache *cache) | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | static int rds_ib_recv_alloc_cache(struct rds_ib_refill_cache *cache) | 101 | static int rds_ib_recv_alloc_cache(struct rds_ib_refill_cache *cache, gfp_t gfp) |
102 | { | 102 | { |
103 | struct rds_ib_cache_head *head; | 103 | struct rds_ib_cache_head *head; |
104 | int cpu; | 104 | int cpu; |
105 | 105 | ||
106 | cache->percpu = alloc_percpu(struct rds_ib_cache_head); | 106 | cache->percpu = alloc_percpu_gfp(struct rds_ib_cache_head, gfp); |
107 | if (!cache->percpu) | 107 | if (!cache->percpu) |
108 | return -ENOMEM; | 108 | return -ENOMEM; |
109 | 109 | ||
@@ -118,13 +118,13 @@ static int rds_ib_recv_alloc_cache(struct rds_ib_refill_cache *cache) | |||
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | int rds_ib_recv_alloc_caches(struct rds_ib_connection *ic) | 121 | int rds_ib_recv_alloc_caches(struct rds_ib_connection *ic, gfp_t gfp) |
122 | { | 122 | { |
123 | int ret; | 123 | int ret; |
124 | 124 | ||
125 | ret = rds_ib_recv_alloc_cache(&ic->i_cache_incs); | 125 | ret = rds_ib_recv_alloc_cache(&ic->i_cache_incs, gfp); |
126 | if (!ret) { | 126 | if (!ret) { |
127 | ret = rds_ib_recv_alloc_cache(&ic->i_cache_frags); | 127 | ret = rds_ib_recv_alloc_cache(&ic->i_cache_frags, gfp); |
128 | if (ret) | 128 | if (ret) |
129 | free_percpu(ic->i_cache_incs.percpu); | 129 | free_percpu(ic->i_cache_incs.percpu); |
130 | } | 130 | } |