Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5263035imm; Tue, 31 Jul 2018 08:05:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0dKwstqcz/mv/OH6VlpZkLWNmPTuNiK2+EkZA6kp+nsapOBds8bUrJNxBDwFnKWVwHpl+ X-Received: by 2002:a62:e0d5:: with SMTP id d82-v6mr22662944pfm.59.1533049546454; Tue, 31 Jul 2018 08:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533049546; cv=none; d=google.com; s=arc-20160816; b=TWygIrLr2IY1iL8bMI8Y9sM9KVA8OsXaqlpvW4dGlhR0BxLIFUvq3/4gGRZOSJO6QU CIdKIfc8vOFYofnUsmNNdibh8HX4pEAwBAUtRURp6DhFJXzB3tLkgGx/v793M0luMKrn UDeQX1B6uP9QeOAGFisk7YsJXwOVskyVdXQvViZ5XEiwLGJTvV7xpQBwLB7ywDVa59zg ciLuKdwpzc/5+nOYAgG8BjbpmnZBUSiuH3Hk/ron2lwogcaskYIoBNem7dz/ee+HTdAp c2d7XzaScoHJ+CO1VC4mpVOd9e46SE/8eZTsZdbLkpDT0dQq5de8+kvXbOUYwYouJBuD rfhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:arc-authentication-results; bh=+L1QW/7ZiLb+9rntjTgacGn/HVm2+m0uK7va0v03H44=; b=YHxgfnwqSHUc5/ducDg5bKUBlTbJpjvsMPNUJY9zt6X2dm8CsRKYhrfahdTL/ICUrM IG4XcBiQuBgS/95k22UI62LEWOG9HDpW9TzhqAMStANcCsTkG/uUac+WnyEDBEu80vy9 2zGRQrS0i3yOUdiJRRhzL8nUNkhhpyf8OxzULqUCKyqBDu2hfrMxYyqh+Q1sasTvfKH1 194WI+7OKo2RssyiOkV4R+vXn3gTTTrCpe3wBGyY9lK8tGkHoBiQRdxTS0XVLxm8stRm +7HoClpeOOViOPj1MdplG3Ad9aDDm0+QH03vEfKDah/Hj15kVSHW8c+8qCQL/CoEb0p4 Wudw== ARC-Authentication-Results: i=1; mx.google.com; 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 k80-v6si14713256pfg.42.2018.07.31.08.05.31; Tue, 31 Jul 2018 08:05:46 -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; 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 S1732405AbeGaQoE (ORCPT + 99 others); Tue, 31 Jul 2018 12:44:04 -0400 Received: from shelob.surriel.com ([96.67.55.147]:58124 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727495AbeGaQoE (ORCPT ); Tue, 31 Jul 2018 12:44:04 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fkWAy-0005Hk-21; Tue, 31 Jul 2018 11:03:04 -0400 Message-ID: <1533049383.28585.61.camel@surriel.com> Subject: Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting From: Rik van Riel To: Andy Lutomirski , Peter Zijlstra Cc: Andy Lutomirski , LKML , kernel-team , X86 ML , Vitaly Kuznetsov , Ingo Molnar , Mike Galbraith , Dave Hansen , Catalin Marinas , Benjamin Herrenschmidt Date: Tue, 31 Jul 2018 11:03:03 -0400 In-Reply-To: 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> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-DQXFWMDZjKgxDx2ESj82" X-Mailer: Evolution 3.26.6 (3.26.6-1.fc27) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-DQXFWMDZjKgxDx2ESj82 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2018-07-31 at 07:29 -0700, Andy Lutomirski wrote: > > 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? >=20 > 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 maybe just task pointer parameters.=20 Of all the architectures, only Alpha uses the "mm" parameter to enter_lazy_tlb. It uses it to store the pgd address of the current active_mm context into the thread info of the next task. If it can get that from a per CPU variable, we can get rid of the mm parameter to enter_lazy_tlb. --=20 All Rights Reversed. --=-DQXFWMDZjKgxDx2ESj82 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAltgeicACgkQznnekoTE 3oOMuQf+NvhhBuYetEXNK5AdU/ugbzw3iuR8K0zUViFXScPrJ9v0pHyYrdHZeXaG DgQWeoOb4MK+qrFUGmlew3jXiemwiyG4iJv15iaOnNUULVeOhcIA3s+OkG9vUYHi tx60eYvsj1sfvlwzB826Bln+E3JpB8fzx3WCVGlsKR6Rw1WGmmlX3gg9tU8abPkk KwZdt0SVQLrRGfkes7mlLYvR8Pr/AJugLu4GXAD68exrEM12QH332wmMNA8wAeWE Z0cRL10mDXIMJ691bWrjXw5rdHjRjLrNJckhqQnLwNm2PYAbC9BJ6kc6OD2Jz5hW MHDgONbx/qjxUD/CHcMlK2/dw5WOWg== =T/cJ -----END PGP SIGNATURE----- --=-DQXFWMDZjKgxDx2ESj82--