Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ka-Cheong Poon and committed by
David S. Miller
f394ad28 fea49f60

+7 -7
+1 -1
net/rds/ib.h
··· 400 400 int rds_ib_recv_init(void); 401 401 void rds_ib_recv_exit(void); 402 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 404 void rds_ib_recv_free_caches(struct rds_ib_connection *ic); 405 405 void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp); 406 406 void rds_ib_inc_free(struct rds_incoming *inc);
+1 -1
net/rds/ib_cm.c
··· 1102 1102 if (!ic) 1103 1103 return -ENOMEM; 1104 1104 1105 - ret = rds_ib_recv_alloc_caches(ic); 1105 + ret = rds_ib_recv_alloc_caches(ic, gfp); 1106 1106 if (ret) { 1107 1107 kfree(ic); 1108 1108 return ret;
+5 -5
net/rds/ib_recv.c
··· 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 103 struct rds_ib_cache_head *head; 104 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 107 if (!cache->percpu) 108 108 return -ENOMEM; 109 109 ··· 118 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 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 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 128 if (ret) 129 129 free_percpu(ic->i_cache_incs.percpu); 130 130 }