Skip to content

Commit f394ad2

Browse files
kcp-gitdavem330
authored andcommitted
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 <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fea49f6 commit f394ad2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

net/rds/ib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ void rds_ib_mr_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc);
400400
int rds_ib_recv_init(void);
401401
void rds_ib_recv_exit(void);
402402
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);
404404
void rds_ib_recv_free_caches(struct rds_ib_connection *ic);
405405
void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp);
406406
void rds_ib_inc_free(struct rds_incoming *inc);

net/rds/ib_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
11021102
if (!ic)
11031103
return -ENOMEM;
11041104

1105-
ret = rds_ib_recv_alloc_caches(ic);
1105+
ret = rds_ib_recv_alloc_caches(ic, gfp);
11061106
if (ret) {
11071107
kfree(ic);
11081108
return ret;

net/rds/ib_recv.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ static void rds_ib_cache_xfer_to_ready(struct rds_ib_refill_cache *cache)
9898
}
9999
}
100100

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)
102102
{
103103
struct rds_ib_cache_head *head;
104104
int cpu;
105105

106-
cache->percpu = alloc_percpu(struct rds_ib_cache_head);
106+
cache->percpu = alloc_percpu_gfp(struct rds_ib_cache_head, gfp);
107107
if (!cache->percpu)
108108
return -ENOMEM;
109109

@@ -118,13 +118,13 @@ static int rds_ib_recv_alloc_cache(struct rds_ib_refill_cache *cache)
118118
return 0;
119119
}
120120

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)
122122
{
123123
int ret;
124124

125-
ret = rds_ib_recv_alloc_cache(&ic->i_cache_incs);
125+
ret = rds_ib_recv_alloc_cache(&ic->i_cache_incs, gfp);
126126
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);
128128
if (ret)
129129
free_percpu(ic->i_cache_incs.percpu);
130130
}

0 commit comments

Comments
 (0)