Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5224243imm; Tue, 31 Jul 2018 07:30:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdAnhupJWtTtmXNylAsnUlFjSkLNJ0W3iaWZ2Uh37Aez0r5Wd2ZX3j9HkzDNtGRdcTFWlin X-Received: by 2002:a17:902:758b:: with SMTP id j11-v6mr2299142pll.29.1533047440203; Tue, 31 Jul 2018 07:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533047440; cv=none; d=google.com; s=arc-20160816; b=e8ICZbyxuYtlLwOe2h6juiYKSgl6HGvbF644YvSyxuF0XZjyKy3ZlrD/mUI3Gn4YXN NCmxsvML9fIqdXTtil9oW7MEE+uOHGhmNUIkenV285BoKJEZm0MOLNzWwIY8bCREG71x PhiLZIR/uC/Q7Cbvdz8szWOeKsRmovxi0iPTLFUhjhMS2IY0jR67ILtw1Dj3vqZhm27E XN4nxIOCRmu7vjg/9govAYBYQ4EGxyTSLOwNxMuRVDrJb3uTU1HY6DdBQ9oWd45tEAau FsSvJMtqOeSSbK072RpAOqNERSRye5SbbRHU+t59mUymC7aIMRvAobabkGNwAC7uIWr5 GcJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=wIQG573o+JRvmpcvV7ZUMk/gkWZriOscBdmFH2glTqI=; b=U3XqvJzZ8G73CyJMKou4tdg6HJsDgaYKGXUHCxfaPz/RUGwC2zOMeZmUNAKHMMM+fU 3RUrKpLnkTEYH8pgdydJ5NvUmJQM6EGEAoofosd0WHX6+cZRHT1Bvqat9voeALzbDELH HbvDKi0UHvlYXIHx3yekkxQgODRC7rbDbXH+t20CBbhuqJe7ss4QOhOFNJYDWtaqaK7l upIlJp8OnJPwXnL6omR+Ea1mXsWVySYpt78wMDh0HY+poovIN8JtO7i0LAJUR3XGkLHc P0Cr22xE96KIEpAxxxR0I5hXUgdB2zS/MwY/Pe72c8nURD2pX2r3axL30fDD1V7/6sqy eWlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=jXCwTA29; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si13158561pls.237.2018.07.31.07.30.26; Tue, 31 Jul 2018 07:30:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=jXCwTA29; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732389AbeGaQKD (ORCPT + 99 others); Tue, 31 Jul 2018 12:10:03 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:47012 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732302AbeGaQKD (ORCPT ); Tue, 31 Jul 2018 12:10:03 -0400 Received: by mail-pg1-f195.google.com with SMTP id p23-v6so9163422pgv.13 for ; Tue, 31 Jul 2018 07:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wIQG573o+JRvmpcvV7ZUMk/gkWZriOscBdmFH2glTqI=; b=jXCwTA297x453Z/LiGh6dwi+Yk+kE7rG0T5pJRZF0C3sXkr++MQwZz/5C0Z7JJerdz qaUiVyHu9rFn4MoYGiTsiOenOWJ6wvX+wigUh9Wgqp+r9eu4Y4XnLyG8z0rWf/lEmdG3 m5k08c/sbG/t1dmAIG2oaew2b4q3LLsw+YEuYLG13gLH2jAPynge1Yvu+sn9k0IK82LS Jg+luqjnsNlfEKKYAcogtN/NFDl5Dr0iczqzC+SmCsBRTNyHPBsJQf5GIQukt3vJ6nvP omo3HKeYu8Wm69F8TkBX9oXYUSKDNwFg2hJoS1ZKnWD6KSoARh3nzktqErjnJR/92hjY bj/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wIQG573o+JRvmpcvV7ZUMk/gkWZriOscBdmFH2glTqI=; b=uN/MGdoIPqZXH1SL82O6oXKxG8QZIt93ycBBIBd2UQu+f0EDvhLfHwbedII5yjSDFT D6yBmAJqzHZh/JrxEdN2s/3M2CLfx9W7G7+2RXYWZSUVN0jhBXXL2sqJQXtIWORPRv+V uZ4Fj4wGLQEdC099nBorLiBmcOGTgYbZ/uiz3qV3KaWryYAPwGLqyDdYruf3sIWtGPdF 3g9Hp27IcwUPBhzrZhIbF0ZtB7ulrsnC7XU9rrXkZ85k4lo4qvgg2xOeTMlS+SnXYvZd TS3jxmIwgXVgKx9os+sjBbJq02e7NhpGdpZl+VShG8BKy1vgVRIB9y8iWEvQB4L/f7Ah eIkA== X-Gm-Message-State: AOUpUlHcO9K2oYykhUD5+oeRbA+TUDP3zUps003PU+wY3swWaFH3WHeI 2jZuYS1ooyh990p6tYxExGOhfw== X-Received: by 2002:a63:3c0c:: with SMTP id j12-v6mr20396542pga.440.1533047368297; Tue, 31 Jul 2018 07:29:28 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:258b:eb0a:93b4:e6a8? ([2601:646:c200:7429:258b:eb0a:93b4:e6a8]) by smtp.gmail.com with ESMTPSA id l3-v6sm20102954pff.8.2018.07.31.07.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jul 2018 07:29:27 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting From: Andy Lutomirski X-Mailer: iPhone Mail (15G77) In-Reply-To: <20180731091248.GS2494@hirez.programming.kicks-ass.net> Date: Tue, 31 Jul 2018 07:29:26 -0700 Cc: Rik van Riel , Andy Lutomirski , LKML , kernel-team , X86 ML , Vitaly Kuznetsov , Ingo Molnar , Mike Galbraith , Dave Hansen , Catalin Marinas , Benjamin Herrenschmidt Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180728215357.3249-1-riel@surriel.com> <20180728215357.3249-11-riel@surriel.com> <20180729155452.37eddc11@imladris.surriel.com> <20180730095502.GG2494@hirez.programming.kicks-ass.net> <1532961011.28585.30.camel@surriel.com> <20180730162653.GM2494@hirez.programming.kicks-ass.net> <1532999155.28585.56.camel@surriel.com> <20180731091248.GS2494@hirez.programming.kicks-ass.net> To: Peter Zijlstra Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jul 31, 2018, at 2:12 AM, Peter Zijlstra wrote: >=20 >> On Mon, Jul 30, 2018 at 09:05:55PM -0400, Rik van Riel wrote: >>> On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: >>>=20 >>> So for ARCH_NO_ACTIVE_MM we never touch ->active_mm and therefore >>> ->active_mm =3D=3D ->mm. >>=20 >> Close, but not true for kernel threads, which have a=20 >> NULL ->mm, but a non-null ->active_mm that gets passed >> to enter_lazy_tlb(). >=20 > I'm confused on the need for this. We mark the CPU lazy, why do we still > care about this? I have considered renaming enter_lazy_tlb() to something like lazy_switch_to= _kernel_mm() (or an irqs_off variant) and making it take no parameters or ma= ybe just task pointer parameters. M=