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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 5E454C433B4 for ; Wed, 12 May 2021 09:50:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC5E7613C0 for ; Wed, 12 May 2021 09:50:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC5E7613C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3A1C36B0036; Wed, 12 May 2021 05:50:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3781D6B0070; Wed, 12 May 2021 05:50:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CB306B0071; Wed, 12 May 2021 05:50:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 01B1B6B0036 for ; Wed, 12 May 2021 05:50:30 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A471F3620 for ; Wed, 12 May 2021 09:50:30 +0000 (UTC) X-FDA: 78132109020.27.C360AC7 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf04.hostedemail.com (Postfix) with ESMTP id C5F683D9 for ; Wed, 12 May 2021 09:50:23 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id c22so26300921edn.7 for ; Wed, 12 May 2021 02:50:30 -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=1GGUsVMHLE+IZgAeaNUaXpWdQucmX1IJ1U87o5AWB8s=; b=dsXi6+0LX4t+9I7MTbwVdtOk7zzsArKhSuULaxCvj2iBGrnDe01i5L5qyCHksIqOuR F3x3O2sul75deZpTuwJvVwAzK/1QfZs86ltV4Owx4R91a2hQf5ySMECYMDxMyJOcnYCK E4Bz5qj6B2d8U4FkikUs12sVmL7ry4l8jNa7ZxLgs32nJW90DgsjE1yd7zVFFVuOU3uD cLNdUfVI1ZeWsVG5lngJwX8wDr4oJ6CzitK4be65XHK9dMrAwFE/IyPoFlsFbD9hcqEG k6TMbIA0GDSRitCYZ5rfQGxfqvGzfFE4n1DFMRP9o09pVMJiKWKQRFwIJKImH36cwFAA h4Cg== 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=1GGUsVMHLE+IZgAeaNUaXpWdQucmX1IJ1U87o5AWB8s=; b=Q3pvcjn+2t77Z4i6Qqtl6gA4L9xtNj7o+uhRh3PVys0YGOja8zuLKTsT+EBfYWkjnh lLV5II+Tvc5leQkw/5K3HqeWCC14477agmvwg96OoOePxzHV32kl/8/W9iNTqAp+/2dq hgXSA6rknXOy7xJNfHl//xs6682MWYe4C4507RrVdLpHgixB5r7zqVLazykD+ONcek/c aGyFRQe6zvK5VhPE+ku48Y+mPb0+KQozhb1IUWmNg6Aj5QE0BGs4JugCHWLtZadcnZXe +M66tr4bS/uuGFXDiQ0VMIqIPWkoF4h9g4G6RJAB+SBU82yD0HyUvxTKMt8hFOcJcIyr QrVQ== X-Gm-Message-State: AOAM531aZDDiYmU3VyXdjAxT4SSq4NCtEJ1q/M0YWOsRG2Cl1L+X6fvH inT0q9tkUD5s8b1+GflnRfAZ1A== X-Google-Smtp-Source: ABdhPJzmDSQCoBfSxpSFssN4vIeMUeoO4am9Wp3h0Kx3M7Nxh9kHKvhHuJYFuHxshsy6Fd+kEGp0lw== X-Received: by 2002:aa7:cd83:: with SMTP id x3mr41440462edv.373.1620813029119; Wed, 12 May 2021 02:50:29 -0700 (PDT) Received: from apalos.home ([94.69.77.156]) by smtp.gmail.com with ESMTPSA id lr15sm13734709ejb.107.2021.05.12.02.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 02:50:28 -0700 (PDT) Date: Wed, 12 May 2021 12:50:22 +0300 From: Ilias Apalodimas To: Eric Dumazet Cc: Matteo Croce , netdev@vger.kernel.org, linux-mm@kvack.org, 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 , Jonathan Lemon , Alexander Lobakin , Cong Wang , wenxu , Kevin Hao , Jakub Sitnicki , Marco Elver , Willem de Bruijn , Miaohe Lin , Yunsheng Lin , Guillaume Nault , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, Matthew Wilcox , Eric Dumazet , David Ahern , Lorenzo Bianconi , Saeed Mahameed , Andrew Lunn , Paolo Abeni , Sven Auhagen Subject: Re: [PATCH net-next v4 2/4] page_pool: Allow drivers to hint on SKB recycling Message-ID: References: <20210511133118.15012-1-mcroce@linux.microsoft.com> <20210511133118.15012-3-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=dsXi6+0L; spf=pass (imf04.hostedemail.com: domain of ilias.apalodimas@linaro.org designates 209.85.208.44 as permitted sender) smtp.mailfrom=ilias.apalodimas@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C5F683D9 X-Stat-Signature: ras7nj334jfm3tcga181po4rfgcnxber Received-SPF: none (linaro.org>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=mail-ed1-f44.google.com; client-ip=209.85.208.44 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620813023-121056 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: [...] > > Since we added an extra argument on __skb_frag_unref() to handle > > recycling, update the current users of the function with that. > > This part could be done with a preliminary patch, only adding this > extra boolean, this would keep the 'complex' patch smaller. Sure [...] > > #include > > #include > > @@ -645,6 +648,11 @@ static void skb_free_head(struct sk_buff *skb) > > { > > unsigned char *head = skb->head; > > > > +#if IS_BUILTIN(CONFIG_PAGE_POOL) > > Why IS_BUILTIN() ? No reason, we'll replace it with an ifdef > > PAGE_POOL is either y or n > > IS_ENABLED() would look better, since we use IS_BUILTIN() for the cases where a module might be used. > > Or simply #ifdef CONFIG_PAGE_POOL > > > + if (skb->pp_recycle && page_pool_return_skb_page(head)) > > This probably should be attempted only in the (skb->head_frag) case ? I think the extra check makes sense. > > Also this patch misses pskb_expand_head() I am not sure I am following. Misses what? pskb_expand_head() will either call skb_release_data() or skb_free_head(), which would either recycle or unmap the buffer for us (depending on the page refcnt) [...] Thanks /Ilias