Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp10159pxb; Fri, 15 Jan 2021 06:33:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzphV5Z2BeO+Fz1DxihgVxxXcvrHRRC4WnqQZsoVFysXrsntfGBaH6dNyrolVyWDrgzrDfP X-Received: by 2002:a17:907:10c8:: with SMTP id rv8mr8779948ejb.228.1610721186766; Fri, 15 Jan 2021 06:33:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610721186; cv=none; d=google.com; s=arc-20160816; b=XNuLVY301a+cQAGVTOoeafdgZGVIF64fl8dOpsd+ioowv3AZ6BjTdaoWPsJDT8rVb8 60hae5WNcx9+87WYZxMXRW/fxgJUx3Z8lV+QLgrZDSwqewQKtXVZjhxb1Ju7Sgbz59Pi uo+3I+w/Ay0dNbWG22sqjknHDvjrW08jYDqtw9sNaMUIHV0wbbwuDpjh8TNSdhJ9CMLL uBHpDOBjeShdoCbaQRLb5Bh+m2NE/VgcGvYuuuQxT0SWt0pcfqzZtt5U01cf4jlvCE2q on/AwiiQjZQ1y2wrbpOgvjUS4KYbAE0oTvMqK1gw1/1JHILIionPfYKUIbkJQY7ePJKl FCGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4t2xImQTSoylap6FV9VzZoFi72SaBY2B00ks1m41fxg=; b=s9m+FbDoW8nTrZAqKT12nEOet5VWRlKOoZ7neTUeCIBTc836yu/Jm8x6vhSTVUAKCz l5PZCc0bcufGz4Kn8o0VJ05SfeXl8NgbSXdpK3QjzT6Ac8GcvgDBFfkZy5fN/OkKSt+w fmLRu90oPT79N4oKXMK91C+BUrVICr917VWYzk8brFYPStAFNDWWQelRqDZuhAbdzuyq NzdZtnCRX+8/P6j0YDkkbM9m94aRuYhAxFvSIyS3+0NT5nejoX/iJH6lB1wDlBm1yiAI aKUM+N7crd3qxHdFlQiPEExskEvErhclgOJixx+R0pJ/RmIJkUtzK2GeUhvVF6v/0dIB Ma5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=idUMpCyX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si3735670edl.459.2021.01.15.06.32.41; Fri, 15 Jan 2021 06:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=idUMpCyX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729552AbhAOO3a (ORCPT + 99 others); Fri, 15 Jan 2021 09:29:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbhAOO33 (ORCPT ); Fri, 15 Jan 2021 09:29:29 -0500 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 677F2C0613C1 for ; Fri, 15 Jan 2021 06:28:49 -0800 (PST) Received: by mail-io1-xd2b.google.com with SMTP id d9so18431242iob.6 for ; Fri, 15 Jan 2021 06:28:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4t2xImQTSoylap6FV9VzZoFi72SaBY2B00ks1m41fxg=; b=idUMpCyXLWpO0p8HDuV7CX0Fhq6jcqAFRLDOvLwVY1i0IGlB4vyV71YT9g4DERSqsy zoKh5hQZCZw+r/j9onHTt3dXbJoYlUI+65YZeO2wPHuXZxQcOox/abJcTVPvH7mfZ8Nh 4wDryXOSbtj72k7ZFwluMyaRspH91MatZ3vZO8gVhYfDnjjYwKIKE1CGp0vyouHQlLOB FmpvI6oetzpu4uOj15nInUBlIUYT/wsAOGzeDjB8zsCGzLX4FyuapwCbD2ty7PjxvaA+ 7aC+8s54FUzOVp+Q4B5gNmfuv7ZNvkfYIZckoU74tC6m/nWZVf4DQK+qkPhVE1fal/UN fyPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4t2xImQTSoylap6FV9VzZoFi72SaBY2B00ks1m41fxg=; b=qwQylGUOwRDC3C8qhfoa3r9sdUXTul9KfjQ9kDoYAJUp/NgQoTi+sb0/UlcDYtfXCo OjFW4EVmsDtdeVjCGLHMzatn8UFvEimPcz22vn0FXlVUI/g0sE1bkvuz/3OgJa+t+UrZ LVkwbnBUfvRDHCTuJYteuCY8kMRPrvWyzxklqZBSFEQmmVPrQd+YX+pEVO+N5I3mZIov ainPnV9l9Vu6S6NZkNqxaCA6LatdB7c/nlRGhHMNja+Oq5DahtrrNw7S4yLm3ULlloS/ NvQlonJjTzereWgYR4XM4bMHzkJElqiiZnxch2ehIoJpnQba8LVfWCcTN4dzWTpBp4MC /B2A== X-Gm-Message-State: AOAM530rbtPh1szV7Hb4jdBAe3ZSPWisqn6VeM46hk7gL7bRJcMUgFRe rM45uws9bD/of5Ll63ZQk+bKQ9tBr9nk2dWRx2AncA== X-Received: by 2002:a02:68a:: with SMTP id 132mr10703746jav.53.1610720928490; Fri, 15 Jan 2021 06:28:48 -0800 (PST) MIME-Version: 1.0 References: <20210114235423.232737-1-alobakin@pm.me> In-Reply-To: <20210114235423.232737-1-alobakin@pm.me> From: Eric Dumazet Date: Fri, 15 Jan 2021 15:28:37 +0100 Message-ID: Subject: Re: [PATCH net] skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Willem de Bruijn , Miaohe Lin , Guillaume Nault , Yunsheng Lin , Florian Westphal , Steffen Klassert , Dongseok Yi , Yadu Kishore , Al Viro , Marco Elver , Alexander Duyck , "Michael S. Tsirkin" , netdev , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 12:55 AM Alexander Lobakin wrote: > > Commit 3226b158e67c ("net: avoid 32 x truesize under-estimation for > tiny skbs") ensured that skbs with data size lower than 1025 bytes > will be kmalloc'ed to avoid excessive page cache fragmentation and > memory consumption. > However, the same issue can still be achieved manually via > __netdev_alloc_skb(), where the check for size hasn't been changed. > Mirror the condition from __napi_alloc_skb() to prevent from that. > > Fixes: 3226b158e67c ("net: avoid 32 x truesize under-estimation for tiny skbs") No, this tag is wrong, if you fix a bug, bug is much older than linux-5.11 My fix was about GRO head and virtio_net heads, both using pre-sized small buffers. You want to fix something else, and this is fine, because some drivers are unfortunately doing copy break ( at the cost of additional copy, even for packets that might be consumed right away)