From patchwork Wed Sep 7 18:01:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12969315 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 4768EC54EE9 for ; Wed, 7 Sep 2022 18:01:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C441D6B0073; Wed, 7 Sep 2022 14:01:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF35B6B0074; Wed, 7 Sep 2022 14:01:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F8C36B0075; Wed, 7 Sep 2022 14:01:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 909E36B0073 for ; Wed, 7 Sep 2022 14:01:51 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6C8F9141109 for ; Wed, 7 Sep 2022 18:01:51 +0000 (UTC) X-FDA: 79886057622.06.0892982 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf01.hostedemail.com (Postfix) with ESMTP id 1246E4007D for ; Wed, 7 Sep 2022 18:01:50 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id fs14so10508496pjb.5 for ; Wed, 07 Sep 2022 11:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=eU/KWFZN5UecQ8lbzprnvq1q98iyrbbNqlvylwkyiHU=; b=GtwBMc6EL/iXg66DLvtx19O/9lfPfRbzA8mc4+Xi+LrbcSCdAPV5vLH4lpomv4ciNM fIYzkt3IS2BPGL2ih6bmDimjFB5SB4q2SuKHQwAlcbzYHpoVNaDYxuZdsVuFFX/3T/Uc YXF7Rny2ZEEGby9c57HmCFy9pg3z5r8m4VTNcZVG97Uv8KyUzy/Bnxo5Um52ZTTyeAVW G0qCz8OCaLUh7ICyMGSrI1Jh/Jswa1I086oJypMirhyA+vvor74uUAxXhbsk+gINCKbU HC9fT6qRKh58VoKTe1FnhEu84oA7FZip2zriqLGw9iKZGl+voSYJs7XVmVRxS1swZU7R JKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=eU/KWFZN5UecQ8lbzprnvq1q98iyrbbNqlvylwkyiHU=; b=B07vlga2IrpvatNRNox2PLAU1na8tabJ4jzLfTMOuQWqVefx7WQ3x8PKVxgkzN0tyV 8EGhP5Hm0SZBWZ/kPfBjDWdYyuuJOIbLGNqFAHzo7CozT+JMpBnl0qTx578juhoM1K+b VeZQo4HLOAGE5EnnBgJAenJGlkhhQpiEvg2EYuFqTKJ/SDfLEqw6SL5dIKjAUqaxTUFU MZrVaQ5jJ3INqPj5XxDuQSPsnQf+ev/RkUEgXIe8Thx12v8vp9nP2OV/bgg0AeVZYZd5 bJsjTC0TAGb32M3C5iw+CDE3T6V5Lujzhq7Gm1JGUlm0aniYlqkMbzEkxmSRJgmE5sJ9 bc3w== X-Gm-Message-State: ACgBeo1bRy0WIuHufuxPz4bhtimUlaTK9iPOEoO1cmoK51ikZpHO8KBf OuDwkL0wHhf2A9n68fquSu4= X-Google-Smtp-Source: AA6agR4jQu9kTFMCgKbNUddUbVeBrjOtp6VteymiGZOmYpTK0JnXVpNi96p1AWx0nYhR3UmigAXkAQ== X-Received: by 2002:a17:90a:d150:b0:1fd:9336:5db3 with SMTP id t16-20020a17090ad15000b001fd93365db3mr5322933pjw.242.1662573709955; Wed, 07 Sep 2022 11:01:49 -0700 (PDT) Received: from localhost.localdomain (c-67-174-241-145.hsd1.ca.comcast.net. [67.174.241.145]) by smtp.gmail.com with ESMTPSA id t17-20020a170902e85100b0017312bfca95sm12801664plg.253.2022.09.07.11.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 11:01:49 -0700 (PDT) From: Yang Shi To: david@redhat.com, peterx@redhat.com, kirill.shutemov@linux.intel.com, jhubbard@nvidia.com, jgg@nvidia.com, hughd@google.com, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com Cc: shy828301@gmail.com, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [v2 PATCH 2/2] powerpc/64s/radix: don't need to broadcast IPI for radix pmd collapse flush Date: Wed, 7 Sep 2022 11:01:44 -0700 Message-Id: <20220907180144.555485-2-shy828301@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20220907180144.555485-1-shy828301@gmail.com> References: <20220907180144.555485-1-shy828301@gmail.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662573711; a=rsa-sha256; cv=none; b=nbkIyOn4MPzb4a32ai25dvn6szLjq/RmPCQWu+xTcB+atXcEkATGOprOjlTiuHDlJrHudt d368TF/Xxzr0MN//Nbj5XaM05en48+sRR7/66FYPxsTjmOv5RrD0AUuoJrFFU4FqN8yJ28 t0LW/41A2ywaA2HQ+2xsF0KDW2L/2TA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GtwBMc6E; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=shy828301@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662573711; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eU/KWFZN5UecQ8lbzprnvq1q98iyrbbNqlvylwkyiHU=; b=BI7pGn69FN+vBw39Hgw2VS285450f3znCT2+EFPMVmips7yoNxhQBbSXVY0sF+teO7d/Q5 521g8rgbZ+Dn8JfSxTdD3aypmxZCEWS6AiBn9oTLn58hDdkS88zMpeXdRYYkoFUWLg1/9J 8+HS03k9CWWmLB+vqKdHA0nB4RKNj2U= X-Rspamd-Queue-Id: 1246E4007D Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GtwBMc6E; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: nnfsr8ojtwy9x8ncigt9zsawchz1fjoh X-HE-Tag: 1662573710-237152 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: The IPI broadcast is used to serialize against fast-GUP, but fast-GUP will move to use RCU instead of disabling local interrupts in fast-GUP. Using an IPI is the old-styled way of serializing against fast-GUP although it still works as expected now. And fast-GUP now fixed the potential race with THP collapse by checking whether PMD is changed or not. So IPI broadcast in radix pmd collapse flush is not necessary anymore. But it is still needed for hash TLB. Suggested-by: Aneesh Kumar K.V Signed-off-by: Yang Shi Acked-by: David Hildenbrand Acked-by: Peter Xu --- arch/powerpc/mm/book3s64/radix_pgtable.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 698274109c91..e712f80fe189 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -937,15 +937,6 @@ pmd_t radix__pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long addre pmd = *pmdp; pmd_clear(pmdp); - /* - * pmdp collapse_flush need to ensure that there are no parallel gup - * walk after this call. This is needed so that we can have stable - * page ref count when collapsing a page. We don't allow a collapse page - * if we have gup taken on the page. We can ensure that by sending IPI - * because gup walk happens with IRQ disabled. - */ - serialize_against_pte_lookup(vma->vm_mm); - radix__flush_tlb_collapsed_pmd(vma->vm_mm, address); return pmd;