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 6FCF9C2BD09 for ; Tue, 9 Jul 2024 06:58:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 095AC6B0098; Tue, 9 Jul 2024 02:58:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0455F6B0099; Tue, 9 Jul 2024 02:58:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E767D6B009A; Tue, 9 Jul 2024 02:58:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C9B8D6B0098 for ; Tue, 9 Jul 2024 02:58:09 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 46D5F1A1722 for ; Tue, 9 Jul 2024 06:58:09 +0000 (UTC) X-FDA: 82319309898.12.81483B0 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf10.hostedemail.com (Postfix) with ESMTP id 20B60C000E for ; Tue, 9 Jul 2024 06:58:05 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720508273; 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=6LuxH/l/ho1C0m/xudcLoR7SslqJiuY1GpPdMupkvnA=; b=6Aj/GhTlgY/uh5a9PcPFlRQ4w7j16jF1N3WeWmV44xMxA7arlLE+J7NSW22QiYNge4Xor0 PQGW/l8+IE8jmiwB5zQU8SmXk5GyOcBpfzhFrXkvkh5BXxC+7m5xs2kFBe5KazmqEV5q1M 4VbKVq32rjoz/RoTAzxb6u48ToQ58WY= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720508273; a=rsa-sha256; cv=none; b=wjGa0X6zKe9AC1JxttiEAtSObsrkN64lkx16+G48HTAZGnQS8JgE+w/ecxYt6HPrMe/Y/0 scbuRR1mS5u5t1UVHXBN9PYrpjy0a56xmp1CT6HuFVQb4y+r7nNKA4Z2NJ449IXmO6lBQg tpujyKWhZC76nVTtYsWGXIFrTRNRsCY= Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WJBXH2YMszwWYR; Tue, 9 Jul 2024 14:53:19 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id 85476180064; Tue, 9 Jul 2024 14:58:00 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) 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; Tue, 9 Jul 2024 14:58:00 +0800 Subject: Re: [PATCH net-next v9 10/13] mm: page_frag: introduce prepare/probe/commit API To: Alexander Duyck CC: Yunsheng Lin , , , , , , Andrew Morton , References: <20240625135216.47007-1-linyunsheng@huawei.com> <20240625135216.47007-11-linyunsheng@huawei.com> <33c3c7fc00d2385e741dc6c9be0eade26c30bd12.camel@gmail.com> <38da183b-92ba-ce9d-5472-def199854563@huawei.com> <0a80e362-1eb7-40b0-b1b9-07ec5a6506ea@gmail.com> <15623dac-9358-4597-b3ee-3694a5956920@gmail.com> <200ee8ff-557f-e17b-e71f-645267a49831@huawei.com> <83cf5a36-055a-f590-9d41-59c45f93e7c5@huawei.com> From: Yunsheng Lin Message-ID: <2b7ecaca-9a17-e057-8897-d0684b31591d@huawei.com> Date: Tue, 9 Jul 2024 14:57:59 +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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.69.30.204] 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-Server: rspam01 X-Rspamd-Queue-Id: 20B60C000E X-Stat-Signature: yec7s5tn353iweo7epp9fx1tx7h7gh9e X-HE-Tag: 1720508285-954655 X-HE-Meta: U2FsdGVkX19BgmZEZBxzCwJBqMNcpfBPkjW4+JlEoZdPQX6I42JdaQRFx+VmGtPxV7lqfntMnSfHBKh1hGqLtYyHXqdcMFsO/kpSm/bQj5/ei4ZNC0i7OM02R/4OkcLXHz6DqLuC67j2qMmQWJkj4MIGaluLaYytRec8EQf1RQe7gK7ZPM84IMWxljHBamR8dW9fFflx3HU9Wqz1ls3wpXbYefVR2NJsmhtsChE2RunJ05DEm01liidf+M3MoK4mgLvwXr6hAg0RHwcKU5YsZcL3TbWQEp7Q4ut84ryuIjdNWFaYB14hYA1w2ALtQGCd4nq0rq/xXRqwqueRQnFDbVPuQP2djRRmqWMlupRDBPVjLyKsWkzFQzpPedkfuS3qPhj4rmBptrpnkQIMmMMj98nIpsr8WKqmlmFSAmalfdSl/BuvYg9vLZLlB57Bokxgm9WMa9WTCO2dDO5tbAMvaAfeIyjKN9FnQPPWdeIcub9rlDjs9yiQN9GhFl9NS/GDr0GTHFLtIZoLWzr4BzG342E+ILb1cRaA13LW7O6zX6Q88W6xUZhjUnUWdAqFavJ5yO6E97y8S2/PCb2dhuEg5D9MIGCM/2mq9qBMJbatd+VVIGreZjSEsWs9kWssnmLUdAQN5frbS+sQprqK4ps11e5gO6KwbKU4vnhN5nXqZKj9r74iY8ZB5S9DM1rXG4y5inbYyef3qYFOjnBoFIA/bHAlxAn586QgubOOc2RI0goDaWcj/hMCu6181V+P5TVGieMRq0LWh+hFQCfX/Pv2sC/awP0IJILZcJednnlMDHFKNmhT2xfo8Nn2RR+hYLG3bE6nOoqKA5KFb8J7lrnQfQSN+Ewaa+CmH0l8y2HIhQTA0wcd0hbl8xbWjCslegGWbpOC2y8+ckgtcqXA0DXpM7mKka+yg+iSXcAJfq/Z2U84L6HTW/t9VxqzBjEN9lDHsW6o5aWjUYa0qO1W/Bx OJ3MoxuW IcJukSX4VH8gb+H5FQk/mIFYYfPQsqWpKjbPxTGZpwftcYSNu4MNcCZvy4NqMKJbDOYEAVjSzvcmgeCrDbhAUVvxB2QjS5wmTOsTwaGs7t6iVzVrrxB4gQ55sdh47eJGvmlIUEr0C5anQoxcPR5T72tLcJB4sBtHu/ruIisxbXkvSKwcJxovqliSnZxNRQ5yvyk2cJn2hBi5Dii1/j+LyMgev80DGu8npL/YLlu2IQVj1m11bvBqXCulEVp6WkdfbLbplpdEUyi8DHqeV67I85NwriBoQ36bmF9p8rGt6KLsemiUPJIOupoMOX5ArgmEENDIodcKtuW8t3CJDdKvBnzqehexiOrPgfrLQ8OslkL/F2NA= 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/7/8 22:30, Alexander Duyck wrote: > On Mon, Jul 8, 2024 at 3:58 AM Yunsheng Lin wrote: >> >> On 2024/7/8 1:12, Alexander Duyck wrote: >> >> ... >> >>> The issue is the dependency mess that has been created with patch 11 >>> in the set. Again you are conflating patches which makes this really >>> hard to debug or discuss as I make suggestions on one patch and you >>> claim it breaks things that are really due to issues in another patch. >>> So the issue is you included this header into include/linux/sched.h >>> which is included in linux/mm_types.h. So what happens then is that >>> you have to include page_frag_cache.h *before* you can include the >>> bits from mm_types.h >>> >>> What might make more sense to solve this is to look at just moving the >>> page_frag_cache into mm_types_task.h and then having it replace the >>> page_frag struct there since mm_types.h will pull that in anyway. That >>> way sched.h can avoid having to pull in page_frag_cache.h. >> >> It seems the above didn't work either, as asm-offsets.c does depend on >> mm_types_task.h too. >> >> In file included from ./include/linux/mm.h:16, >> from ./include/linux/page_frag_cache.h:10, >> from ./include/linux/mm_types_task.h:11, >> from ./include/linux/mm_types.h:5, >> from ./include/linux/mmzone.h:22, >> from ./include/linux/gfp.h:7, >> from ./include/linux/slab.h:16, >> from ./include/linux/resource_ext.h:11, >> from ./include/linux/acpi.h:13, >> from ./include/acpi/apei.h:9, >> from ./include/acpi/ghes.h:5, >> from ./include/linux/arm_sdei.h:8, >> from arch/arm64/kernel/asm-offsets.c:10: >> ./include/linux/mmap_lock.h: In function ‘mmap_assert_locked’: >> ./include/linux/mmap_lock.h:65:23: error: invalid use of undefined type ‘const struct mm_struct’ >> 65 | rwsem_assert_held(&mm->mmap_lock); > > Do not include page_frag_cache.h in mm_types_task.h. Just move the > struct page_frag_cache there to replace struct page_frag. The above does seem a clever idea, but doesn't doing above also seem to defeat some purpose of patch 1? Anyway, it seems workable for trying to avoid adding a new header for a single struct. About the 'replace' part, as mentioned in [1], the 'struct page_frag' is still needed as this patchset is large enough that replacing is only done for sk_page_frag(), there are still other places using page_frag that can be replaced by page_frag_cache in the following patchset. 1. https://lore.kernel.org/all/b200a609-2f30-ec37-39b6-f37ed8092f41@huawei.com/ > . >