]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: IB: scale rds_ib_allocation based on fragment size
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Wed, 4 Nov 2015 21:42:39 +0000 (13:42 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 14 Apr 2016 00:58:18 +0000 (17:58 -0700)
The 'rds_ib_sysctl_max_recv_allocation' allocation is used to manage
and allocate the size of IB receive queue entry (RQE) for each IB
connection. However, it relies on the hardcoded RDS_FRAG_SIZE.

Lets make it scalable based on supported fragment sizes for different
IB connection. Each connection can allocate different RQE size
depending on the per connection fragment_size.

Orabug: 21894138
Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
net/rds/ib.h
net/rds/ib_recv.c

index 8f3c967262e7c72c870f0eb430149e58459e949e..e377bafc477c3a05429da6703b4feb43a27df14d 100644 (file)
@@ -216,6 +216,7 @@ struct rds_ib_connection {
        /* Protocol version specific information */
        unsigned int            i_flowctl:1;    /* enable/disable flow ctl */
        u16                     i_frag_sz;      /* IB fragment size */
+       int8_t                  i_frag_pages:1;
 
        /* Batched completions */
        unsigned int            i_unsignaled_wrs;
index f3425bf31c89823977dff98bfc8e3c9f9640a861..f3f634e88135e1cccf2c5d271747533be08f00c9 100644 (file)
@@ -295,8 +295,8 @@ static struct rds_page_frag *rds_ib_refill_one_frag(struct rds_ib_connection *ic
                        return NULL;
 
                avail_allocs = atomic_add_unless(&rds_ib_allocation,
-                               1, rds_ib_sysctl_max_recv_allocation);
-
+                                                ic->i_frag_pages,
+                                                rds_ib_sysctl_max_recv_allocation);
                if (!avail_allocs) {
                        if (test_and_clear_bit(0, &rds_ib_allocation_warn)) {
                                printk(KERN_NOTICE "RDS/IB: WARNING - "
@@ -313,7 +313,7 @@ static struct rds_page_frag *rds_ib_refill_one_frag(struct rds_ib_connection *ic
                                               ic->i_frag_sz, page_mask);
                if (ret) {
                        kmem_cache_free(rds_ib_frag_slab, frag);
-                       atomic_dec(&rds_ib_allocation);
+                       atomic_sub(ic->i_frag_pages, &rds_ib_allocation);
                        return NULL;
                }
                rds_ib_stats_inc(s_ib_rx_total_frags);