From patchwork Thu Feb 11 16:20:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 8282441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A8C669F6E4 for ; Thu, 11 Feb 2016 16:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDFC6203B5 for ; Thu, 11 Feb 2016 16:22:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C566203B0 for ; Thu, 11 Feb 2016 16:22:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtya-0002Kl-9X; Thu, 11 Feb 2016 16:20:16 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtx6-0000hm-5n for linux-arm-kernel@bombadil.infradead.org; Thu, 11 Feb 2016 16:18:44 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1aTtx4-0004QL-J2 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2016 16:18:43 +0000 Received: by mail-pf0-x242.google.com with SMTP id 71so2734529pfv.1 for ; Thu, 11 Feb 2016 08:18:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4MIUVzV/jz+kEQfFPg7Vit4dqXDWMiCL5prZKUDGz80=; b=k4RIAIVPRFQPkg+LqBMKqi7+rcbXV3iIjlbGY/NANKNnf7LUogZ/NvLUI4Am7mfQGV AqX3NoYJjVpF9dmd74rJkG2NnvNn+WloOmIfshYDRtRzUdQT6sWVL+0QbZLH8f7KQqja HFBJ26EbGrV2UGR344TCbfOE25wSVPNt3BXRZDA8IEQNStYka8IR6XRrF0d5b4LW+Gwk maeOaFxSFAYns/IfYNJn7VvFBsdRcMFhyiRsFUhdNZf+wqn3nRnQNJNX9tS9rB3netZM Jnj0OkHtotn+Xt3vNk7viEL22AknHEdQSPhmV86zw9qzOFZNJGrldys8+IGkyuuyDNTR auXA== 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=4MIUVzV/jz+kEQfFPg7Vit4dqXDWMiCL5prZKUDGz80=; b=WujURw+FV/hxNxKdI5sZX00i0hxHKzezcPQL0gfgHd0cIo4853rjujzmX2jYjZ8tY/ 7TBbsWc4TJfeBqGtvOJGLyGA7URfn0FRfarcRv4+PKTi1DXHQRNi9Xvgge4Z+qQzflRj YeQz+Q9OVf/b9Uym2cNL5RsEB33uSjeQMR91uUzJWrk5rkG3oAGbMP94bXa54Qfrfr9x 6xQfqfOObok2OzpJXxfK+YACu+zg9I9JhtRlKQiKDUSQ4ZlyynI0hIWFKVFWtugKeC71 NSBJEuOdokP3t8Mp8RIMDCHak/UyFegSDocysdnJ0mEBvQWLrg8G8q7GcY7/GF2G4Buh TLPg== X-Gm-Message-State: AG10YORgD/3oxFWYQn+oU8vWOTeU9njzg7IypC8K4NNMiNfrd/eFWAyXnTgS41+6fQErrQ== X-Received: by 10.98.16.12 with SMTP id y12mr67980974pfi.6.1455207500375; Thu, 11 Feb 2016 08:18:20 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id s90sm13355894pfa.49.2016.02.11.08.18.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 08:18:19 -0800 (PST) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH v2 6/6] net: thunderx: Alloc higher order pages when pagesize is small Date: Thu, 11 Feb 2016 21:50:26 +0530 Message-Id: <1455207626-35488-7-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1455207626-35488-1-git-send-email-sunil.kovvuri@gmail.com> References: <1455207626-35488-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_111842_781001_84767FCE X-CRM114-Status: GOOD ( 13.50 ) X-Spam-Score: -1.4 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sgoutham@cavium.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robert.richter@caviumnetworks.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Sunil Goutham Allocate higher order pages when pagesize is small, this will reduce number of calls to page allocator and wastage of memory. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c index 50ab6f4..5adb208 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c @@ -78,7 +78,7 @@ static void nicvf_free_q_desc_mem(struct nicvf *nic, struct q_desc_mem *dmem) static inline int nicvf_alloc_rcv_buffer(struct nicvf *nic, gfp_t gfp, u32 buf_len, u64 **rbuf) { - int order = get_order(buf_len); + int order = (PAGE_SIZE <= 4096) ? PAGE_ALLOC_COSTLY_ORDER : 0; /* Check if request can be accomodated in previous allocated page */ if (nic->rb_page) {