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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BC03C433F5 for ; Sun, 9 Jan 2022 06:49:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68C766B0072; Sun, 9 Jan 2022 01:49:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 63BDD6B0073; Sun, 9 Jan 2022 01:49:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DC3E6B0074; Sun, 9 Jan 2022 01:49:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 3AFC46B0072 for ; Sun, 9 Jan 2022 01:49:18 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DD1E61809AC31 for ; Sun, 9 Jan 2022 06:49:17 +0000 (UTC) X-FDA: 79009821954.18.1DEDC47 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf29.hostedemail.com (Postfix) with ESMTP id 61C2712000B for ; Sun, 9 Jan 2022 06:49:17 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id z9so40149098edm.10 for ; Sat, 08 Jan 2022 22:49:17 -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:content-transfer-encoding; bh=5Qe5bfEPRSa8qK/jSdSjDeCU764BYhwj22IPnPyW9vs=; b=EZcm14tvQ2pTgwy34oZJOq2kJpxpBRDXnT7iNCcdccnLhGzBufgAhtztl1veAhf1go P/NRzFVUIHGptU0ISVbmnPiWEi1qkQqspVHDeITa/jsG8J/fyaHLKADfvZEVhW5AMExn cL6kENpOhF/Tm82ClxhGN+zQfHiX1OPVYCcT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5Qe5bfEPRSa8qK/jSdSjDeCU764BYhwj22IPnPyW9vs=; b=U210DBMxaIBtkHwQJNbFgcaURex12n6BK/8FYqtmfZxy7IZHHssxzFINUS/SYXMVuF /k2lHnyeS1UiArhKOycOKqoWKtGUkVFRxH4vXZwl/aMs9CpmsuhDgASSNxZzuPg08n60 xx+j7Mwbhs7DDtL0yORjLYa4IiKSZWhxDghykdwUegynHb5YN+hELXRVVXUPsEHskcd+ b/dZvQxUnky2MgpiTN4J29bL6UT2PM4S9EF0yqyyeAX+yE84nNmzgRj3NNdq9nH4i32u 3uAHU1YRy9weAxN6g6XDRhEEkSTaBydhIfKuro++LQYRZKShuXHx5dDsak/KQcJ8Aidh ITyw== X-Gm-Message-State: AOAM530HHIekG2Y6vzfyOv9EWIRGbbSYseaTx8TToEe3AmXR4G78QACH eJiYTZMvE3uOBR5y6HvvObcRFVCPVeVfU7dBPdk= X-Google-Smtp-Source: ABdhPJx9CDpc0iBeYZXJQypyZ1kCpikFau71fmvpABJsnbsetmxMS1zk1qSsds1yHBSHEwh7ZhhVOw== X-Received: by 2002:a17:906:d8c:: with SMTP id m12mr10446114eji.411.1641710955835; Sat, 08 Jan 2022 22:49:15 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id f23sm1125629ejj.128.2022.01.08.22.49.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Jan 2022 22:49:15 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id d187-20020a1c1dc4000000b003474b4b7ebcso4729034wmd.5 for ; Sat, 08 Jan 2022 22:49:15 -0800 (PST) X-Received: by 2002:a05:600c:4f49:: with SMTP id m9mr17141316wmq.8.1641710954863; Sat, 08 Jan 2022 22:49:14 -0800 (PST) MIME-Version: 1.0 References: <7c9c388c388df8e88bb5d14828053ac0cb11cf69.1641659630.git.luto@kernel.org> <739A3109-04DD-4BA5-A02B-52EE30E820AE@gmail.com> In-Reply-To: <739A3109-04DD-4BA5-A02B-52EE30E820AE@gmail.com> From: Linus Torvalds Date: Sat, 8 Jan 2022 22:48:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 16/23] sched: Use lightweight hazard pointers to grab lazy mms To: Nadav Amit Cc: Andy Lutomirski , Andrew Morton , Linux-MM , Nicholas Piggin , Anton Blanchard , Benjamin Herrenschmidt , Paul Mackerras , Randy Dunlap , linux-arch , X86 ML , Rik van Riel , Dave Hansen , Peter Zijlstra , Mathieu Desnoyers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=EZcm14tv; dmarc=none; spf=pass (imf29.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.44 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 61C2712000B X-Stat-Signature: dt1p5cjgckq8ztuim398w8dj8aymc3bm X-HE-Tag: 1641710957-218655 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: On Sat, Jan 8, 2022 at 9:56 PM Nadav Amit wrote: > > Just wondering: In a world of ASID/PCID - does the =E2=80=9Clazy TLB=E2= =80=9D really > have a worthy advantage? > > Considering the fact that with PTI anyhow address spaces are switched > all the time, can=E2=80=99t we just get rid of it? Hmm.. That may indeed be the right thing to do. I think arm64 already hardcodes ASID 0 to init_mm, and that kernel threads (and the idle threads in particular) might as well just use that. In that kind of situation, there's likely little advantage to reusing a user address space ID, and quite possibly any potential advantage is overshadowed by the costs. The lazy tlb thing goes back a *looong* way, and lots of things have changed since. Maybe it's not worth it any more. Or maybe it's only worth it on platforms where it's free (UP, possibly other situations - like if you have IPI and it's "free"). If I read the history correctly, it looks like PF_LAZY_TLB was introduced in 2.3.11-pre4 or something. Back in summer of 1999. The "active_mm" vs "mm" model came later. Linus