From nobody Sat Feb 7 19:41:46 2026 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (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 4B0DF33A03F for ; Fri, 16 Jan 2026 16:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768580833; cv=none; b=ec+8+BkyUbc+iT60tKAsdaiIaRG6vEk/OKovrLYfNxupCBrxcMazzNuoeIkrYwtBvOiCL0EDrbjZG6l/ODmzM24f+CiGNO1XqtBiRDBeUBxzPEmbVRRkT9BB4fzoRIZLMavQvBDCFz+8qmrAWacFxgMF984tFkWOsgzzkX38UJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768580833; c=relaxed/simple; bh=l3r38C9rXw62vQYh0wIWhBJxzh98W6InagMR6wHiRKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IOPCJcpb/H+doEYNk+L7izFA6KNemVfA4cXt2goawmOKTJ7cTR8Yf38DOjLPnV3FmV1bhROQ2Sp8oALDbaM0wAbxr8gAr5MpJZKF3ged0T3ksd+rxZtc3GIxscODB7HHmsnY+umsF+U48qXECwWIGyNmjsCRaGzcYs9BVsSlhBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=Wgsww7VB; arc=none smtp.client-ip=115.124.30.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="Wgsww7VB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1768580819; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=FAf1EpB3RHV5nguc56M5OiGGTGDZlSOZIyII2hjqUoc=; b=Wgsww7VBCiHvKyvUe95Z7ZBlP4hCY7rICkPcYK5nCXNgTOdbhXGn6u6xWGwPKadfZuXPrhO3VWG67+wP6PwozlacGuuqD6+i2Rkoj1a+rv1e4ahhxTxX31UI8WBgHakXpqgO+ie36Jclll3HlgMzfi5mcpXF8vD1567qGEs6LJc= Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WxAk08M_1768580817 cluster:ay36) by smtp.aliyun-inc.com; Sat, 17 Jan 2026 00:26:58 +0800 From: Baolin Wang To: baolin.wang@linux.alibaba.com Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org, baohua@kernel.org, catalin.marinas@arm.com, david@kernel.org, dev.jain@arm.com, harry.yoo@oracle.com, jannh@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lorenzo.stoakes@oracle.com, mhocko@suse.com, riel@surriel.com, rppt@kernel.org, ryan.roberts@arm.com, surenb@google.com, vbabka@suse.cz, will@kernel.org, willy@infradead.org Subject: [PATCH] mm: rmap: skip batched unmapping for UFFD vmas Date: Sat, 17 Jan 2026 00:26:52 +0800 Message-ID: <20260116162652.176054-1-baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <142919ac14d3cf70cba370808d85debe089df7b4.1766631066.git.baolin.wang@linux.alibaba.com> References: <142919ac14d3cf70cba370808d85debe089df7b4.1766631066.git.baolin.wang@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As Dev reported[1], it's not ready to support batched unmapping for uffd ca= se. Let's still fallback to per-page unmapping for the uffd case. [1] https://lore.kernel.org/linux-mm/20260116082721.275178-1-dev.jain@arm.c= om/ Reported-by: Dev Jain Suggested-by: Barry Song Signed-off-by: Baolin Wang --- mm/rmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/rmap.c b/mm/rmap.c index f13480cb9f2e..172643092dcf 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1953,6 +1953,9 @@ static inline unsigned int folio_unmap_pte_batch(stru= ct folio *folio, if (pte_unused(pte)) return 1; =20 + if (userfaultfd_wp(vma)) + return 1; + return folio_pte_batch(folio, pvmw->pte, pte, max_nr); } =20 --=20 2.47.3