From patchwork Wed Apr 5 14:25:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13201846 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 6F9E4C7619A for ; Wed, 5 Apr 2023 14:25:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D7CCF6B0072; Wed, 5 Apr 2023 10:25:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2DF26B0074; Wed, 5 Apr 2023 10:25:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCE236B0075; Wed, 5 Apr 2023 10:25:42 -0400 (EDT) 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 B09F86B0072 for ; Wed, 5 Apr 2023 10:25:42 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 670ED1A0CAD for ; Wed, 5 Apr 2023 14:25:42 +0000 (UTC) X-FDA: 80647560924.22.8B0E0B7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id A40AAC0021 for ; Wed, 5 Apr 2023 14:25:39 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QkG8rSy8; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680704739; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=/PrTUC1frDc4ONSybRkUjf9mg/0PMjE5a3fC6SdvA4M=; b=Ur6220aZkbes42dtohtDdeBkBc7rrtTuNqsFRv8ZUYVDj/ou0NnFbldeT2GXJ/fK2fu2HK 8n5jrV7zbczrVrbXtH0vTPezJhenUhkKH0NouxgVLPUFSoR+rK69uKmhx2YDWkWol6HYIq /o7jOBFa3cbzNcTeYvL0E9rRsnaY/rA= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QkG8rSy8; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680704739; a=rsa-sha256; cv=none; b=2bq6sguhjgRDc6UorsEz/Ev4/js92e89cjYqObhJuPW+5VJfJVSHK07HV/NpU7r8B4ed4j 21bY6tzqs8cl8qVCffe/Fh7hzqaSy0d8kVjTGN7bVnEjDXwJtaE7bI6058VdX/31x1plrx XAKTGeaM9x+3Hm7TCYt+z3EEs24nkRo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680704739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/PrTUC1frDc4ONSybRkUjf9mg/0PMjE5a3fC6SdvA4M=; b=QkG8rSy87htaqoERWa9XNa7ZDcsEqgViv/6KSg2zjC3+ITw9fHPw8c3APsS0k7spj2iMZU x8TxMNsqp0oWLFqT+voavH6BOsWQYsjkOk7BtOHlraOyraKSgnHdHUqKPxqWU5uvO1dpKS SXF+bd+pZDCvLjfyN7QFQzAZkY1v4hM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-69bBNsnbO2ix0dbsL13xbg-1; Wed, 05 Apr 2023 10:25:37 -0400 X-MC-Unique: 69bBNsnbO2ix0dbsL13xbg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C2CC85C069; Wed, 5 Apr 2023 14:25:37 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.195.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01FDC400F4F; Wed, 5 Apr 2023 14:25:35 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Peter Xu , Muhammad Usama Anjum Subject: [PATCH v1 0/2] mm/userfaultfd: fix and cleanup for migration entries with uffd-wp Date: Wed, 5 Apr 2023 16:25:33 +0200 Message-Id: <20230405142535.493854-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspamd-Queue-Id: A40AAC0021 X-Stat-Signature: 34d1sfsnt7dbsbb78o9urec6fopfqczp X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1680704739-361562 X-HE-Meta: U2FsdGVkX1+3acw5ooTWPySs+BY7iZaq2BcTLpkyvllAsqhtKsRtxE3T+5g4QW0wc3mtww26heCc10VEzwUg5BXNqnv3AwotqUTz9fj7iRAKaswasIILTrpevv22QSkxSkZUNlmxeKVKdy4Y21eTeMAy7E4wIhuOOXhNdX9qSdEkgkSfh9fkiO/p5fv6/CE2VWqLitpWinanLYuqTFujHXkHzjrh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bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: One fix (I have a simple reproducer but it's too long to paste it into the commit) and one cleanup. uffd-wp migration entry handling for PTE/PMDs should now be fairly similar code-wise. Cc: Andrew Morton Cc: Peter Xu Cc: Muhammad Usama Anjum David Hildenbrand (2): mm/userfaultfd: fix uffd-wp handling for THP migration entries mm/userfaultfd: don't consider uffd-wp bit of writable migration entries mm/huge_memory.c | 16 ++++++++++++---- mm/mprotect.c | 2 -- 2 files changed, 12 insertions(+), 6 deletions(-)