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 301AFC36010 for ; Fri, 4 Apr 2025 09:39:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC3936B0006; Fri, 4 Apr 2025 05:39:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C719E6B0007; Fri, 4 Apr 2025 05:39:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3A7D6B0008; Fri, 4 Apr 2025 05:39:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9619F6B0006 for ; Fri, 4 Apr 2025 05:39:24 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F2DB8589E0 for ; Fri, 4 Apr 2025 09:39:24 +0000 (UTC) X-FDA: 83295863448.07.5DE29A8 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) by imf22.hostedemail.com (Postfix) with ESMTP id 2404FC0004 for ; Fri, 4 Apr 2025 09:39:22 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Fmnwubo2; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of muchun.song@linux.dev designates 91.218.175.172 as permitted sender) smtp.mailfrom=muchun.song@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743759563; 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:dkim-signature; bh=HvCbJgJnFGne+TAMBgY6cQ6iJ4WbAlnhHeP54hSBG3U=; b=ihwY0goba0onIBcSJwZU8WViBrEc4tRi0jhE4aC6LxsHL23rZCAQRMdRM6yRXCoPabD6bc dSFrVGnBrnxnAwOZZBw9dDEnkFucr6K3dZz+EAPhxfBC8dgcuwH40nwY42l8ik6DiZIB7G U78z+aWrgG2JRtrCi3BQz6ULtLSCfhM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Fmnwubo2; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of muchun.song@linux.dev designates 91.218.175.172 as permitted sender) smtp.mailfrom=muchun.song@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743759563; a=rsa-sha256; cv=none; b=ZouKUg0t2mspKm39JTujYANgo/W7dAYUszV7MmCMMFBD/SCDU7LIErw69msCE7/4+HS6yd sVbmblqMrVa2zCkODdB9/O0la6cKPF1iOfJ4HOs71KItmB8PQjzpbIOT94UGUHT0tuDRpd s1TGTprOl576zWdX7mvdnVrIIWEhptY= Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1743759557; h=from:from: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=HvCbJgJnFGne+TAMBgY6cQ6iJ4WbAlnhHeP54hSBG3U=; b=Fmnwubo2TjnwNa23ZsXq1DE1aQDCxDMZQTSrFaDHVwxBUA4J7T93QPMm4Mpo25S6FDBWbe hXnzoy6iMBRZc/lE9/ZTBBkQdIyDbrfWZG45bfRlKvTTSNLK55OyHl+b9lko2taHXfZnfn MDBdQ6PxRyGu3r5IhprHpajQ+cgmImM= Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is broken, was Re: [RFC PATCH 0/6] Deep talk about folio vmap X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20250404090111.GB11105@lst.de> Date: Fri, 4 Apr 2025 17:38:35 +0800 Cc: Huan Yang , bingbu.cao@linux.intel.com, Matthew Wilcox , Gerd Hoffmann , Vivek Kasireddy , Sumit Semwal , =?utf-8?Q?Christian_K=C3=B6nig?= , Andrew Morton , Uladzislau Rezki , Shuah Khan , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, opensource.kernel@vivo.com Content-Transfer-Encoding: quoted-printable Message-Id: <9A899641-BDED-4773-B349-56AF1DD58B21@linux.dev> References: <20250327092922.536-1-link@vivo.com> <20250404090111.GB11105@lst.de> To: Christoph Hellwig X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 2404FC0004 X-Stat-Signature: nq4wp1tb5rexybb3ssytsb31abubhcn7 X-Rspam-User: X-HE-Tag: 1743759562-37451 X-HE-Meta: U2FsdGVkX18q3+ONAxbpCjrMh0+LzyiBiqg9dbZ/1th5NZ184kBm5qx1769Gl1oe2BMW73lZtrkfbRMH3w4ff6b12hJvo/lQMqqDhtvRSs+VmNhqM5R+ftdxElw11b5ZhmlBS+f8QmwF3k/ZhySbN3qxOf2ZpYPiDhZgRLbgStJRLx+TipkEBAiapD8qHyhI1l136AWl6QYEGkp6vqwYtRryMnbBuqq7b2UQaRSQh8ngaqLkLZ4YHSK1psUrGyuiwDiqlw8r31wsHR1aQDdxh6q2jtiN17Nbif100cKQpEf7XyqqtJ15C4ldHvX0do4tNtPXEa8efcoJPkj3m7Z2pp6wFf9nzAQ7U1eDrkRxVP6PzyoEvENThBMvlXDdxUXc5igQkK3a2vsg+WAYOVTy+FlnXFtnEy6UeOwXw31pHHuADNwMUd22dnOCIVDdMCM3+FeGKkRdXzggftT1DX+8/3zZWyCJI8ehDtssOs+biof6BIbE+Uraewa1YulOfCh9N3gXYKPgT0ZaZ7TN9jZQzJhwjJa7PTGA6x6APiQBJhDZeT8WytNKbeKjJ+OuozRxCKWYBxTgVe94QsXxWNS8mmuHmG6EIHeAg3KW7MkUunLbejOKedti8qlCJzVXu2KY3wXvoyeYvEE7+ZHbnRTiWMvdo51VQVZUBuNk9kp5lZmeYfB1yT+X9mVvVTKvasxNx9p6IIIUobnuj0leFpn8i1QpOlusEpqBUvqHAAjFU7ouXO20oLFXzbiX0VTRvOw4DLorPpevTrJPYCwSNkMyTOTugh+qmNK2/xW/1YYij1N/sGtFEOE1uNZ0cOubUNUlKGY+enFTslgm2YXoNIAHiY8+npkZWmw/qyCTGYLFaWrterAfuisWYadpiB4V7dchrLLlQi+UabNbr7BjE7choZpaMTm5T0kcD/3necrhzlu6ZRZj2qu9kMa0lcHVZFZezeUaCCsJxXxYEoO7q1L yKzq874K J1sfGcdbO9EMQZKSHW4DAcAeByXanfZGRgB9wTEkWfwDOgHICIj3a3y12I0bCMdQAkF5fMOQCvlU/s1HC9RIcOsV+U3Ctwyh93eApR01SIK4N3pml0j6dtSRzfgzWevO7j5ZnueZwq7MAHh503tzJvX6GTHpAz+2c8IGtfTpACK6vB+m3tuQRh2bzw5KJMUUSjg5lIU9x7n0b7trl8opaZhIo9JIcAudzf2s8yXi0BjFxofUbiu0LN/2EjK7/NhvNc7o33wtnhwhRAgFrCucYgC/fr9x5OFsEbwLN/4yS0E6KMO6m1n5pR4jdRA== 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 Apr 4, 2025, at 17:01, Christoph Hellwig wrote: >=20 > After the btrfs compressed bio discussion I think the hugetlb changes = that > skip the tail pages are fundamentally unsafe in the current kernel. >=20 > That is because the bio_vec representation assumes tail pages do = exist, so > as soon as you are doing direct I/O that generates a bvec starting = beyond > the present head page things will blow up. Other users of bio_vecs = might > do the same, but the way the block bio_vecs are generated are very = suspect > to that. So we'll first need to sort that out and a few other things > before we can even think of enabling such a feature. >=20 I would like to express my gratitude to Christoph for including me in = the thread. I have carefully read the cover letter in [1], which indicates that an issue has arisen due to the improper use of `vmap_pfn()`. I'm wondering if we could consider using `vmap()` instead. In the HVO = scenario, the tail struct pages do **exist**, but they are read-only. I've = examined the code of `vmap()`, and it appears that it only reads the struct page. Therefore, it seems feasible for us to use `vmap()` (I am not a expert = in udmabuf.). Right? [1] = https://lore.kernel.org/linux-mm/20250327092922.536-1-link@vivo.com/T/#m05= 5b34978cf882fd44d2d08d929b50292d8502b4 Thanks, Muchun.