From patchwork Tue Oct 4 00:37:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12997900 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 65B35C433F5 for ; Tue, 4 Oct 2022 00:37:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C04096B0072; Mon, 3 Oct 2022 20:37:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB2EC6B0073; Mon, 3 Oct 2022 20:37:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A543D6B0074; Mon, 3 Oct 2022 20:37:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 92CA56B0072 for ; Mon, 3 Oct 2022 20:37:10 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5000B401A6 for ; Tue, 4 Oct 2022 00:37:10 +0000 (UTC) X-FDA: 79981402620.08.24E3DB4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id E3D8E120007 for ; Tue, 4 Oct 2022 00:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664843829; 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=a+4neDEGm4qY5mM8TS4YY0MjY3kwM/R5AbLZxz3+qnY=; b=NPbrqL0tGMXIOE/sUndLuCdH/LVHG3+ByZDJ6pVIzHMr6ktLR971PO38GRxowQ10bWmRvz 4VCS1jyLdpfIH1OkpXLNXrXpk8bBg9l+30BywR/7FObjDneN8FVfSnA9SfczIrl8RtFJAo 98jUBy0InsJ36KkHf84racsTTqGK6Uo= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-53-F0SyoUUOOvS8YCpX9ptHDg-1; Mon, 03 Oct 2022 20:37:08 -0400 X-MC-Unique: F0SyoUUOOvS8YCpX9ptHDg-1 Received: by mail-qk1-f199.google.com with SMTP id o13-20020a05620a2a0d00b006cf9085682dso10278934qkp.7 for ; Mon, 03 Oct 2022 17:37:08 -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=a+4neDEGm4qY5mM8TS4YY0MjY3kwM/R5AbLZxz3+qnY=; b=STNU26nqfhJ2ANAuHkZMUPUEUzTuYH2k1Kyx9tiplxB2F+R174T4NkhWCaLLvInz2o Rma/c5uomfEI+LN+NKb14gnuDveRH40lIOTA0Rorc/bWdRoeHecksltV+Zo2coBNk2jy 73Je0FgLVNcj3cbIyeUMWqkDJ7HWfLJjns+urBpKYugXURjG9wGsGyrqnOCPieZ8mYDl r2xUV3ckxIGhyHfWZVa0JGXay9C7nnq35mJxUNaMIGlBlc3gJp5O6BL02/m7FUyN8Cfz oxplrEUy6jAaY8WEJeDEQ+JIGJuKN1eU0uoT0Pc+ia5sPsQ+4zhGNebLeBPGjUcUW/dY eY1Q== X-Gm-Message-State: ACrzQf0STsnsM/c/H3tkIAf2Semk5O/gurrqzNg/3VjDii64hvXR7lUK oxhmZtYR4V0h3UEr9ufr1Et4F6NdmJGFfLjiYQhd6qh6nPromvyf18dKhL7uG6JlAwqWbCJi576 pU7FDV1QHVFg= X-Received: by 2002:ac8:5953:0:b0:35b:ab1a:ff09 with SMTP id 19-20020ac85953000000b0035bab1aff09mr17755050qtz.144.1664843827982; Mon, 03 Oct 2022 17:37:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6oIbv4111ipisxZpy1VyfdEf/bNYfh0MKHzB7EDgYemIqOR3iCFBPWDoRKNWFWin16V0hhDA== X-Received: by 2002:ac8:5953:0:b0:35b:ab1a:ff09 with SMTP id 19-20020ac85953000000b0035bab1aff09mr17755036qtz.144.1664843827792; Mon, 03 Oct 2022 17:37:07 -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 u30-20020a37ab1e000000b006bb9125363fsm12228104qke.121.2022.10.03.17.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 17:37:07 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: peterx@redhat.com, Andrew Morton , David Hildenbrand , Nadav Amit , Mike Kravetz , Andrea Arcangeli , Axel Rasmussen , Mike Rapoport Subject: [PATCH v2 0/3] mm/hugetlb: Fix selftest failures with write check Date: Mon, 3 Oct 2022 20:37:02 -0400 Message-Id: <20221004003705.497782-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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664843830; 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=a+4neDEGm4qY5mM8TS4YY0MjY3kwM/R5AbLZxz3+qnY=; b=SvTAQ1R3Wt2VRxWu2mz5q4CscGMax9EwfMZygMbW8X+ufeIn2hzxQvIge8pGac51gyWAsy 18QgQ+uNjt9v1nJ9ymay62JTOAu6k3ZiQ3hee8heJr2ND5QpaNAEIqAJMXEAYKTJvFBcqT H1RNDDPjyElTNBaiwvzhLjKgzKvQrJc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NPbrqL0t; spf=pass (imf29.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664843830; a=rsa-sha256; cv=none; b=jauNnmTfPnyy97DjJEa8HlU5bbE+OWQvuGh83MFCI4bSy5NdCFkJ5x2yUS2kgyNtsBdclm keY4yNnPiaRbQMNUqx921/G5Br57P2OlXHhKymqtADdreaBOua7LQKKE0hWxRflmvmNA/M SGsAb6VfCKOlB8i3aTdIbLh+xS2KVYs= X-Stat-Signature: 45nsbqastc5tx7xbc4k87kbb9wftqydj X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E3D8E120007 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NPbrqL0t; spf=pass (imf29.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1664843829-255440 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: 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 | 62 ++++++++++++++++++++---- tools/testing/selftests/vm/userfaultfd.c | 22 ++++++++- 2 files changed, 73 insertions(+), 11 deletions(-)