From patchwork Wed Oct 23 06:53:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 3086231 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2CF3DBF924 for ; Wed, 23 Oct 2013 06:53:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C7F6202C1 for ; Wed, 23 Oct 2013 06:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81EAD202B8 for ; Wed, 23 Oct 2013 06:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751163Ab3JWGxo (ORCPT ); Wed, 23 Oct 2013 02:53:44 -0400 Received: from mail-ea0-f176.google.com ([209.85.215.176]:50629 "EHLO mail-ea0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751051Ab3JWGxo (ORCPT ); Wed, 23 Oct 2013 02:53:44 -0400 Received: by mail-ea0-f176.google.com with SMTP id q16so166511ead.7 for ; Tue, 22 Oct 2013 23:53:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uvRu02PHyrSV0vQK8vVXJ8wqFCmkJDmzPq0u4sEEPwA=; b=Zmj3AC6IFquzM0lGWnxhFu3k9IAw8Xq+A9z9nYr11m0Ge5H/mXgskAI40gcK1A7OF/ wATDzPnVaLY1U9WCoINg5NITJh0spDVS9rhvbxNqoj2UHHUr6i3+QOGLwdsQAx2TvctZ SjsdqNv1TJfo74VMbZWtFMgML96SXcCMBt+KxtYH5dDMGjXVmqSHuea6bpsJxc9FCemA 8WRuL4PAeCIKZ+tw+c3sAbcRkqzMHgsLSDcVNE3kroG4ZB/YjngNimfbk2/3Nq+utIxx Ue9mkPNkvcSNrMBOPFOsMbv3bIZ9CFE5Z/IKwc+vU3kve3O00biUXIrJWEhXUDVAQZ6B OeZw== X-Gm-Message-State: ALoCoQmf2vkngBeLTl0YPBApK2EntMPYZPY6m8siM24XSJA4lFGxYt1oX9p7CsrG4MZ0QXcL9zI8 X-Received: by 10.15.74.197 with SMTP id j45mr133004eey.40.1382511223303; Tue, 22 Oct 2013 23:53:43 -0700 (PDT) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id j7sm66182968eeo.15.2013.10.22.23.53.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 22 Oct 2013 23:53:42 -0700 (PDT) From: Eli Cohen To: roland@kernel.org Cc: linux-rdma@vger.kernel.org, amirv@mellanox.com, ogerlitz@mellanox.com, yevgenyp@mellanox.com, Moshe Lazer , Eli Cohen Subject: [PATCH for-next 9/9] mlx5_core: Change optimal_reclaimed_pages for better performance Date: Wed, 23 Oct 2013 09:53:21 +0300 Message-Id: <1382511201-7061-10-git-send-email-eli@mellanox.com> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1382511201-7061-1-git-send-email-eli@mellanox.com> References: <1382511201-7061-1-git-send-email-eli@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Moshe Lazer Change optimal_reclaimed_pages() to increase the output size of each reclaim pages command. This change reduces significantly the amount of reclaim pages commands issued to FW when the driver is unloaded which reduces the overall driver unload time. Signed-off-by: Moshe Lazer Signed-off-by: Eli Cohen --- drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index 013aa42..ba816c2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -454,14 +454,19 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot) return give_pages(dev, func_id, npages, 0); } +enum { + MLX5_BLKS_FOR_RECLAIM_PAGES = 12 +}; + static int optimal_reclaimed_pages(void) { struct mlx5_cmd_prot_block *block; struct mlx5_cmd_layout *lay; int ret; - ret = (sizeof(lay->in) + sizeof(block->data) - - sizeof(struct mlx5_manage_pages_outbox)) / 8; + ret = (sizeof(lay->out) + MLX5_BLKS_FOR_RECLAIM_PAGES * sizeof(block->data) - + sizeof(struct mlx5_manage_pages_outbox)) / + FIELD_SIZEOF(struct mlx5_manage_pages_outbox, pas[0]); return ret; }