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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E00FDC433FE for ; Tue, 4 Oct 2022 00:28:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BE026B0072; Mon, 3 Oct 2022 20:28:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26D0D6B0073; Mon, 3 Oct 2022 20:28:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 134E36B0074; Mon, 3 Oct 2022 20:28:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0110F6B0072 for ; Mon, 3 Oct 2022 20:28:14 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BEB661C6114 for ; Tue, 4 Oct 2022 00:28:14 +0000 (UTC) X-FDA: 79981380108.27.418D100 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 00C9240003 for ; Tue, 4 Oct 2022 00:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664843293; 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: in-reply-to:in-reply-to:references:references; bh=pj+13W7HFM06WePLHe+jsxNPLN/rwSpvvUEX7p+XOZo=; b=J260vJVY4xKSZOz/L56mdCxnts4OYtCU0RQH7FrC2WYKRbt+YN+6hTxuHwjGp6StSbqp2f pTV860WNjr1XDb4urN2u+SPDgXAxUIhgMgNjS1VeTpbKenDgyK7eiQBs0enpZhHeSD9al4 G0HxWup2YIzpm+LEyunRL6JKQdvzufI= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-654-SLKL-tvyNi-puHkKasukvw-1; Mon, 03 Oct 2022 20:28:06 -0400 X-MC-Unique: SLKL-tvyNi-puHkKasukvw-1 Received: by mail-qv1-f72.google.com with SMTP id em2-20020ad44f82000000b004af5338777cso7934486qvb.4 for ; Mon, 03 Oct 2022 17:28:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=pj+13W7HFM06WePLHe+jsxNPLN/rwSpvvUEX7p+XOZo=; b=SL9ZR1m7Bwu2lmHXwoEVUSkm6lTBnN7ytQaL/aWLtPy07egGe5McqzAPHIOmyM4UbG ddmrrHwWt7t8PoKVEo5n4fv9xDQy+xEZAo7XW5FaJlw8ZiEb8Dka1/kXUhE6bYXrudjr 4OETXH+NQA7PhoCO17jp7k5T6Up3gDVbn2OfZzdPOBZjFuIhjeDABm3AB9xvz7juYjPP FM5oAczTogNcvP91TuUdAka9cxszMBV/ls6coQ7RuAa+LcuzZe4ytEvaqXVufhH3PVWS M1762igl8wjMuUmCwz4gfhmRkuBV0oMyRNXgQDV/b+C6pMxcuqJfwjzd0XeFQBfqUhP8 wBjw== X-Gm-Message-State: ACrzQf0U5Tr2KUE7MSb9hOBmYYS+zgTMvsnhomvyXWAP+pm9P+LGFfFZ v+kLrJyOhsHm59ulCWVYLAxPKVR9B6YTLF3j7V4AvubFdXc0Qz6HKSyuoKNpaiIqHAWsgoc64zA D5i/LWeEldhw= X-Received: by 2002:ac8:5b95:0:b0:35c:e579:1feb with SMTP id a21-20020ac85b95000000b0035ce5791febmr17993207qta.481.1664843286440; Mon, 03 Oct 2022 17:28:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IEwX3LFHu386ZT/atsDghlRieK/y5Wumcw8asQhPJ2iC/POzF1khL8FoV+rLT3iH/Y5mXaA== X-Received: by 2002:ac8:5b95:0:b0:35c:e579:1feb with SMTP id a21-20020ac85b95000000b0035ce5791febmr17993193qta.481.1664843286247; Mon, 03 Oct 2022 17:28:06 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id r10-20020ac85e8a000000b00342f8d4d0basm10584846qtx.43.2022.10.03.17.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 17:28:05 -0700 (PDT) Date: Mon, 3 Oct 2022 20:28:03 -0400 From: Peter Xu To: Mike Kravetz Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrea Arcangeli , Mike Rapoport , David Hildenbrand , Andrew Morton , Axel Rasmussen , Nadav Amit Subject: Re: [PATCH 1/3] mm/hugetlb: Fix race condition of uffd missing/minor handling Message-ID: References: <20221003155630.469263-1-peterx@redhat.com> <20221003155630.469263-2-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664843294; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pj+13W7HFM06WePLHe+jsxNPLN/rwSpvvUEX7p+XOZo=; b=dUMcqdRmkB8SilCzhM31wN9h2EHsxiMpOdlDJTFOT9IoZALpc+7gg7hUk0Dfa59N/QFpFZ bHouYSY6poGhMUgKhZ5x8vfpozlGfqni/yNUfj1dsXi2eGdFF9eia4uIXurSoDbwvyDsrv cGpUZsdgexx++o2CnZDFTPbEVKL7B20= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=J260vJVY; spf=pass (imf07.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.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=1664843294; a=rsa-sha256; cv=none; b=qBCeEAtFNRLFUDstnGbinDmY+BQedIlQ0mYzRfAPUdt5hdHqSjnveKIxQVgRG/aMHbQwoy PRz7/yLwIp4L3FH1QM5uhZPY50pJMhill/63XoW9seKuhrcAtJJ/1MgLuyb+i/Ohz/jfDJ ZDZSB3dPqRODoEjveK8lD8Wpd6HlukE= X-Stat-Signature: e9ecpqqx8gkria1jdietkcxrt49ewytu X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 00C9240003 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=J260vJVY; spf=pass (imf07.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1664843293-986497 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: On Mon, Oct 03, 2022 at 02:45:47PM -0700, Mike Kravetz wrote: > This also explains why the new locking exposes the race. > hugetlb_change_protection needs to take the i_mmap_sema in write mode because > it could unshare pmds. Previously, hugetlb page faults took i_mmap_sema in > read mode so this race could not happen. Makes sense, thanks for explaining. -- Peter Xu