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 7C802C433F5 for ; Sun, 9 Jan 2022 21:58:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 881886B0072; Sun, 9 Jan 2022 16:58:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 80A8D6B0073; Sun, 9 Jan 2022 16:58:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AA356B0074; Sun, 9 Jan 2022 16:58:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 572D86B0072 for ; Sun, 9 Jan 2022 16:58:48 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0B54095AE4 for ; Sun, 9 Jan 2022 21:58:48 +0000 (UTC) X-FDA: 79012113936.16.2818168 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf14.hostedemail.com (Postfix) with ESMTP id A31A3100006 for ; Sun, 9 Jan 2022 21:58:47 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id m1so4580254lfq.4 for ; Sun, 09 Jan 2022 13:58:47 -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=vAmdahK+dyjevXdPfaG3db/HofoiSn0UPXYkRU3G81Y=; b=IgQWV2jOfLW3hrvXADZvYfvhegngvZHmQuGNoQqURYODIWe6cb+OAttHHaEu8CPiM0 cqcYCrle5SSBD4WLI06a4FsA7OypGS3+MfzSaa4mLrMzv69tsfms/kpAODZirvOcY1zN 8I05HQeeLYKw7m7n8QMm4PljVLWgt4t4NXA8o= 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; bh=vAmdahK+dyjevXdPfaG3db/HofoiSn0UPXYkRU3G81Y=; b=gvwTSk622oZ1I+4CkKJKG2p6EQiB2ABq60uCQVANF+NlPtVKt/NjS7o6jhEtgGX3fM J52czkHVwbtPcQMC3gi7etk05Evm6DYMKLjH66myP8kWDmfmVRVdZzxuyh/yipIllkqE zo8DozEURbj3vjLpe6kpFT6an39q45e4B+JxHraXL7SHQ/5SSsrdCDTv6SJgBg2Pyz9y f3UV+kqD5E1HNQwRkRVP12rAzUJVDVPFr5ylrSizDCXdOH05sa+UrvI+a2EirP/qPFKP O62pyYtN5kp2E6r+RA9zmDvU1LMCCUaPGpK6xieralol+78Qg4b+Az0XGGh5fDMecvQ4 qINQ== X-Gm-Message-State: AOAM533gJMBjLz4nZoAQ3uUkeVilenmT9qvYKFHBKtv6binq0RKNVsTY SmzrmLXOocesEjdQwnABZCMDRbN7tcm6cFhsdaQ= X-Google-Smtp-Source: ABdhPJxZbTrwIYl3Q9luPgEs6PzpUW78e/wEiA+eNjgagyY2ZeiC+5Hmir/ysWbYKAw7SQ6Nnhm5cw== X-Received: by 2002:a2e:b90d:: with SMTP id b13mr57709264ljb.253.1641765525706; Sun, 09 Jan 2022 13:58:45 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id q11sm721462lfe.9.2022.01.09.13.58.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Jan 2022 13:58:45 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id u13so37677255lff.12 for ; Sun, 09 Jan 2022 13:58:45 -0800 (PST) X-Received: by 2002:a05:6000:10d2:: with SMTP id b18mr61909226wrx.193.1641765096117; Sun, 09 Jan 2022 13:51:36 -0800 (PST) MIME-Version: 1.0 References: <7c9c388c388df8e88bb5d14828053ac0cb11cf69.1641659630.git.luto@kernel.org> <3586aa63-2dd2-4569-b9b9-f51080962ff2@www.fastmail.com> <430e3db1-693f-4d46-bebf-0a953fe6c2fc@www.fastmail.com> <484a7f37-ceed-44f6-8629-0e67a0860dc8@www.fastmail.com> In-Reply-To: From: Linus Torvalds Date: Sun, 9 Jan 2022 13:51:20 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 16/23] sched: Use lightweight hazard pointers to grab lazy mms To: Andy Lutomirski Cc: Will Deacon , Catalin Marinas , Andrew Morton , Linux-MM , Nicholas Piggin , Anton Blanchard , Benjamin Herrenschmidt , Paul Mackerras , Randy Dunlap , linux-arch , "the arch/x86 maintainers" , Rik van Riel , Dave Hansen , "Peter Zijlstra (Intel)" , Nadav Amit , Mathieu Desnoyers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A31A3100006 X-Stat-Signature: ie947g69ss33nwfr8nu9m57wr9gkmw4w Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=IgQWV2jO; dmarc=none; spf=pass (imf14.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.49 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-Rspamd-Server: rspam11 X-HE-Tag: 1641765527-552665 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: [ Ugh, I actually went back and looked at Nick's patches again, to just verify my memory, and they weren't as pretty as I thought they were ] On Sun, Jan 9, 2022 at 12:48 PM Linus Torvalds wrote: > > I'd much rather have a *much* smaller patch that says "on x86 and > powerpc, we don't need this overhead at all". For some reason I thought Nick's patch worked at "last mmput" time and the TLB flush IPIs that happen at that point anyway would then make sure any lazy TLB is cleaned up. But that's not actually what it does. It ties the MMU_LAZY_TLB_REFCOUNT to an explicit TLB shootdown triggered by the last mmdrop() instead. Because it really tied the whole logic to the mm_count logic (and made lazy tlb to not do mm_count) rather than the mm_users thing I mis-remembered it doing. So at least some of my arguments were based on me just mis-remembering what Nick's patch actually did (mainly because I mentally recreated the patch from "Nick did something like this" and what I thought would be the way to do it on x86). So I guess I have to recant my arguments. I still think my "get rid of lazy at last mmput" model should work, and would be a perfect match for x86, but I can't really point to Nick having done that. So I was full of BS. Hmm. I'd love to try to actually create a patch that does that "Nick thing", but on last mmput() (ie when __mmput triggers). Because I think this is interesting. But then I look at my schedule for the upcoming week, and I go "I don't have a leg to stand on in this discussion, and I'm just all hot air". Because code talks, BS walks. Linus