From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFAFF417D81 for ; Wed, 15 Jul 2026 18:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784141942; cv=none; b=J4d2s/A/EwS+2pTFHRo8xPP34cqGOHwUke6SxDtG7u8/b3NR3xgSzkynkN6nrbyLgVUTy577rCDAHFEiUFjZ5P5YDIFbzb0jO/C2KarSi/uxKweUVFgmFgDX7CvjtDcRVmB4pQ/qOM0p1mVjIy0pQEDZdmOo0meuqn2lG9Bw1qI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784141942; c=relaxed/simple; bh=TgbJDDTnKl3rH1fv4+Row8N3hGRd2ho7ZwSCU/FpUAw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=d/+fJwT56gZc0l6k6tU3HazhVRTGBsc00gf2PAFhuEfEbOiu+oOJcW55MekjHYWutdwSHWqBkh/gTGhAQd7lhRjuChT7mAUjNP0uI8DD4DMBx9xelOn0bBVTbkb2EoRl3Ogy6fCHp7gQdVxqh34fnHgJlS+THqntGUqcn9oxPjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=vJEETtdd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="vJEETtdd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D78A11F000E9; Wed, 15 Jul 2026 18:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1784141933; bh=fqHHwO7JAlURhQG4Jw1SHv5Ft9ovtN2t3y4hVi2W09Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=vJEETtdddAlz7+EIMGm4DFsoK2J4nhFAUDgu3sHei+wYslXrtYTuv0lfjA0KOc7+L MwOHC1I9bfN82KG/UdpfdjP4uSeUx+hjAphiy6+RoyU2R2IFNSs7V2RFgeYVnV1WiG 3T4GGcwtZYgqkZHsFtD92xJe+vpDNX8rNcdU4WyI= Date: Wed, 15 Jul 2026 11:58:52 -0700 From: Andrew Morton To: Dev Jain Cc: david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, riel@surriel.com, harry@kernel.org, jannh@google.com, lance.yang@linux.dev, ryan.roberts@arm.com, anshuman.khandual@arm.com Subject: Re: [PATCH 0/3] Batch unmap of uffd-wp file folios Message-Id: <20260715115852.a32e472d97fa182d6a5ee482@linux-foundation.org> In-Reply-To: <20260715111839.1667914-1-dev.jain@arm.com> References: <20260715111839.1667914-1-dev.jain@arm.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 15 Jul 2026 11:18:33 +0000 Dev Jain wrote: > Currently, batched unmapping is supported if: > > 1) folio is a file folio, not belonging to uffd-wp VMA > 2) folio is anonymous and not swapbacked (lazyfree), not belonging to > uffd-wp VMA > > So the cases which are not supported are > > 1) folio belonging to uffd-wp VMA > 2) folio is anonymous and swapbacked > > It is easy to see that this adds a lot of cognitive load while reading > try_to_unmap_one - we need to remember throughout whether nr_pages == 1 > or > 1. > > The uffd-wp handling in try_to_unmap_one is regarding preserving the > uffd-wp state for file folios via pte_install_uffd_wp_if_needed (for anon > folio, we handle that while constructing the swap pte). > > Stop special casing on uffd-wp VMAs by simply adding batching support > to pte_install_uffd_wp_if_needed. Thanks, I'll await reviewer input on this. Sashiko might have found a pre-existing issue: https://sashiko.dev/#/patchset/20260715111839.1667914-1-dev.jain@arm.com