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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 02AB5C56201 for ; Fri, 20 Nov 2020 17:42:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 37C4422264 for ; Fri, 20 Nov 2020 17:42:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="WQOOknlZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37C4422264 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8BB4B6B0071; Fri, 20 Nov 2020 12:42:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 86A096B0072; Fri, 20 Nov 2020 12:42:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75B0F6B0073; Fri, 20 Nov 2020 12:42:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 4554C6B0071 for ; Fri, 20 Nov 2020 12:42:35 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DF4A01EFD for ; Fri, 20 Nov 2020 17:42:34 +0000 (UTC) X-FDA: 77505516228.12.berry04_0f021152734d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 68C3D18038C42 for ; Fri, 20 Nov 2020 17:42:14 +0000 (UTC) X-HE-Tag: berry04_0f021152734d X-Filterd-Recvd-Size: 4415 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 17:42:13 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id u19so14618722lfr.7 for ; Fri, 20 Nov 2020 09:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hvM/LSSgC/tnV2UckBGwLgeFxj82XVDHBn5i8yTzPoc=; b=WQOOknlZ8F+t2Kqhx+/MokFS4U6JsIVoI24638zYY6iykL7IFtVbg7ZAZBkFF5OEf1 L08UK6oBAyUmkQjspP1fMdgnkurzkrhPgamkO8jVj+4LoSunIpo6bEefyHNISLDXTmDg bn+27eY+exS2MXRYWuydpquaxxcniVPi3YJzY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hvM/LSSgC/tnV2UckBGwLgeFxj82XVDHBn5i8yTzPoc=; b=DGgpS2BeWL47OFuccOxdBsR6O3jUazwFu601Vkkjjgi2GoxFsD39YzV4sUxDfMJzhV cq5NzBIudKA98t44t/Pe0P982qilhyoyY3b+QOocaysI0QtADiUH6p494GYZNOlcgLs7 mZe/OV+M11dmZ8uylVLqa3iALHa7BkJQY1SkfgzwjPNKO2SxxovU4xcmDcFo81GYot2E kGmc+lxSVC4YAz8R1jmaal/pfNFK/lGSDOG9Yk3WKGt7gQo3FmUNkL0XC3CiOM7Nfq29 wfEN3NEeqyY/E3N35Vw9pQf+iuVu92ex2WGMymt7/UQDt68jj/I0qrT/Ow3ldEwwGBsB 7+TA== X-Gm-Message-State: AOAM530KrrZM4SX0P7PusC3bmtE1bL9LJr+8q7+wujeUwEYtqDkCX540 lp7rzDWyCyfdxiEfGwFM+si+7ml5iDIkUg== X-Google-Smtp-Source: ABdhPJyS8z9VHiFWnggNSeSc3X0ixEC/t0WSvLzJpSqo+uaX5lNd9wmB7jiCpVWFYcBeGY6tTxULcQ== X-Received: by 2002:a19:ad42:: with SMTP id s2mr8218249lfd.428.1605894131763; Fri, 20 Nov 2020 09:42:11 -0800 (PST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id x9sm414517lfg.93.2020.11.20.09.42.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Nov 2020 09:42:10 -0800 (PST) Received: by mail-lf1-f43.google.com with SMTP id d17so14580721lfq.10 for ; Fri, 20 Nov 2020 09:42:10 -0800 (PST) X-Received: by 2002:a19:7f55:: with SMTP id a82mr9487841lfd.603.1605894130308; Fri, 20 Nov 2020 09:42:10 -0800 (PST) MIME-Version: 1.0 References: <20201120143557.6715-1-will@kernel.org> <20201120143557.6715-7-will@kernel.org> In-Reply-To: <20201120143557.6715-7-will@kernel.org> From: Linus Torvalds Date: Fri, 20 Nov 2020 09:41:54 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6/6] mm: proc: Avoid fullmm flush for young/dirty bit toggling To: Will Deacon Cc: Linux Kernel Mailing List , Android Kernel Team , Catalin Marinas , Yu Zhao , Minchan Kim , Peter Zijlstra , Anshuman Khandual , Linux-MM , Linux ARM Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000183, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 20, 2020 at 6:36 AM Will Deacon wrote: > > Ensure that TLB invalidation is performed after updating soft-dirty > entries via clear_refs_write() by using the non-fullmm API to MMU gather. This code sequence looks bogus to begin with. It does that tlb_gather_mmu(&tlb, mm, 0, -1); .. tlb_finish_mmu(&tlb, 0, -1); around the loop (all, your patch series changes those arguments), but it doesn't actually use "tlb" anywhere inside the loop itself that I can see. Yeah., yeah, it sets the flush_pending thing etc, but that still sounds fundamentally wrong. It should do the proper range adjustments if/when it actually wals the range. No? If I read this all right, it will do a full TLB flush even when it doesn't do anything (eg CLEAR_REFS_SOFT_DIRTY with no softdirty pages). So this looks all kinds of bogus. Not your patch, but the code it patches. Linus