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 X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62994C433B4 for ; Wed, 28 Apr 2021 22:51:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE1C46143C for ; Wed, 28 Apr 2021 22:51:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE1C46143C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7EC0C6B006E; Wed, 28 Apr 2021 18:51:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C2696B0070; Wed, 28 Apr 2021 18:51:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6634F6B0071; Wed, 28 Apr 2021 18:51:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0038.hostedemail.com [216.40.44.38]) by kanga.kvack.org (Postfix) with ESMTP id 4D27D6B006E for ; Wed, 28 Apr 2021 18:51:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 02648180AD820 for ; Wed, 28 Apr 2021 22:51:17 +0000 (UTC) X-FDA: 78083273394.25.C39F3C3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 8C7AA40001DE for ; Wed, 28 Apr 2021 22:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619650276; 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; bh=v+CSK+FiuJ6SZRuJ8V5d9OF6/lPvPFEfhlB2Y9d/xoA=; b=P+cgjP4NylAWl7bDMvNj48crTF92We+QmrqWRtkdL6mwOywW/hg2udy4BGa1CzdIb++qfs rtGIFDq69gnrn7JBfkMlN3rqhtRYi92YgV5oG8HOA8LGVlqx3v3XDnCPARtph2Bo5kAdkI sAtdI/U04S8naV9rAlnXwSEjG79OtgU= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-316-hNtNNjgFM5aORQaksACFGg-1; Wed, 28 Apr 2021 18:51:14 -0400 X-MC-Unique: hNtNNjgFM5aORQaksACFGg-1 Received: by mail-qv1-f72.google.com with SMTP id t1-20020a0ca6810000b029019e892416e6so28936711qva.9 for ; Wed, 28 Apr 2021 15:51:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pooU5ZMLKkXMJLA5e7oiaebU/wArQl02uO8h9xkGhvk=; b=NrXOpd5efSwCa6xfgjW76fHyD/Gb2k7VYpEZf0U47Nbo+tbZ/fq661kt5Ea6nY4xLR 0sQ5N1L8iCYinS0L0OjX6eTQphNCLI0lEbTmGCZLJ7KN+6FcSJBP3rh6kfkKlQP7I1uU AbPp03Rc/L7FiuLkbubUZghgtALVR/vAOUabb6sCWhx6IrDbFgD7TUJxRRkh8DdACb0A NjVYg/vWrwpUTPs5gsMILxHrvFrFUmTdJ8kB57yb4HsKDBL9dwU0pEhq9X/wc+KklKmJ rxsLHyDredxvZbgeBExgd5eXiIHG1OTkkTsEiMCqrM1CkLIikPMTE4m6ELQCon8a/zs2 TAig== X-Gm-Message-State: AOAM5309KZn0BIWUtQ+2dh6IhXR37RTXngZpyrxeSxd+zPsLQLP4HMRY tvd8eGj9HwSa0axmIPeU51bXMA6+HBd5MrppJDtFdAkhRW8RzmRnEjCNp+Vivu6kBBuII9Zt9oj MV9gMteP50cLDQ27qlK2+e9fWGFpVTjWSBdoSOnETvuBvi+7LdS0qa4VqNywk X-Received: by 2002:a37:e508:: with SMTP id e8mr32053937qkg.82.1619650273298; Wed, 28 Apr 2021 15:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz6tneTK/gPqfHFunV9HPSIM2btpZ/L7qjW7iOF1MGO7e05kOtYMYLy8fnSNLgrS4EN38Ecw== X-Received: by 2002:a37:e508:: with SMTP id e8mr32053911qkg.82.1619650272985; Wed, 28 Apr 2021 15:51:12 -0700 (PDT) Received: from localhost.localdomain (bras-base-toroon474qw-grc-77-184-145-104-227.dsl.bell.ca. [184.145.104.227]) by smtp.gmail.com with ESMTPSA id 191sm897459qkk.31.2021.04.28.15.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 15:51:12 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Mike Kravetz , peterx@redhat.com, Mike Rapoport , Axel Rasmussen , Andrea Arcangeli , Hugh Dickins , "Kirill A . Shutemov" , Andrew Morton , Jerome Glisse Subject: [PATCH 0/6] mm/uffd: Misc fix for uffd-wp and one more test Date: Wed, 28 Apr 2021 18:50:24 -0400 Message-Id: <20210428225030.9708-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8C7AA40001DE X-Stat-Signature: uuoambe3wqarp1f7t56qowasj4ezptxy Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619650267-899513 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: This series is based on (mostly) v5.12-rc8-mmots-2021-04-21-23-08. It trie= s to=0D fix some corner case bugs for uffd-wp on either thp or fork(). Then it=0D introduced a new test with pagemap/pageout.=0D =0D Patch layout:=0D =0D Patch 1: cleanup for THP, it'll slightly simplify the follow up patches= =0D Patch 2-4: misc fixes for uffd-wp here and there; please refer to each pat= ch=0D Patch 5: add pagemap support for uffd-wp=0D Patch 6: add pagemap/pageout test for uffd-wp=0D =0D The last test introduced can also verify some of the fixes in previous patc= hes,=0D as the test will fail without the fixes. However it's not easy to verify a= ll=0D the changes in patch 2-4, but hopefully they can still be properly reviewed= .=0D =0D Note that if considering the ongoing uffd-wp shmem & hugetlbfs work, patch = 5=0D will be incomplete as it's missing e.g. hugetlbfs part or the special swap = pte=0D detection. However that's not needed in this series, and since that series= is=0D still during review, this series does not depend on that one (the last test= =0D only runs with anonymous memory, not file-backed). So this series can be= =0D merged even before that series.=0D =0D Please review, thanks.=0D =0D Peter Xu (6):=0D mm/thp: Simplify copying of huge zero page pmd when fork=0D mm/userfaultfd: Fix uffd-wp special cases for fork()=0D mm/userfaultfd: Fix a few thp pmd missing uffd-wp bit=0D mm/userfaultfd: Fail uffd-wp registeration if not supported=0D mm/pagemap: Export uffd-wp protection information=0D userfaultfd/selftests: Add pagemap uffd-wp test=0D =0D Documentation/admin-guide/mm/pagemap.rst | 2 +=0D fs/proc/task_mmu.c | 9 ++=0D fs/userfaultfd.c | 9 +-=0D include/linux/huge_mm.h | 2 +-=0D include/linux/swapops.h | 2 +=0D mm/huge_memory.c | 36 +++---=0D mm/memory.c | 25 ++--=0D tools/testing/selftests/vm/userfaultfd.c | 154 +++++++++++++++++++++++=0D 8 files changed, 206 insertions(+), 33 deletions(-)=0D =0D --=20=0D 2.26.2=0D =0D