Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3374400rdb; Thu, 16 Nov 2023 07:58:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmze7d5doq0OiOBbbyZYgq+EpK9Yn5cPe8AJryzBWeDR6DwHFN4M61zvE/jQSi4/LuKgIj X-Received: by 2002:a05:6a00:2906:b0:6c3:6ce2:46b0 with SMTP id cg6-20020a056a00290600b006c36ce246b0mr13841861pfb.16.1700150319449; Thu, 16 Nov 2023 07:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700150319; cv=none; d=google.com; s=arc-20160816; b=Wk6/ilfzntiC360dtdShbwHpPN2/w9FiMfdY1KpAJgdthJ0hwb84UYVpSv+k4X+mEe j7fKnMcluUXjzwu93nWhhEInHjBhWYMzQXGRHaA/A55mx2Aih09LCkxd94x5G8H2OUB6 KHfMCnzbY4j0sOH5WZhxdnYfkQW0pwFPgv9h0IMog87vV7vVcqcneastsbdQ+Bkr7+2U RFmtOD5K7DtUCSWhAENrarb+eqKng7LSiqA3FmimmjrJEJigNY9nsVQRtlb5js0mWD1U CfsfsyKBZjnt7qlWE+qM3XuU1H84krx7cLCBK5lV7e0dW7smPpb+d0IqwuF6xDCDhDsw dtMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=39/Cwpw9xqTQXNF+iJS/58pDXp6dfCst4nrixe5CkBs=; fh=IYkXq7sC717l7p0NOJ//qYzRj5IzkkfosR6IjS13wuw=; b=TelHWbPdxl2bXDZpCVQEpka23IwSpPB+3F1QwhW+o8j2a6zSJ5flejWfKzFQODjIoI e0syG3WRnYWb5GlD76Ky/vaKy0HncfNAKgXxn5ta55ypVyPn/aW4SmVItWLvA+BfZ2Mq LzqV09Xgmh32xhlGT8p+TfMMUlQgoLGTG71CImFWrRey5oXPtGrjCorkFxJhSPYkoeNZ oopmmKZ2aDSI6UeetD24hW7PyNDJUZBpYbZcTcjmEdKK97NDczjq8q93mD1flkykWqKn yRFEEbSribmq+fLBg+l62aE6Mc451WK6zL+iYztm6sXAzGYZfxqA4ObUoi6XnG71Htt8 o7pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GFvO8ncP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b7-20020a056a000cc700b0068fb95e5401si13277463pfv.65.2023.11.16.07.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GFvO8ncP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 942FC80F64A3; Thu, 16 Nov 2023 07:58:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345347AbjKPP62 (ORCPT + 99 others); Thu, 16 Nov 2023 10:58:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231284AbjKPP61 (ORCPT ); Thu, 16 Nov 2023 10:58:27 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C9BF181 for ; Thu, 16 Nov 2023 07:58:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 112C7C433C7; Thu, 16 Nov 2023 15:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700150303; bh=B68vNXPafDpm5CGgjZh28GWJpryYr4kJVI5IqZmIOAU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GFvO8ncPeCB+lYOze6sJv8uYgYrc9blZ3UiA0uep+7xQ2BwuoBD9W63q0cffxkm7Y e2IFtKODsXXF/nfRcpEPscQnmZcKaTjFooJla+oTpYGw+EjYxzwZiv+Mn5e4cMQjNk wROQl+4KJEt21jcR//JgHbxloe2hUv+qDnSJZdituWiSnqD53DlAdo8lwFqhanvK3L BHSC+PciRYHpIvXq0nmJYz/yvU43H+m/ggR/A6z1v8RZ0fWJeqEkNRhsuXFf0+Z08U zfjKHNribL13+mTts2dPjHah84UMvWeg/HlIol5LmaA6JewtFss3T4f7DTWrPz9QVG afP8J6PpE0s4w== Message-ID: Date: Thu, 16 Nov 2023 08:58:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 3/8] memory-provider: dmabuf devmem memory provider Content-Language: en-US To: Yunsheng Lin , Jason Gunthorpe , Mina Almasry Cc: Jakub Kicinski , davem@davemloft.net, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Willem de Bruijn , Kaiyuan Zhang , Jesper Dangaard Brouer , Ilias Apalodimas , Eric Dumazet , =?UTF-8?Q?Christian_K=C3=B6nig?= , Matthew Wilcox , Linux-MM References: <20231113130041.58124-1-linyunsheng@huawei.com> <20231113130041.58124-4-linyunsheng@huawei.com> <20231113180554.1d1c6b1a@kernel.org> <0c39bd57-5d67-3255-9da2-3f3194ee5a66@huawei.com> <15c404e4-8efa-cc1c-174f-0752005b6755@huawei.com> From: David Ahern In-Reply-To: <15c404e4-8efa-cc1c-174f-0752005b6755@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 07:58:36 -0800 (PST) On 11/16/23 4:12 AM, Yunsheng Lin wrote: > On 2023/11/16 1:57, David Ahern wrote: >> On 11/15/23 2:21 AM, Yunsheng Lin wrote: >>> On 2023/11/14 21:16, Jason Gunthorpe wrote: >>>> On Tue, Nov 14, 2023 at 04:21:26AM -0800, Mina Almasry wrote: >>>> >>>>> Actually because you put the 'strtuct page for devmem' in >>>>> skb->bv_frag, the net stack will grab the 'struct page' for devmem >>>>> using skb_frag_page() then call things like page_address(), kmap, >>>>> get_page, put_page, etc, etc, etc. >>>> >>>> Yikes, please no. If net has its own struct page look alike it has to >>>> stay entirely inside net. A non-mm owned struct page should not be >>>> passed into mm calls. It is just way too hacky to be seriously >>>> considered :( >>> >>> Yes, that is something this patchset is trying to do, defining its own >>> struct page look alike for page pool to support devmem. >>> >> >> Networking needs to be able to move away from struct page references. >> The devmem and host memory for Rx use cases do not need to be page based. > > Yes, I am agreed the ultimate goal is to move away from struct page > references. But I am not sure if we can do it right away as there > still are different types of existing 'struct page' in the netstack, > see: > > https://lore.kernel.org/all/8b7d25eb-1f10-3e37-8753-92b42da3fb34@huawei.com/ yes, that is the point of a blended approach -- pages and buffers (or iov) -- leveraging the LSB of the address. That proposal is the right direction to be moving for co-existence. Adding fake struct page instances is the wrong direction.