From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A5CC606A32A for ; Tue, 1 Dec 2026 14:02:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oYzLSL0Y Received: by kanga.kvack.org (Postfix) id D4F116B05C0; Tue, 1 Dec 2026 09:02:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D266C6B05C1; Tue, 1 Dec 2026 09:02:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C63726B05C2; Tue, 1 Dec 2026 09:02:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 59CF06B05C0 for ; Tue, 1 Dec 2026 09:02:20 -0500 (EST) Received: from smtpin03.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9A910160EC5 for ; Tue, 1 Dec 2026 14:02:19 +0000 (UTC) X-FDA: 85495578798.03.07A32DD Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf01.hostedemail.com (Postfix) with ESMTP id C7A3640016 for ; Tue, 1 Dec 2026 14:02:17 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=oYzLSL0Y; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of ljs@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=ljs@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796133737; b=K9GKMUcDvCTf6ka50Pwz3DlVxaIhdRUll6/66msMC3/BDrGFMFbDL6q61yT4dqQihWSwth Ffu6/16doZpfjKtd8mITEOFPCvdMOyoYn4B9koMrf83YakeGvPElY5u0zpFWhNEe69U6IO tVmmn9janW4df2YRK/1HuCEK2hQ5Flg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796133737; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=veWvSbYvAh/Gen6hOzl1bwDBI3WmwGQ5b8Nya3YUH6Y=; b=c8hZnW0TYR2KHnIQZprrxj9e9Nk5GZCE477W2eiW8ZmznENLjtNxEs20JumvpfTISX8J01 Nb3lx9MLqMNfOwKjPbI5GxW8j29GzzPd/d3sTOdBM7+gq/FeInXY1ZoSZWIC0WM1DZpQUW T3q9I8QTSW/ZB/omAPL2W/wG8magorc= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=oYzLSL0Y; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of ljs@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=ljs@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E8AA340F4D; Tue, 1 Dec 2026 14:02:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A98911F00898; Tue, 1 Dec 2026 14:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796133736; bh=veWvSbYvAh/Gen6hOzl1bwDBI3WmwGQ5b8Nya3YUH6Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=oYzLSL0YD6NeQrOn+BAM3vDbknmpnp3WwJfiIPteidQn8v206kvk11Zr/9zrk1R/R VvEQikv0DC/ATEzOu1caxSlZn076mYAcTHLQ2rGdMb6WgqlshLoOY313w7H3SJ8qAm uINU3M0qVFZB5UlJ6ODHCLJlw2RW3WP57IbUmeADDidlHTSWSZFVGxsFMwM1hyE6sH eAhAKv36V5Qe9EICa6o0ru4EbWUWYwTB8l955onhSt57usGbcWTFseCfvCeTcjXT0u XjSVSTWQVaj5iE80CK6Of3H4RSVJQ1cflGTPnVkOPjPhHipUA4Og2lxFCt2wynthez PLISGy4NYvCjA== Date: Tue, 1 Dec 2026 14:02:10 +0000 From: "Lorenzo Stoakes (ARM)" To: "David Hildenbrand (Arm)" Cc: Josef Bacik , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Jann Horn , Pedro Falcato , Muchun Song , Oscar Salvador , linux-mm@kvack.org Subject: Re: [PATCH RFC 0/7] mm: let vm_ops->open() fail for hugetlb Message-ID: References: <20261118-b4-vma-open-fail-v1-0-c8b0209f2700@toxicpanda.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C7A3640016 X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Stat-Signature: psmka3rymrh5as7rxcpj8k1no4px4jsy X-HE-Tag: 1796133737-15397 X-HE-Meta: U2FsdGVkX1+M14HbyEVKgEuNhxgDqu/U0m+yupM5OQmat1WLIs1TNsA6NNS9+9lkX5HNYvue3uJ31yEgVLKOUnlzoHPJPOrAVZxAqBwvc2MPw0LMHOn6iOLWshR66ZHxV8uIxPIrHd0jtPir38WwE3l5IPSe2wAf4QBRjBcKOB39tc28OvqFL5i1mBmEmAhiVWDSlvNs55J7CNuLiEFnUcsfHox4iPJrx6YtSHIvyMBsl8xp5T7d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aP7KLcsbyKuYZoQSK8B+17g72Y7eREzBXFdtIXwbSTBLdvwbCspgfqLI4SL3rsjdqh2KTqvGoCb7EVpqCz4KciErOFXMQsogctsi2l/DMEuBmIX4dcZ2p/MGgMbGcFebuUudSktErVPlWmtpSxTDHsJ3nnpJcDDCnHSasG4d0gJ+9qXrcWz25kW8WaDsh7yVnZB/2A== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sun, Nov 22, 2026 at 05:05:25PM +0100, David Hildenbrand (Arm) wrote: > On 11/18/26 18:00, Josef Bacik wrote: > > Hello, > > > > vm_ops->open() can't fail, so anything that allocates in it has to hide the > > failure. hugetlb is the one I care about: if it can't allocate the VMA lock > > for a shared mapping it carries on without one, and faults can then race > > with truncation. > > I'll leave the final decision to VMA maintainers, but for me this is the right > thing to do and I'm sure it will come handy in the future. > > (I have the faint recollection of people having to work around ->open not being > able to fail in weird ways. TL;DR - I'd like to take this over please :) Hope that works for you guys? TL bit: Thanks David. My inbox is a disaster so only just seeing this. This is relevant to me as my mmap_prepare work is trying to fix up a bunch of the mistakes we made around this stuff. The fact that open() and close() don't return error codes is a HUGE issue. It is clearly a mistake and results in all kinds of horrors. Hugetlb is just doing everything wrong, as usual though. It is abusing the mmap abstraction, it is abusing open/close it is abusing everything. It has problems with it because it's a giant f'ing hack. Anyway, this needs to be symmetrical - open and close both should return errors and should both be fixed up to handle that. It also needs to sit right with the mmap_prepare work. I added vm_ops->mapped() which is sort of a 'first open' for mmap_prepare() that _does_ return an error, but that serves a different purpose (mmap_prepare is idempotent, if you need to allocate you should do it in vm_ops->mapped()). Given this cycle is about fixes only I think I can defer it to next cycle. And then maybe even try to put it through the VMA tree? -- Cheers, Lorenzo