From patchwork Tue Oct 4 19:33:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12998644 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 F2EDBC433FE for ; Tue, 4 Oct 2022 19:34:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 537B86B0071; Tue, 4 Oct 2022 15:34:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C0A56B0073; Tue, 4 Oct 2022 15:34:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3143F6B0074; Tue, 4 Oct 2022 15:34:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 19DA56B0071 for ; Tue, 4 Oct 2022 15:34:06 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DB5D080E6F for ; Tue, 4 Oct 2022 19:34:05 +0000 (UTC) X-FDA: 79984267650.16.DC8ED15 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 05AD520015 for ; Tue, 4 Oct 2022 19:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664912044; 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=F5xmAN9t6CeE2TFrsq+QgzxqKIzmy0qcB2aGqOypPbg=; b=BUfjo1pKaAhWfrazQwSj/dowlERF8DaJVE4wULp3QxVVHtnKwqdhr2VonmFEBBU0jx5WB2 1BFfVuea/wqmX4iCVNcHbQ6jk0mNoz1RzxZoxik7AtZ66YP0MMOXHqvqANV6KTxe9TgbOW XIfvYNUCs8ppWXkvSt5Ng6xldDuB/pY= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-460-prj4OPJnO62dZDCHLVMFkQ-1; Tue, 04 Oct 2022 15:34:03 -0400 X-MC-Unique: prj4OPJnO62dZDCHLVMFkQ-1 Received: by mail-qk1-f198.google.com with SMTP id bp17-20020a05620a459100b006ce7f4bb0b7so12400953qkb.5 for ; Tue, 04 Oct 2022 12:34:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=F5xmAN9t6CeE2TFrsq+QgzxqKIzmy0qcB2aGqOypPbg=; b=Xv9zONLR9C4uiCRDMfam1+fGcPgdg9vpzHfIdmJ6QzHf+wrYPzib4uAorhq8NBsN2t 8DJEUidcLHzi+5Ju+/4TgToptL3Hhf4qub0TszlnHD8XSbVZcbedcO89HrtB8PMz8gan teimqDzWzILk4FSWuH6CBgz6JdyT8pLh6xEwL1ZealMkuUhmQJwpJL4EpcRo0mdNnmcG lFEbaAItcvHoCPHxj2Xi0zETgmZo4XYEIihiNMS5vIhqthhHNGF0M/DeSO00yRIx8UWo 9b8LNpUv1DxxvOvDxEg+R9PgiIXqoJhjiBF8v1xRaBQOMBZz79gAnvpjFCdnLLmqWZ4N Wz+g== X-Gm-Message-State: ACrzQf2pumw21JJlL5YRlAnsnqnz73c3MyeCys3Xz/NNUOtw5kRSrq+q OYsKcwZ+qY0CmJSB60zkgCzbrBHywzzdabMSF+8WZrU9OY8O1FUFwSsRUEFPYfSdbpj9cm42sBn jdmbomWh0jnPPVzSzBUHnYIETpoU2uQYtepRyAwDMSq8z9banL9f9CLCFz5Ub X-Received: by 2002:a05:622a:341:b0:35d:44fc:3908 with SMTP id r1-20020a05622a034100b0035d44fc3908mr21104953qtw.507.1664912042701; Tue, 04 Oct 2022 12:34:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jAF/2MHQhLJAx9+6UCeRp8zUWOpJ+7sJqhIuTupkh+lahPG8XXzChn6HoW8Wyr49jN/OPRQ== X-Received: by 2002:a05:622a:341:b0:35d:44fc:3908 with SMTP id r1-20020a05622a034100b0035d44fc3908mr21104926qtw.507.1664912042438; Tue, 04 Oct 2022 12:34:02 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id z5-20020a05622a028500b00342fb07944fsm13299811qtw.82.2022.10.04.12.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 12:34:01 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Mike Rapoport , peterx@redhat.com, David Hildenbrand , Andrew Morton , Andrea Arcangeli , Nadav Amit , Axel Rasmussen , Mike Kravetz Subject: [PATCH v3 0/3] mm/hugetlb: Fix selftest failures with write check Date: Tue, 4 Oct 2022 15:33:57 -0400 Message-Id: <20221004193400.110155-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664912045; a=rsa-sha256; cv=none; b=GBeM1NhHudsMCxUlD+DADgdY8bXdYTh5wG22QS3dUsZ12tpzwF+HGQ0NyTjXJMxLML6BK9 ECCOs7r62fiFKFBaDU5Arm3SlmLzY8Q3/jU+gd+5V0lrw5BAwZC8LpvQSKbZ9glQY0G26N hXTIlDS9EnXy8YfgCzeSqIBwHaZW3fs= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BUfjo1pK; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf13.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664912045; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=F5xmAN9t6CeE2TFrsq+QgzxqKIzmy0qcB2aGqOypPbg=; b=wvSmA69cRNlg2PmEVWJdOrXROg8FIDdk5HyaMiZVFJ4rAlIVh4jy5SB+YfPl6+fUXfXMZo Mn1v8X1Q1Wp/9QjRHIrtu6yDvM37AqFEvo7Q0tfHI6h4b1QA9McagCCqy7p/Pt4IfaE7s1 0/mwDFPWDhRu/fCYPW6y4QjMlc/NXxg= X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BUfjo1pK; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf13.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Stat-Signature: 8of8ckg77wsn1ieskz5b1wi3xbftorox X-Rspamd-Queue-Id: 05AD520015 X-Rspamd-Server: rspam09 X-HE-Tag: 1664912044-710644 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: v3: - Rebase to akpm mm-unstable v2: - Fix the commit message of patch 1, replacing CoW with wr-unprotect example Currently akpm mm-unstable fails with uffd hugetlb private mapping test randomly on a write check. The initial bisection of that points to the recent pmd unshare series, but it turns out there's no direction relationship with the series but only some timing change caused the race to start trigger. The race should be fixed in patch 1. Patch 2 is a trivial cleanup on the similar race with hugetlb migrations, patch 3 comment on the write check so when anyone read it again it'll be clear why it's there. Thanks, Peter Xu (3): mm/hugetlb: Fix race condition of uffd missing/minor handling mm/hugetlb: Use hugetlb_pte_stable in migration race check mm/selftest: uffd: Explain the write missing fault check mm/hugetlb.c | 66 ++++++++++++++++++++---- tools/testing/selftests/vm/userfaultfd.c | 22 +++++++- 2 files changed, 76 insertions(+), 12 deletions(-)