From patchwork Mon Feb 8 12:07:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 8249191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A456BEEE5 for ; Mon, 8 Feb 2016 12:09:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C229203B7 for ; Mon, 8 Feb 2016 12:09:40 +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 47D18202FF for ; Mon, 8 Feb 2016 12:09:39 +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 1aSkbt-0001Yx-CR; Mon, 08 Feb 2016 12:08:05 +0000 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSkZY-0007VK-Cp for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2016 12:05:44 +0000 Received: by mail-pa0-x244.google.com with SMTP id yy13so5630743pab.1 for ; Mon, 08 Feb 2016 04:05:19 -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=qxttyUtffRgnktqu6efOfX0rahBFVh7AVEoNUqIdH7JZUlNMtY9kg/stiWoxMxWMmj tHbWSeGIGc3SXT11dd/qTnklPwDIb2er2yksmWRPgP8QldLFeEw/JirErbuioY2/u6eK hfAizCTs4KxR503jG0pjFyID8Lei9LuQ3oXQ5yHbciAGhrb6ffxgK4wKjrds3zqiANoe c/6RleMwoYARI+Rok8OIwlDmBlb1VZVQCILVSWz1ZB1ejT0MXTG+bvTC7OwAipS+kTnF OmVTXe4K0tIORnSQpuJT91Ewd022rjyszx6RYR4pSc53+1IAhfTq0PbPFyrGO2W0+bhr 069Q== 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=MMLIuw3hZCV8tHy+IFKBN9F9Qz2rmgGBWt/49RDyExRK2cbVp1PYK1Pt2wR52SNWXb irHJ72zSReQKxCspDK1gI24OkpH2wnF2kWzPXfpVPwbaFO+P3X3Qt0m3XsOLQ9rYv9S4 M0AHWgEUU4/283FEdSwB4YNUufh6bN0kbzShWab7hdSh+3mmng7ZLJRg7ECfq+8m01NQ +yPeDH9p0eO63t815022Sk1DqbDYN1ccLJHy7NyqynBGTAiDXCumLhHoeu7ZF6YRMU27 aXzunzFJeQ9zu9wmPF1ZrbdwZhgg+43PgYZt668GTaC7Cf6RLp8ujWcoECJK5zXUFSVI Cy0w== X-Gm-Message-State: AG10YOTa3mh91aiVdvIxCx6J99OZSHNaN8DhQYOyxgjsnfjwHCeOZdcwAK5sIGApQDsNmQ== X-Received: by 10.66.187.145 with SMTP id fs17mr41911103pac.81.1454933118531; Mon, 08 Feb 2016 04:05:18 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id 17sm43082945pfq.51.2016.02.08.04.05.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 04:05:17 -0800 (PST) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH 6/6] net: thunderx: Alloc higher order pages when pagesize is small Date: Mon, 8 Feb 2016 17:37:52 +0530 Message-Id: <1454933272-45005-7-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1454933272-45005-1-git-send-email-sunil.kovvuri@gmail.com> References: <1454933272-45005-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160208_040540_994753_690A49BC X-CRM114-Status: GOOD ( 13.38 ) X-Spam-Score: -2.7 (--) 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=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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) {