From patchwork Mon Oct 3 15:56:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12997649 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 07FC6C433FE for ; Mon, 3 Oct 2022 15:56:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45A9D8E0001; Mon, 3 Oct 2022 11:56:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E21E6B0073; Mon, 3 Oct 2022 11:56:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2347E8E0001; Mon, 3 Oct 2022 11:56:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0AE6F6B0071 for ; Mon, 3 Oct 2022 11:56:36 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CBD471C0AB0 for ; Mon, 3 Oct 2022 15:56:35 +0000 (UTC) X-FDA: 79980090750.03.D6E70AA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 3AD11C0020 for ; Mon, 3 Oct 2022 15:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664812594; 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=c+kdz5cc3NrJArhDY2JgimgASSW1d1LMZTKXqfIaym0=; b=HEt5J27PULF+xYKbuqsfzXr5JFagp9DzFuumogbkWsa5bHesqoRU8s5wlCp4uPxIXVVbAQ dAAd+8jCnybGrbwyFlkjYdM9B3mO3Qg+sZNdbcyKMwQOCVpbmfq/LUn1+oMHceqsn2KICE EX7LONde08hgYPeyUpwB6ZeeLRxgk+Q= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-503-nKxgxppVOVeDUaL-n6yNhA-1; Mon, 03 Oct 2022 11:56:33 -0400 X-MC-Unique: nKxgxppVOVeDUaL-n6yNhA-1 Received: by mail-qk1-f197.google.com with SMTP id w10-20020a05620a444a00b006ce9917ea1fso9421242qkp.16 for ; Mon, 03 Oct 2022 08:56:33 -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=c+kdz5cc3NrJArhDY2JgimgASSW1d1LMZTKXqfIaym0=; b=5I+o5ok2pay1jBr8oxYw/fqv/hUFRO2JxK4PGe1+R7z7n2dLF4m+YTmN/sLADkzNWI R0eB+JahjwCxg+BUgI37tQJktrYNm2QKyuynZC5cRjkXvq5OK53aoTp6tR54/A3d9Lts esHNQAQahe3UTEDOGmhDDnOhiNv9iXm2xwSAnsYz4Q5sQgHbueEorskMbR+OszAnuvWB JXj7ZPU96RV1JnKbXgUIt/x8/dht7asOj+DTtNB+uoqJa7MkY6kfvcSdefiIhZRcy87+ Zllmh0wu60NU1HjqoCUXjEG8i2FISqRKRpULflGcvcuqWjW/vxafOUNVu4duaZP9mdFS JO+A== X-Gm-Message-State: ACrzQf3A7xhdUndv7+3uM/jYkdXcM9Xh4+OfbVtwjxeC/iGgeRMsqepo FHjyAtgn5xPVAUDIX+d+7kWfTpMZBupTm6kXLXwZql14ulYdwjePvXeZ6Hfzj2VNzwYR2pe8pZY iBw58TLa4LGI= X-Received: by 2002:a05:620a:1a8f:b0:6ce:7d4e:6bf8 with SMTP id bl15-20020a05620a1a8f00b006ce7d4e6bf8mr13686633qkb.349.1664812592918; Mon, 03 Oct 2022 08:56:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM772dQHPW6o9PwTFwZTSvMd0ETbKDy6p1qmmy6Hv9ZpUfc2C7s+ziRT/FDrpRICFT2iN9vS6g== X-Received: by 2002:a05:620a:1a8f:b0:6ce:7d4e:6bf8 with SMTP id bl15-20020a05620a1a8f00b006ce7d4e6bf8mr13686625qkb.349.1664812592729; Mon, 03 Oct 2022 08:56:32 -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 bs18-20020a05620a471200b006cf38fd659asm10956732qkb.103.2022.10.03.08.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 08:56:32 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: peterx@redhat.com, Andrea Arcangeli , Mike Rapoport , David Hildenbrand , Andrew Morton , Axel Rasmussen , Mike Kravetz , Nadav Amit Subject: [PATCH 0/3] mm/hugetlb: Fix selftest failures with write check Date: Mon, 3 Oct 2022 11:56:27 -0400 Message-Id: <20221003155630.469263-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-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HEt5J27P; spf=pass (imf28.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=1664812595; a=rsa-sha256; cv=none; b=frZFHP8VWKtI8NokpGYB43aywGNgFzIU9h++5YCdS9lM5YOs1FmVzx6w8x09hoB5GPPnw6 JBeg/tis1xZJBGMqNEQqouE5JUb4KZjrQ5YsaShhR9YsPK3fe4ixUiOdFKIkx3c1oHbeH8 E0bnH7NVVLWlCdUVTjTXZDfE4Y8lSrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664812595; 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=c+kdz5cc3NrJArhDY2JgimgASSW1d1LMZTKXqfIaym0=; b=WOsYqq33nYq7ADE9lOjSb1vqLBpyxx3hhnIdp5HiKZVS2kDL+jU6FrERn+auiBfMByUe31 JOW60mjtMfHIYMIXEfOvcYMlk3JZwjlkB33lZghLbeh8uPQyEdz3eAdycDfh1Vgn44zLRD sM4pugQdEema7N0n0eSca+SCLB97vt0= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3AD11C0020 X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HEt5J27P; spf=pass (imf28.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-Stat-Signature: cazw8yxcfmu4z1gaodfbrgb9jqquy7z7 X-HE-Tag: 1664812595-881813 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: 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(-)