Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171100
b: refs/heads/master
c: 86357b1
h: refs/heads/master
v: v3
  • Loading branch information
Andy Grover authored and David S. Miller committed Oct 30, 2009
1 parent 2db0d9a commit fcd1491
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 244546f0d3101c5441f5b14cfe8a79d62679eaea
refs/heads/master: 86357b19bcabd9355937f3fb84f90ba9fe76a5d3
7 changes: 4 additions & 3 deletions trunk/net/rds/ib_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ static int rds_ib_recv_refill_one(struct rds_connection *conn,
int ret = -ENOMEM;

if (recv->r_ibinc == NULL) {
if (atomic_read(&rds_ib_allocation) >= rds_ib_sysctl_max_recv_allocation) {
if (!atomic_add_unless(&rds_ib_allocation, 1, rds_ib_sysctl_max_recv_allocation)) {
rds_ib_stats_inc(s_ib_rx_alloc_limit);
goto out;
}
recv->r_ibinc = kmem_cache_alloc(rds_ib_incoming_slab,
kptr_gfp);
if (recv->r_ibinc == NULL)
if (recv->r_ibinc == NULL) {
atomic_dec(&rds_ib_allocation);
goto out;
atomic_inc(&rds_ib_allocation);
}
INIT_LIST_HEAD(&recv->r_ibinc->ii_frags);
rds_inc_init(&recv->r_ibinc->ii_inc, conn, conn->c_faddr);
}
Expand Down
7 changes: 4 additions & 3 deletions trunk/net/rds/iw_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ static int rds_iw_recv_refill_one(struct rds_connection *conn,
int ret = -ENOMEM;

if (recv->r_iwinc == NULL) {
if (atomic_read(&rds_iw_allocation) >= rds_iw_sysctl_max_recv_allocation) {
if (!atomic_add_unless(&rds_iw_allocation, 1, rds_iw_sysctl_max_recv_allocation)) {
rds_iw_stats_inc(s_iw_rx_alloc_limit);
goto out;
}
recv->r_iwinc = kmem_cache_alloc(rds_iw_incoming_slab,
kptr_gfp);
if (recv->r_iwinc == NULL)
if (recv->r_iwinc == NULL) {
atomic_dec(&rds_iw_allocation);
goto out;
atomic_inc(&rds_iw_allocation);
}
INIT_LIST_HEAD(&recv->r_iwinc->ii_frags);
rds_inc_init(&recv->r_iwinc->ii_inc, conn, conn->c_faddr);
}
Expand Down

0 comments on commit fcd1491

Please sign in to comment.