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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FBDBC433EF for ; Tue, 12 Oct 2021 07:50:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C8F4360D43 for ; Tue, 12 Oct 2021 07:50:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C8F4360D43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4257A6B006C; Tue, 12 Oct 2021 03:50:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D56D900002; Tue, 12 Oct 2021 03:50:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C4B06B0073; Tue, 12 Oct 2021 03:50:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 1F4596B006C for ; Tue, 12 Oct 2021 03:50:02 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A66CB1812871D for ; Tue, 12 Oct 2021 07:50:01 +0000 (UTC) X-FDA: 78687011802.22.D1409B3 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf11.hostedemail.com (Postfix) with ESMTP id 4B5C1F002B9E for ; Tue, 12 Oct 2021 07:50:01 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id a25so61718753edx.8 for ; Tue, 12 Oct 2021 00:50:01 -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=zjhSxsxPmDkUBZgqIoPJCNZSxFw5dwlvuXZheYtUcVg=; b=b2cCKTVjViEa00fDBlt1t+X+EnjEbzq3Y9qULPi0IFdRkhvDBXItqS4QyRXhWUHl3q +kO9GX5KnfKGMiHNhepZRGx4YXYfjsrj9og/StGshwDBxaxAqcRMkhMeCwuQDspinotB QmbT+wYgdIl+WdwiMXvE1b0QjUcxZRYyQR4090lYiA8cnCwIve4rYy9cKsnz7LIzpyy2 vjAUM6TOb1HYZWRY8qg/nhwuMiaXZKTEx7U25JRIkoYvqBxr33mWA+5tWlhTwqwB07eQ RMt8Ofme6aKYl3PKwDk/mrNKgVEH/XjBYTKYowXatH+16kIT3XD4gtEpCi4+pj+aqutl /CmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zjhSxsxPmDkUBZgqIoPJCNZSxFw5dwlvuXZheYtUcVg=; b=wQ8xXA0XsMwvoIHI7B7VRCPdto3Nf/fOLnXdZQOcclcQnWnNM6vpSmcowFiftUol2m dxMDcx02VcuWzdg5WEReeWgz5f69YLVpA08te8FgIeCFRa5woJpYDW1Y3oBvTAil5xhc BurnoCrJitnKceuMivkPupu6K/JkJExQZbI473oOGJlRo37NZKo81lJ6nBf2HerJeqef NQqtmu4oQDL5RMtTTVxsv5uiyS2Z0UfnehlFAqHC32eBhySgzlY8cUhfxzOKIiOSmjLJ eaFNrYAr12DyzhyV/M93+5UkCYnwW5pg0s+Pkl3+/BznNUT28Ch2nps8h3imkuSJijgO UGoQ== X-Gm-Message-State: AOAM532DELP4FzS3CFNXVif1nVdFzL4lMCIItIDENzHBY6W1po2eOEf6 Oa17QCVvegsoKrIBusvT8Q0qpA== X-Google-Smtp-Source: ABdhPJwEFW5rMXWCaGXRtspf+k4QIl8RCZntZQkLWKOktRpPjqvjyyL6uimYwSRvt4kCgM75IuJc2Q== X-Received: by 2002:a17:906:d145:: with SMTP id br5mr26348894ejb.250.1634024999730; Tue, 12 Oct 2021 00:49:59 -0700 (PDT) Received: from Iliass-MacBook-Pro.local ([62.74.11.155]) by smtp.gmail.com with ESMTPSA id m13sm5295878eda.41.2021.10.12.00.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 00:49:59 -0700 (PDT) Date: Tue, 12 Oct 2021 10:49:54 +0300 From: Ilias Apalodimas To: Yunsheng Lin Cc: Jesper Dangaard Brouer , John Hubbard , davem@davemloft.net, kuba@kernel.org, brouer@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@openeuler.org, akpm@linux-foundation.org, hawk@kernel.org, peterz@infradead.org, yuzhao@google.com, will@kernel.org, willy@infradead.org, jgg@ziepe.ca, mcroce@microsoft.com, willemb@google.com, cong.wang@bytedance.com, pabeni@redhat.com, haokexin@gmail.com, nogikh@google.com, elver@google.com, memxor@gmail.com, vvs@virtuozzo.com, linux-mm@kvack.org, edumazet@google.com, alexander.duyck@gmail.com, dsahern@gmail.com Subject: Re: [PATCH net-next -v5 3/4] mm: introduce __get_page() and __put_page() Message-ID: References: <20211009093724.10539-1-linyunsheng@huawei.com> <20211009093724.10539-4-linyunsheng@huawei.com> <62106771-7d2a-3897-c318-79578360a88a@nvidia.com> <89bcc42a-ad95-e729-0748-bf394bf770be@redhat.com> <3bba942e-eefd-7ac2-7a8c-b6c349641dd4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bba942e-eefd-7ac2-7a8c-b6c349641dd4@huawei.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4B5C1F002B9E X-Stat-Signature: c4cwrseiboxkhjbrq387eeckgm8fktbh Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=b2cCKTVj; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf11.hostedemail.com: domain of ilias.apalodimas@linaro.org designates 209.85.208.41 as permitted sender) smtp.mailfrom=ilias.apalodimas@linaro.org X-HE-Tag: 1634025001-67928 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: On Tue, Oct 12, 2021 at 03:38:15PM +0800, Yunsheng Lin wrote: > On 2021/10/11 20:29, Ilias Apalodimas wrote: > > On Mon, Oct 11, 2021 at 02:25:08PM +0200, Jesper Dangaard Brouer wrote: > >> > >> > >> On 09/10/2021 21.49, John Hubbard wrote: > >>> So in case it's not clear, I'd like to request that you drop this one > >>> patch from your series. > >> > >> In my opinion as page_pool maintainer, you should also drop patch 4/4 from > >> this series. > >> > >> I like the first two patches, and they should be resend and can be applied > >> without too much further discussion. > > > > +1 > > Ok, it seems there is a lot of contention about how to avoid calling > compound_head() now. > IMHO compound head is not that heavy. So you could keep the get/put page calls as-is and worry about micro optimizations later, especially since it's intersecting with folio changes atm. > Will send out the uncontroversial one first. > Thanks! > > That's what I hinted on the previous version. The patches right now go way > > beyond the spec of page pool. We are starting to change core networking > > functions and imho we need a lot more people involved in this discussion, > > than the ones participating already. > > > > As a general note and the reason I am so hesitant, is that we are starting > > to violate layers here (at least in my opinion). When the recycling was > > added, my main concern was to keep the network stack unaware (apart from > > the skb bit). Now suddenly we need to teach frag_ref/unref internal page > > Maybe the skb recycle bit is a clever way to avoid dealing with the network > stack directly. > > But that bit might also introduce or hide some problem, like the data race > as pointed out by Alexander, and the odd using of page pool in mlx5 driver. Yea. I was always wondering if unmaping the buffers and let the network stack deal with them eventually would be a good idea (on those special cases). There's an obvious disadvantage (which imho is terrible) in this approach. Any future functions that we add in the core networking code, will need to keep that in mindxi, and unmap some random driver memory if they start playing tricks with the skb and their fragments. IOW I think this is very fragile. > > > pool counters and that doesn't feel right. We first need to prove the race > > can actually happen, before starting to change things. > > As the network stack is adding a lot of performance improvement, such as > sockmap for BPF, which may cause problem for them, will dig more to prove > that. > Ok that's something we need to look at. Are those buffers freed eventually by skb_free_head() etc? Regards /Ilias