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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA44AC433DF for ; Tue, 28 Jul 2020 10:53:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B016D20656 for ; Tue, 28 Jul 2020 10:53:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LOlyux90" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B016D20656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3EAC08D0008; Tue, 28 Jul 2020 06:53:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 374898D0005; Tue, 28 Jul 2020 06:53:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 216048D0008; Tue, 28 Jul 2020 06:53:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 073B48D0005 for ; Tue, 28 Jul 2020 06:53:32 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A7F763622 for ; Tue, 28 Jul 2020 10:53:31 +0000 (UTC) X-FDA: 77087173422.26.copy18_480c0fe26f69 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 788631804B656 for ; Tue, 28 Jul 2020 10:53:31 +0000 (UTC) X-HE-Tag: copy18_480c0fe26f69 X-Filterd-Recvd-Size: 5529 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jul 2020 10:53:30 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id t15so11306623pjq.5 for ; Tue, 28 Jul 2020 03:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=agRMqGGlf6WEhzng1JHJTfSL3lgFlGnxzJ0Cav+bYwY=; b=LOlyux900DwySJrPY4APfRX1lil/nI28/QfYF1AYlmE+78dPK5RYl6rQ+sD5+x5MA7 playMugBZGJPi4cNxmeP+cB0atQX1/GTXF03Pb/x2CQuKNPkiq1Waz1Ky+uypI3zPBSW YxU5r/gfiPvvENminX12cG6746FlKyqgYVwOqF0W5IlOPxW4T/F2yNlR2vFRm8/RzuPL P1B0c7lbUooXxICuyibePBquJuQisL8LvIEyaJISfFRcWpoYQESGRDwq8TevCKApJ6e/ fJla/uli1Og8SbOWaKOadogeThM5RYLbSZ5LSpD9XEG3FW2zmhtctXWhQqI+shiRcdy8 7X2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=agRMqGGlf6WEhzng1JHJTfSL3lgFlGnxzJ0Cav+bYwY=; b=RII/8w1EC0suP9v+PMS+iqb/epu+kLByUTPUrjxvWMSSA7IMyJ9C1xwQXTNR3w4b2c eTmj/NY3rZhmjgC+8Afuyl8807AeTTvHLQlZPhWMPkS45n75rp7l9e+N7jONjaZpfL2G yCySYMWSVsj+uxZgwYHmU3YTlzL5DlKNGNsXsDbFZCNal0BCocQBVmg3w/QZ3SONEYlW 0x1lZy3owmF9ABvS2lUlIU4CzN7QdJysb6T2FtW4DhenrHadZZaE2H0IZ+BmaHoimxJf ViLkEM7Lw3Md9FZPPDO9bszUbf2OsCGKaQ6DElYUkX2Bw69wGKjcP6O+XxyRVw+Kiiuq 2SBw== X-Gm-Message-State: AOAM533nZFbLeeka+GUstamjzNYZXHJ1SZ9hNGd2k7MYFrv2w4+cd8pG AjEy/5g1J9UrwiqBIE+fC6A= X-Google-Smtp-Source: ABdhPJzDyUiZdoRIhWil/eQB9vL3D+ZkGma3UEEEz2L1OSFLOod9x5RLtms6ZoVyeVTnVsDId/pLZw== X-Received: by 2002:a17:902:fe10:: with SMTP id g16mr955299plj.227.1595933609963; Tue, 28 Jul 2020 03:53:29 -0700 (PDT) Received: from localhost (110-174-173-27.tpgi.com.au. [110.174.173.27]) by smtp.gmail.com with ESMTPSA id z11sm17894138pfk.46.2020.07.28.03.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 03:53:29 -0700 (PDT) Date: Tue, 28 Jul 2020 20:53:23 +1000 From: Nicholas Piggin Subject: Re: [patch 01/15] mm/memory.c: avoid access flag update TLB flush for retried page fault To: linux-arch , Linus Torvalds , Yang Shi Cc: Andrew Morton , Catalin Marinas , Johannes Weiner , Hillf Danton , Hugh Dickins , Josef Bacik , "Kirill A . Shutemov" , Linux-MM , mm-commits@vger.kernel.org, Will Deacon , Matthew Wilcox , Yu Xu , linuxppc-dev@lists.ozlabs.org References: <20200723211432.b31831a0df3bc2cbdae31b40@linux-foundation.org> <20200724041508.QlTbrHnfh%akpm@linux-foundation.org> <0323de82-cfbd-8506-fa9c-a702703dd654@linux.alibaba.com> <20200727110512.GB25400@gaia> <39560818-463f-da3a-fc9e-3a4a0a082f61@linux.alibaba.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <1595932767.wga6c4yy6a.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 788631804B656 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: Excerpts from Linus Torvalds's message of July 28, 2020 4:37 am: > [ Adding linux-arch, just to make other architectures aware of this issue= too. >=20 > We have a "flush_tlb_fix_spurious_fault()" thing to take care of the > "TLB may contain stale entries, we can't take the same fault over and > over again" situation. >=20 > On x86, it's a no-op, because x86 doesn't do that. x86 will re-walk > the page tables - or possibly just always invalidate the faulting TLB > entry - before taking a fault, so there can be no long-term stale > TLB's. [snip] > It looks like powerpc people at least thought about this, and only > do it if there is a coprocessor. Which sounds a bit confused, but I > don't know the rules. I'm not sure about ppc32 and 64e, I'm almost certain they should do a=20 local flush if anyting, and someone with a good understanding of the=20 ISAs and CPUs might be able to nop it entirely. I agree global can't=20 ever really make sense (except as a default because we have no generic=20 local flush). powerpc/64s reloads translations after taking a fault, so it's fine with=20 a nop here. The quirk is a problem with coprocessor where it's supposed to=20 invalidate the translation after a fault but it doesn't, so we can get a=20 read-only TLB stuck after something else does a RO->RW upgrade on the=20 TLB. Something like that IIRC. Coprocessors have their own MMU which=20 lives in the nest not the core, so you need a global TLB flush to invalidate that thing. Thanks, Nick