Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp565259pxb; Sat, 10 Apr 2021 11:28:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvYS69Of1bODY2OGofJt+vzPqPCDXyLVO5inH3kHeJwW5QVuDzgi6B3erawYe3IVNObdaF X-Received: by 2002:a17:902:8306:b029:e6:125c:1a3a with SMTP id bd6-20020a1709028306b02900e6125c1a3amr18959958plb.65.1618079330602; Sat, 10 Apr 2021 11:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618079330; cv=none; d=google.com; s=arc-20160816; b=NXYcl9zTrUdwPYf3N33AcaM0I6Hri3as4shvHhzsn3KBxer7mQAP5hoqTEHKitTZYf +WcfB5i6oGuiGxNGaj7DQjw5yILtsW81LNdUln8Bx1kfg0H5cSkltO8JRaG0OYHT1tva KE9H8okEC+EX+505xqR+WMTS7ttUmsttxm5ZT3ldU63k+mDgm+uMs3BVsi6FBl6Bp3C3 QLwe+XbSXJi1P0zdb3Mnyo/Ul7N5OLcQgfZzUSpjFnR954cyW7bInowp5+ShhjcG16DJ O+sS3ltLRjcBfeWinGMRyPegB6OAmLYIa+MXhdsTNaNEsfBECU4ntqzk1fSIQn0QDUv2 AIjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kHhLeejRCafLd1b38lNlB9DRMFKc8tcaJUOcirv3Ooo=; b=jc6EZIcAjBpMOVKG1nZRXTzKjvNxEIr9+K1X9b4HxM0NqW1rRW31w9+J2dL4vp2fxe ScX+pvo+Un+xieUd3APWSNOHUOS9vpvDt82WlXp/JjFzRo3vNNhI6o9EyJ6gpHm8qwzq Yrt79zpRyWFKI143QVgfnMb8WiPLV487Mt4kqmqhhwVUBJpvreAsTWLrjK2fHyRgFBOi WzLNEqdAzFbb6nrguRbSz6kLjiS6Gt7Ni2BZ0UJ5QIa1fwjejRGyJlRRofjA6wMuEgLZ IEypd7CGi5J3BO5OE+sW29Tj9zqZZEs5lheAeMBW95yLVHOkUndXZWbIk3Rh3B9KJvO5 uJ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LirYQ65V; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si6641769pgl.404.2021.04.10.11.28.37; Sat, 10 Apr 2021 11:28:50 -0700 (PDT) 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=@linaro.org header.s=google header.b=LirYQ65V; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234768AbhDJS1z (ORCPT + 99 others); Sat, 10 Apr 2021 14:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234513AbhDJS1y (ORCPT ); Sat, 10 Apr 2021 14:27:54 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9DF5C06138B for ; Sat, 10 Apr 2021 11:27:38 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id w3so13664256ejc.4 for ; Sat, 10 Apr 2021 11:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kHhLeejRCafLd1b38lNlB9DRMFKc8tcaJUOcirv3Ooo=; b=LirYQ65VsI53h0KeKH0f834XSic/s38SLU/7BywMfLNrhws9tcg6zOhn8mpZDi4lQ7 Ui7ZUnQX1a9r5eS7sjBSbRZ2uYMoW5O7HqUUhcVkmhBh/aEIaa/0SV33BvMFmUSxX9Rl bqQdH0zS2mf1vuVqUqoFqkr66P8uBX3NSmzPwubXK5qTNduMc5b5qTTqYexwEfDYZE8b nzUCzqtPIHKFBS9mY9HlIuBjruNelDixyPOH5QQU5oIGfs5FwxjfCSxN4wtfzXXbmCUB bPeJr5P7ZkOuSi2xTfPJJwT2bXofjtHW320TWP9ER7ppnpxY6lpS6AfiIwSLGyj3jm+7 HhNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kHhLeejRCafLd1b38lNlB9DRMFKc8tcaJUOcirv3Ooo=; b=N5rtuSBCq4dQv8d8c52Zh1QkfWMcrRRiNi0DLxCJTKBYE6IwvZfPZPq3FWlp6SvIwK GaSL3Az6NfhJF1oaRy1FE49RBwlm5v2u+rFzu6LTlB7Zasyyo+QEN0m8V04eXpFuDYnK 7GhVvWKhVM/rHgqj/04jTPGV+02Nu7r5xVVuh/ad7VxQYMXmSM4KbdZ83iIofo9xMyEP 3zEgoqp5wyP3QKQlyAQuYnQgTxdMByQIwQKir5i7ad2ls7shxHZZ3JYnq/lF+DRGDzIo 6CoF73SiPMUeaT6egGksnXHJvyJoIbW5EAFKL8Ln9qLC/lJtpREXq3WiLUrPyAX30ftS TesA== X-Gm-Message-State: AOAM530f7FDmJ6xwFMplb/7kmTonhTBpLbdCHWH1U7nwV2Qew5P5lBxw CZONneJybTbQtwrgG6PNaqaEJQ== X-Received: by 2002:a17:906:4c91:: with SMTP id q17mr21299868eju.0.1618079257332; Sat, 10 Apr 2021 11:27:37 -0700 (PDT) Received: from enceladus (ppp-94-65-225-75.home.otenet.gr. [94.65.225.75]) by smtp.gmail.com with ESMTPSA id y6sm2926830ejw.83.2021.04.10.11.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 11:27:36 -0700 (PDT) Date: Sat, 10 Apr 2021 21:27:31 +0300 From: Ilias Apalodimas To: Shakeel Butt Cc: Matthew Wilcox , Matteo Croce , netdev , Linux MM , Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , "David S. Miller" , Jakub Kicinski , Thomas Petazzoni , Marcin Wojtas , Russell King , Mirko Lindner , Stephen Hemminger , Tariq Toukan , Jesper Dangaard Brouer , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Boris Pismenny , Arnd Bergmann , Andrew Morton , "Peter Zijlstra (Intel)" , Vlastimil Babka , Yu Zhao , Will Deacon , Michel Lespinasse , Fenghua Yu , Roman Gushchin , Hugh Dickins , Peter Xu , Jason Gunthorpe , Guoqing Jiang , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Aleksandr Nogikh , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , LKML , linux-rdma@vger.kernel.org, bpf , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni Subject: Re: [PATCH net-next v3 2/5] mm: add a signature in struct page Message-ID: References: <20210409223801.104657-1-mcroce@linux.microsoft.com> <20210409223801.104657-3-mcroce@linux.microsoft.com> <20210410154824.GZ2531743@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shakeel, On Sat, Apr 10, 2021 at 10:42:30AM -0700, Shakeel Butt wrote: > On Sat, Apr 10, 2021 at 9:16 AM Ilias Apalodimas > wrote: > > > > Hi Matthew > > > > On Sat, Apr 10, 2021 at 04:48:24PM +0100, Matthew Wilcox wrote: > > > On Sat, Apr 10, 2021 at 12:37:58AM +0200, Matteo Croce wrote: > > > > This is needed by the page_pool to avoid recycling a page not allocated > > > > via page_pool. > > > > > > Is the PageType mechanism more appropriate to your needs? It wouldn't > > > be if you use page->_mapcount (ie mapping it to userspace). > > > > Interesting! > > Please keep in mind this was written ~2018 and was stale on my branches for > > quite some time. So back then I did try to use PageType, but had not free > > bits. Looking at it again though, it's cleaned up. So yes I think this can > > be much much cleaner. Should we go and define a new PG_pagepool? > > > > > > Can this page_pool be used for TCP RX zerocopy? If yes then PageType > can not be used. Yes it can, since it's going to be used as your default allocator for payloads, which might end up on an SKB. So we have to keep the extra added field on struct page for our mark. Matthew had an intersting idea. He suggested keeping it, but changing the magic number, so it can't be a kernel address, but I'll let him follow up on the details. > > There is a recent discussion [1] on memcg accounting of TCP RX > zerocopy and I am wondering if this work can somehow help in that > regard. I will take a look at the series. > I'll try having a look on this as well. The idea behind the patchset is to allow lower speed NICs that use the API already, gain recycling 'easily'. Using page_pool for the driver comes with a penalty to begin with. Allocating pages instead of SKBs has a measurable difference. By enabling them to recycle they'll get better performance, since you skip the reallocation/remapping and only care for syncing the buffers correctly. > [1] https://lore.kernel.org/linux-mm/20210316013003.25271-1-arjunroy.kdev@gmail.com/