Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4810543yba; Tue, 30 Apr 2019 04:53:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8xpfb4Z6ZJ2RvYFq2gMQiznsn42vtZguTTP8hZczoEJkiFNakTEAGiC278rSruuJ3AnDj X-Received: by 2002:a62:d205:: with SMTP id c5mr12409915pfg.219.1556625239616; Tue, 30 Apr 2019 04:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625239; cv=none; d=google.com; s=arc-20160816; b=r1TEZVH3bwLfi3S2VjeIIiz3FRFCQk0A2PusxUi2J2biztLdx8ua2p+VUTlFlnBGQ+ eZGJdCA1GqnaCzMR7/ckDdp6FC59OjMhPPOpZTWKfrEZ99nWF7WZUSgFSrqqj9M2uZcC Dn/DehmzU0GG44Hwbw7zA7MHX5xNsXL+51IqvjFbkszo10GRqni88kEa+hPEKYmwnU2m kq7BckJ+fnxr0e+Ew+uuFqovr1dlif5E1aegc3+skE3S6aTGjLUpUm3oMgCvyTSRiqpo 48A9FsKPRioegDphjhdQHZM961tz3hoJGZ061oMTk4xThqQs4J0beVgqzJsxRfwPj+ti wUuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GDhaXkVeaFxCxNBk3QX7TmhuT5JdSixhyzjOhwUHYNc=; b=gB5mBZStd/kATKM0Ib7BeuILJqArcxs35e5i5csB1xMlG0dhYS6Pq/8SuHZ95ceL2J SEzFlMEkR+XkPrYE5TCpxTnlFF0DZzW3vwfJ9iBq2pefox9RRAeO59BxFfxc/XMRQd8/ 2ByNrM0enpCs+cfahSn48kNUzcijEnwHqJLBtEuO2ZVvvwGollU+tAVy24LbQF6h4NXr 2XlqW8iC4U/hx83Lk7SKI39AB+erzx6HizyOKs++pd8uZTr9H9bbKOuFq1X+eWtHYKXl e9brD7ac2U7LRTYAY46HvUuSxQQ1aWkX+iI3NtWcHSSroDa9mkoIy7Y0SLegyHxNRSBa FGPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hmQDIa10; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13si8550664pgl.144.2019.04.30.04.53.44; Tue, 30 Apr 2019 04:53:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hmQDIa10; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731320AbfD3LvD (ORCPT + 99 others); Tue, 30 Apr 2019 07:51:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:38458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731313AbfD3LvC (ORCPT ); Tue, 30 Apr 2019 07:51:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D3AC521707; Tue, 30 Apr 2019 11:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556625061; bh=S+Iykvg4Xa0Snio24a4EY6114LsbjfA2HXGzUv8Pbh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmQDIa10BFjHFC77wCMOI946bzBsJJAWQW37lS8i7xvd0qPRo4XxnPXmcyNaPEMqd 25Qh80ifLPkyp6tEtSOZ7ZpPBasE/EiFEDvfOB3vKx5x5pjEBOdZXzKEm5bmxA8HS+ phm6aQJ9w88W063OeLEYK1SzWx/CKRfwhq5WYu+8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhu Yanjun , Santosh Shilimkar , "David S. Miller" Subject: [PATCH 5.0 76/89] net: rds: exchange of 8K and 1M pool Date: Tue, 30 Apr 2019 13:39:07 +0200 Message-Id: <20190430113613.324259262@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhu Yanjun [ Upstream commit 4b9fc7146249a6e0e3175d0acc033fdcd2bfcb17 ] Before the commit 490ea5967b0d ("RDS: IB: move FMR code to its own file"), when the dirty_count is greater than 9/10 of max_items of 8K pool, 1M pool is used, Vice versa. After the commit 490ea5967b0d ("RDS: IB: move FMR code to its own file"), the above is removed. When we make the following tests. Server: rds-stress -r 1.1.1.16 -D 1M Client: rds-stress -r 1.1.1.14 -s 1.1.1.16 -D 1M The following will appear. " connecting to 1.1.1.16:4000 negotiated options, tasks will start in 2 seconds Starting up..header from 1.1.1.166:4001 to id 4001 bogus .. tsks tx/s rx/s tx+rx K/s mbi K/s mbo K/s tx us/c rtt us cpu % 1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00 1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00 1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00 1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00 1 0 0 0.00 0.00 0.00 0.00 0.00 -1.00 ... " So this exchange between 8K and 1M pool is added back. Fixes: commit 490ea5967b0d ("RDS: IB: move FMR code to its own file") Signed-off-by: Zhu Yanjun Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/rds/ib_fmr.c | 11 +++++++++++ net/rds/ib_rdma.c | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) --- a/net/rds/ib_fmr.c +++ b/net/rds/ib_fmr.c @@ -44,6 +44,17 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struc else pool = rds_ibdev->mr_1m_pool; + if (atomic_read(&pool->dirty_count) >= pool->max_items / 10) + queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10); + + /* Switch pools if one of the pool is reaching upper limit */ + if (atomic_read(&pool->dirty_count) >= pool->max_items * 9 / 10) { + if (pool->pool_type == RDS_IB_MR_8K_POOL) + pool = rds_ibdev->mr_1m_pool; + else + pool = rds_ibdev->mr_8k_pool; + } + ibmr = rds_ib_try_reuse_ibmr(pool); if (ibmr) return ibmr; --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -454,9 +454,6 @@ struct rds_ib_mr *rds_ib_try_reuse_ibmr( struct rds_ib_mr *ibmr = NULL; int iter = 0; - if (atomic_read(&pool->dirty_count) >= pool->max_items_soft / 10) - queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10); - while (1) { ibmr = rds_ib_reuse_mr(pool); if (ibmr)