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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13EDCC3DA4A for ; Fri, 2 Aug 2024 10:06:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D9E56B0085; Fri, 2 Aug 2024 06:06:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6865F6B0088; Fri, 2 Aug 2024 06:06:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54FC96B0089; Fri, 2 Aug 2024 06:06:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 387D16B0085 for ; Fri, 2 Aug 2024 06:06:15 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F25E1161117 for ; Fri, 2 Aug 2024 10:06:14 +0000 (UTC) X-FDA: 82406875068.12.356AFED Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf11.hostedemail.com (Postfix) with ESMTP id 7E37F40026 for ; Fri, 2 Aug 2024 10:06:11 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722593166; a=rsa-sha256; cv=none; b=3zERnVVrMCPL0XNYo0OQmUs9imTMAZGUGY5VawgI5c0X+2eDx1YaUpYZhLsJQzrPBWFSsO EMCCkiva+73nJpi6TGQEz/4S5dHdS3MTi9KD9vkvWbu4Zl2Q54UX/astt7CG4QyijqxuSh wmrtZhBhwtGgxMQmcHV0vsFDe9zE2e0= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722593166; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o1VuG22BS9DaP4wx49W1xoCTDYwmTxC1L8+ARqes2ck=; b=HWE/lskCotVbU7qCSy3wbLjGBXQFPaNdW+wHvBUvaoRBnfhPEzlX+carZ73Bk5QOQ2O2xw DP+gSbOuUdhh0nHIOp49cgqI0g6qSaX3ofDErtzsi+GkTxmc6tAsGw+gPgTjZfJLBYVkvD d9YFbBKnvx/xF4p2dYq9yGp2lSkyZSQ= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Wb1ZM6Y7HzQnl8; Fri, 2 Aug 2024 18:01:31 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id 0F1351800A1; Fri, 2 Aug 2024 18:05:53 +0800 (CST) Received: from [10.67.120.129] (10.67.120.129) by dggpemf200006.china.huawei.com (7.185.36.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 2 Aug 2024 18:05:52 +0800 Message-ID: <877efebe-f316-4192-aada-dd2657b74125@huawei.com> Date: Fri, 2 Aug 2024 18:05:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API To: Alexander Duyck CC: , , , , , Subbaraya Sundeep , Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Eric Dumazet , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Geetha sowjanya , hariprasad , Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , "Michael S. Tsirkin" , Jason Wang , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , Andrew Morton , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , David Howells , Marc Dionne , Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , , , , , , , , , , References: <20240731124505.2903877-1-linyunsheng@huawei.com> <20240731124505.2903877-5-linyunsheng@huawei.com> <22fda86c-d688-42e7-99e8-e2f8fcf1a5ba@huawei.com> Content-Language: en-US From: Yunsheng Lin In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.120.129] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf200006.china.huawei.com (7.185.36.61) X-Rspam-User: X-Rspamd-Queue-Id: 7E37F40026 X-Rspamd-Server: rspam01 X-Stat-Signature: tgbj6dzyybr5qoaehpx879hequso619s X-HE-Tag: 1722593171-124235 X-HE-Meta: U2FsdGVkX1/M422NfFrTwgRXFX1evVy01c18Cv1B3UuMCNa81uxjpiewk/Mycps0Uo0/1DSJDadw65ywwA5XsyS2+7ckRv5TgFk6uUrvMfHGuz1928S95MVHCLOnS68NneKnL6jl4UGdVP9xIhwn5OiJ+hLaYp09niQsEYF3LF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VfmocCN24639bfvm3omKHK6UzHWGhYq+YQI9wXzJLlpK8gsLN/4zDDXETqf5e0UHpaMCnUmzD9GaOz5zIBI5y0Rc6uxZGoWdO60nlbjUTyDrBiZfnw8AuVIRnj2zbQci7+A+pT7LEvjUfcVnB7UjfkUB4aoHh8ioMopz8O2VukXrjXClTBn38Jyg2Ym9fmBDci9lcwoJiQdp0zzVD5RM/8KuTVp0K 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: List-Subscribe: List-Unsubscribe: On 2024/8/1 23:21, Alexander Duyck wrote: > On Thu, Aug 1, 2024 at 6:01 AM Yunsheng Lin wrote: >> >> On 2024/8/1 2:13, Alexander Duyck wrote: >>> On Wed, Jul 31, 2024 at 5:50 AM Yunsheng Lin wrote: >>>> >>>> Currently the page_frag API is returning 'virtual address' >>>> or 'va' when allocing and expecting 'virtual address' or >>>> 'va' as input when freeing. >>>> >>>> As we are about to support new use cases that the caller >>>> need to deal with 'struct page' or need to deal with both >>>> 'va' and 'struct page'. In order to differentiate the API >>>> handling between 'va' and 'struct page', add '_va' suffix >>>> to the corresponding API mirroring the page_pool_alloc_va() >>>> API of the page_pool. So that callers expecting to deal with >>>> va, page or both va and page may call page_frag_alloc_va*, >>>> page_frag_alloc_pg*, or page_frag_alloc* API accordingly. >>>> >>>> CC: Alexander Duyck >>>> Signed-off-by: Yunsheng Lin >>>> Reviewed-by: Subbaraya Sundeep >>> >>> I am naking this patch. It is a pointless rename that is just going to >>> obfuscate the git history for these callers. >> >> I responded to your above similar comment in v2, and then responded more >> detailedly in v11, both got not direct responding, it would be good to >> have more concrete feedback here instead of abstract argument. >> >> https://lore.kernel.org/all/74e7259a-c462-e3c1-73ac-8e3f49fb80b8@huawei.com/ >> https://lore.kernel.org/all/11187fe4-9419-4341-97b5-6dad7583b5b6@huawei.com/ > > I will make this much more understandable. This patch is one of the > ones that will permanently block this set in my opinion. As such I > will never ack this patch as I see no benefit to it. Arguing with me > on this is moot as you aren't going to change my mind, and I don't > have all day to argue back and forth with you on every single patch. Let's move on to more specific technical discussion then. > > As far as your API extension and naming maybe you should look like > something like bio_vec and borrow the naming from that since that is > essentially what you are passing back and forth is essentially that > instead of a page frag which is normally a virtual address. I thought about adding something like bio_vec before, but I am not sure what you have in mind is somthing like I considered before? Let's say that we reuse bio_vec like something below for the new APIs: struct bio_vec { struct page *bv_page; void *va; unsigned int bv_len; unsigned int bv_offset; }; It seems we have the below options for the new API: option 1, it seems like a better option from API naming point of view, but it needs to return a bio_vec pointer to the caller, it seems we need to have extra space for the pointer, I am not sure how we can avoid the memory waste for sk_page_frag() case in patch 12: struct bio_vec *page_frag_alloc_bio(struct page_frag_cache *nc, unsigned int fragsz, gfp_t gfp_mask); option 2, it need both the caller and callee to have a its own local space for 'struct bio_vec ', I am not sure if passing the content instead of the pointer of a struct through the function returning is the common pattern and if it has any performance impact yet: struct bio_vec page_frag_alloc_bio(struct page_frag_cache *nc, unsigned int fragsz, gfp_t gfp_mask); option 3, the caller passes the pointer of 'struct bio_vec ' to the callee, and page_frag_alloc_bio() fills in the data, I am not sure what is the point of indirect using 'struct bio_vec ' instead of passing 'va' & 'fragsz' & 'offset' through pointers directly: bool page_frag_alloc_bio(struct page_frag_cache *nc, unsigned int fragsz, gfp_t gfp_mask, struct bio_vec *bio); If one of the above option is something in your mind? Yes, please be more specific about which one is the prefer option, and why it is the prefer option than the one introduced in this patchset? If no, please be more specific what that is in your mind?