Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2474522rdb; Wed, 15 Nov 2023 01:33:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1KBx/m0DqMvqFyKVsvpPAiIqFyl/TgK9eb/ZbMfqrP/ICWSFjOFBwQDRytWFk9ak52hWl X-Received: by 2002:a05:6358:63a9:b0:16b:d079:df9b with SMTP id k41-20020a05635863a900b0016bd079df9bmr5245739rwh.12.1700040815560; Wed, 15 Nov 2023 01:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700040815; cv=none; d=google.com; s=arc-20160816; b=pmMy3IS33nt+6ILC2agtIP+hc/bq0g+CyjP+AR8n2jzVKdN6Ab54pcMoFGwtjrF53H 5gVzCeHmvNDIfk9dKz0bWakf4tLzLBih+C8tDRXJtalElWlCpOUee0dgg9Dk9jzPjT/C pKdkEM5lIALgewJ1wVqG8jlpLcTWgzg3tteiWnYeP55jln6m3VcVCQoeJ9wFdHoNc0dF xUDa2UQIXQ1HTCH7dczIsoEvRfWLnJ/KjENxsRVq7y7tRPh/G/V950gDp7/n/ZZzdFip XX5ofKHZvfiih076L0S60hCdHsxlXsMd+QV7dlX3ruYbggywwB4iC0tvJ2x4LMsXpxEP OQMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=VAk3gLOh2KyK8DlMm4i/izxvoyeMOgdTuS4CzJ+BT6M=; fh=f2UvAJceQSB+poRjds57UPqMGHC5fmPn5nDSRK++sHk=; b=Tkj00FdfdnfMNvLco8AD/Apq+m3JLyS1Q+opNhyKKm1fWlGoSpsAUPCXIbIHgqWjMP lJqdi55aSSQMgaJPDPk6ANBtSIJbTcMizko+BmMnfeQ5BhquGQ6ktLrBLAAbKo4PqwLJ Q3xPORUvsd6FgNi+KYi6pUzH3v/NWdqpJfNuvU1kp6ZDnXxlpZN9nrbWmkQ9sCx9EltP eFcy+ixXiymC4KDlgH4fD92WEy1TSLwHS/tqLw3IpreeOKWqRTgINK4QTqhTzSP3dmyB 43+Y/T7icJcHdp0yv9ZndcOFEpcZPxJ2wPr/48xnS5tTxp9wnQNbvP85dsVmJmypjYzU 85YA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u9-20020a632349000000b00584b6af3b9fsi9449662pgm.524.2023.11.15.01.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:33:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 735DF80218CA; Wed, 15 Nov 2023 01:33:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234797AbjKOJdV (ORCPT + 99 others); Wed, 15 Nov 2023 04:33:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234730AbjKOJdT (ORCPT ); Wed, 15 Nov 2023 04:33:19 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 279849B; Wed, 15 Nov 2023 01:33:16 -0800 (PST) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SVdHl2pfNzWh7S; Wed, 15 Nov 2023 17:32:51 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 15 Nov 2023 17:33:14 +0800 Subject: Re: [PATCH RFC 3/8] memory-provider: dmabuf devmem memory provider To: Jakub Kicinski CC: Mina Almasry , , , , , Willem de Bruijn , Kaiyuan Zhang , Jesper Dangaard Brouer , Ilias Apalodimas , Eric Dumazet , =?UTF-8?Q?Christian_K=c3=b6nig?= , Jason Gunthorpe , 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> <20231114172534.124f544c@kernel.org> From: Yunsheng Lin Message-ID: <56314b48-5273-6885-f3eb-5d60535faba0@huawei.com> Date: Wed, 15 Nov 2023 17:33:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20231114172534.124f544c@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 01:33:32 -0800 (PST) On 2023/11/15 6:25, Jakub Kicinski wrote: > On Tue, 14 Nov 2023 16:23:29 +0800 Yunsheng Lin wrote: >> I would expect net stack, page pool, driver still see the 'struct page', >> only memory provider see the specific struct for itself, for the above, >> devmem memory provider sees the 'struct page_pool_iov'. > > You can't lie to the driver that an _iov is a page either. Yes, agreed about that. As a matter of fact, the driver should be awared of what kind of memory provider is using when it calls page_pool_create() during init process. > The driver must explicitly "opt-in" to using the _iov variant, > by calling the _iov set of APIs. > > Only drivers which can support header-data split can reasonably > use the _iov API, for data pages. But those drivers can still allow allocating normal memory, right? sometimes for data and header part, and sometimes for the header part. Do those drivers need to support two sets of APIs? the one with _iov for devmem, and the one without _iov for normal memory. It seems somewhat unnecessary from driver' point of veiw to support two sets of APIs? The driver seems to know which type of page it is expecting when calling page_pool_alloc() with a specific page_pool instance. Or do we use the API with _iov to allocate both devmem and normal memory in the new driver supporting devmem page? If that is the case, does it really matter if the API is with _iov or not? > . >