From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41B50C433E0 for ; Sun, 31 Jan 2021 07:54:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A7D0B64E25 for ; Sun, 31 Jan 2021 07:54:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7D0B64E25 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 84FDB6B0005; Sun, 31 Jan 2021 02:54:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 800586B0006; Sun, 31 Jan 2021 02:54:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 715C26B006C; Sun, 31 Jan 2021 02:54:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id 5B7B06B0005 for ; Sun, 31 Jan 2021 02:54:36 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 17525181AEF1F for ; Sun, 31 Jan 2021 07:54:36 +0000 (UTC) X-FDA: 77765308152.08.floor36_62160c6275b7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id F3E271819E621 for ; Sun, 31 Jan 2021 07:54:35 +0000 (UTC) X-HE-Tag: floor36_62160c6275b7 X-Filterd-Recvd-Size: 4108 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Sun, 31 Jan 2021 07:54:35 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id o16so9862931pgg.5 for ; Sat, 30 Jan 2021 23:54:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kgKKLqQW2xwwboCbHSHJTnsaD6K/pF+foLG6aE5xNZI=; b=oDxn1at6cBgrCy+et5aUyF+io1XklVS/57elmEIaWxBM1/ibd5bKHiTn9mmLsiOLQX UMZ7lZVEACJhjhmM+01y4TQMeqMYsjTOL7FgY5WfwpdwZwvUUhnRN7t0DRVfXBFuBvcx O+QMbM6WrA3qtbuMszSP2LOVVVjF7sxv0XcyvRbW384Hxlw7mM2+7dtVleMpwAxL3V64 HfWPZDfg63jwjcUmmtjk6VBQGc1YJgQoC91eHChzczcqmgM6tT+uYOenP+oE6bULR6YH 52fWaiJqBNwEahiWccb6RZbV+iDQp1HGsBGcZ8KtNtqz8UBkUgc1Oo2Y7P8OVYD7jlGL GZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kgKKLqQW2xwwboCbHSHJTnsaD6K/pF+foLG6aE5xNZI=; b=GiKmkH7oiLLjZPtyRpd0XRCsN7cxQK57+hA+FLhOQsr87cXmT9veLetxOZ/MlOfckS N5QgDaJtK60AgpowGCJOA5up28SiT+PyF0T/SFakwmN2XvOy7XQJgJ2mQWNXmmH+nh+T ucZxMpGXOLxjQRM5nySNyWrbbBD7MW0BUSZSfCw1Mfhzs6T+e79mOIYzOp5nBbZJICBG l672bZPFlePHIsXTY8dA5bs6wSfK6GQ28EOr5OF3b0rUFGRYuH6XShK0Sl19kQPCnzDQ 6QDwtIMw9axEDOt81H5Bkn+LayDIh0J78B6H1+ULnPsIvRPrzT1Zc2pblg88rBOLoTZ+ 4EFw== X-Gm-Message-State: AOAM531wCpdO2T924Fgm/BMW7xkfWfpv1bp0njKBvBOOm8lXq/FSFDhN kzFziovqhjuwWJD0bPHZ8Xs= X-Google-Smtp-Source: ABdhPJwYDoHasKHUwogN7dtZKrVQKPFUWaRliX1zNTwlp5yslrIgooO/VbUgGjJJC7zm76ncO3r/uw== X-Received: by 2002:a63:700c:: with SMTP id l12mr11763069pgc.137.1612079674628; Sat, 30 Jan 2021 23:54:34 -0800 (PST) Received: from pek-lpggp6.wrs.com (unknown-105-123.windriver.com. [147.11.105.123]) by smtp.gmail.com with ESMTPSA id h23sm13931290pgh.64.2021.01.30.23.54.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Jan 2021 23:54:33 -0800 (PST) From: Kevin Hao To: "David S . Miller" , Jakub Kicinski , Andrew Morton Cc: netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH net-next v2 0/4] net: Avoid the memory waste in some Ethernet drivers Date: Sun, 31 Jan 2021 15:44:22 +0800 Message-Id: <20210131074426.44154-1-haokexin@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, v2: - Inline page_frag_alloc() and {netdev,napi}_alloc_frag() - Adopt Vlastimil's suggestion and add his Acked-by In the current implementation of napi_alloc_frag(), it doesn't have any align guarantee for the returned buffer address. We would have to use some ugly workarounds to make sure that we can get a align buffer address for some Ethernet drivers. This patch series tries to introduce some helper functions to make sure that an align buffer is returned. Then we can drop the ugly workarounds and avoid the unnecessary memory waste. Kevin Hao (4): mm: page_frag: Introduce page_frag_alloc_align() net: Introduce {netdev,napi}_alloc_frag_align() net: octeontx2: Use napi_alloc_frag_align() to avoid the memory waste net: dpaa2: Use napi_alloc_frag_align() to avoid the memory waste .../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 +-- .../marvell/octeontx2/nic/otx2_common.c | 3 +-- include/linux/gfp.h | 12 +++++++-- include/linux/skbuff.h | 22 ++++++++++++++-- mm/page_alloc.c | 8 +++--- net/core/skbuff.c | 25 +++++++------------ 6 files changed, 46 insertions(+), 27 deletions(-) --=20 2.29.2