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 92D3AC433F5 for ; Tue, 26 Apr 2022 17:34:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 241FD6B0074; Tue, 26 Apr 2022 13:34:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F0EF6B0075; Tue, 26 Apr 2022 13:34:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B9786B0078; Tue, 26 Apr 2022 13:34:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id F29246B0074 for ; Tue, 26 Apr 2022 13:34:41 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id CE96C80D33 for ; Tue, 26 Apr 2022 17:34:41 +0000 (UTC) X-FDA: 79399729962.28.E124496 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf08.hostedemail.com (Postfix) with ESMTP id C61D5160040 for ; Tue, 26 Apr 2022 17:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650994480; 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: in-reply-to:in-reply-to:references:references; bh=JumK7LOjU2+9ljtUKiS2aDX11u3heSmlrGdnx7b+T4g=; b=MuJGiv2uBl/3gVx/Ykih+mfJiX1+6jMLcN1NbMbK6Yyh/BV1yEai2f4kM4QLVO0DoG4Hir g5EyPfOpPJDLW0LlyJjR8OoSO307aYdj6w1dqMwybsmx5hSuyF4JWWC61tXsOlpBQHU6D9 yV+DOhobklMGJt4E0ZDf8NUsUmUGj+c= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-235-eN6_svLrO6iX4cCqmrmlMA-1; Tue, 26 Apr 2022 13:34:39 -0400 X-MC-Unique: eN6_svLrO6iX4cCqmrmlMA-1 Received: by mail-io1-f71.google.com with SMTP id i19-20020a5d9353000000b006495ab76af6so14823954ioo.0 for ; Tue, 26 Apr 2022 10:34:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=JumK7LOjU2+9ljtUKiS2aDX11u3heSmlrGdnx7b+T4g=; b=5uk0/HBR1YjVRw3SBDE2VE2ADCmIvATsx3ROUpPFgtH3QWLfMkqZXOd2G1eyMRBWDk jw+WF1M5/xlUYW+8Y/ms5rQDnqJKsfXN+74TNTCboRtqsOfdJRajyC4MVPgajgxfHGhd XgtrLWJDd9dZoNSflTNuabkjNbsp2+SafQSVp/RwCbJMGeu7P6KaGcRlgljq2sC97Lnd ibiUoxxuiwSx0PLFO5XM0+zrsw2u/BmfeX0W6LiqNjdaHjDCpXWthxqs/jTr9GFfURbZ Zeiwh1E3zPIxfjh04DPu/HaQhQrZhedNPWGzPCcx39LwrUr/9OP8TtmLpprbEwWM20vm lZ4g== X-Gm-Message-State: AOAM531vrCCZWlRfC8li8QSGbC5m6McQVfmTWweb0FNQtk0hyQNMPLaK 78BwFAM0s9ZA3maRkOPshxo+8rS2JtnOC1h2d6f4rnhSINXRcs1azFFewKFgHJgy/nTmsK34Rzy RoDlNa3jPAM4= X-Received: by 2002:a05:6638:dc1:b0:32a:df34:e198 with SMTP id m1-20020a0566380dc100b0032adf34e198mr6587063jaj.117.1650994478328; Tue, 26 Apr 2022 10:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGjRSNQEXmwLe232lch2But7s0o5O2VkU1hxD9zj2P5Si3uIjuFd6J4A4k7tDxIBW0o2S/2g== X-Received: by 2002:a05:6638:dc1:b0:32a:df34:e198 with SMTP id m1-20020a0566380dc100b0032adf34e198mr6587052jaj.117.1650994478124; Tue, 26 Apr 2022 10:34:38 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id d14-20020a5d964e000000b00657430ee98bsm9841162ios.4.2022.04.26.10.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 10:34:37 -0700 (PDT) Date: Tue, 26 Apr 2022 13:34:36 -0400 From: Peter Xu To: Muchun Song Cc: Baolin Wang , akpm@linux-foundation.org, mike.kravetz@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: hugetlb: Add missing cache flushing in hugetlb_unshare_all_pmds() Message-ID: References: <419b0e777c9e6d1454dcd906e0f5b752a736d335.1650781755.git.baolin.wang@linux.alibaba.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 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C61D5160040 X-Stat-Signature: z1wipheo96bo9phq47691ud76ttzffss X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MuJGiv2u; spf=none (imf08.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1650994475-979093 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 Sun, Apr 24, 2022 at 03:45:02PM +0800, Muchun Song wrote: > On Sun, Apr 24, 2022 at 02:33:19PM +0800, Baolin Wang wrote: > > Missed calling flush_cache_range() before removing the sharing PMD entrires, > > otherwise data consistence issue may be occurred on some architectures whose > > caches are strict and require a virtual–>physical translation to exist for > > a virtual address. Thus add it. > > > > Fixes: 6dfeaff93be1 ("hugetlb/userfaultfd: unshare all pmds for hugetlbfs when register wp") > > Signed-off-by: Baolin Wang > > CONFIG_ARCH_WANT_HUGE_PMD_SHARE is only definded on riscv, arm64 and > x86. All of them do not have a VIVT cache. In others words, > flush_cache_range() is null on those architectures. So I suspect > in practice this does not cause any issue. It is better to > clarify this in commit log. Looks correct. > > Anyway: > > Reviewed-by: Muchun Song Reviewed-by: Peter Xu Thanks, -- Peter Xu