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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 19F3BC4361B for ; Sat, 5 Dec 2020 04:49:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99EFB22B4E for ; Sat, 5 Dec 2020 04:49:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99EFB22B4E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1EB096B005D; Fri, 4 Dec 2020 23:49:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 179426B0068; Fri, 4 Dec 2020 23:49:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E95FE6B006C; Fri, 4 Dec 2020 23:49:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id CDF786B005D for ; Fri, 4 Dec 2020 23:49:11 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 94AD1181AEF30 for ; Sat, 5 Dec 2020 04:49:11 +0000 (UTC) X-FDA: 77557999302.23.drop45_0405913273ca Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 74AB937604 for ; Sat, 5 Dec 2020 04:49:11 +0000 (UTC) X-HE-Tag: drop45_0405913273ca X-Filterd-Recvd-Size: 5519 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Sat, 5 Dec 2020 04:49:10 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id iq13so4327939pjb.3 for ; Fri, 04 Dec 2020 20:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=8K5w8jDXkKIlAngW/XG7feDMYwmdKQNqo3uNmj5tiHg=; b=hYrtKqIDsBey9XtGHSIn0Bg7onNveij1HRFaHy9NAT8RO52Hqr03V26BGscp7X7CN+ yd8n/Zyn0Umq/3pX7RhQIKWuCYjKZwO48ER0FE07sfBRLKZO8pbMUWpMA6O98+eFyGm+ RXFHC3/u1Vi82UHwVdkjVhC5qnvJa/xn7RUpM+ytoWsqMa/zo+5rH4A8NXU3H+jrBO2V ODKk31Gfzzq4v622z7u+bLuqoFNUe/5RydNnSz3bWku7+Grocps27gRlbTEx6RhCdG6f cX1hU41DTIG/zzPiDOHGcoEx5siB5+6BI/RQp/Mw44cS6if02xsNGtcme+Gjq041HeQV xf7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=8K5w8jDXkKIlAngW/XG7feDMYwmdKQNqo3uNmj5tiHg=; b=hyiIz7anzgXBw1V4vmx7UGf332zfiMw32w/B3Q8/2Pg64Nfj0XjAWG0eoTMeXkzbKe sKMuncCb9TaS7xboWU8LJOdq4+95empgZ3i/JtqBqt+SLzLaBkYMmjrNyRbOhEe5gvKJ 7Lo0vQUQf0kt4Smrcn9u99+a+f3GRccxeDeZeVyuvSFP6sIwbiRpjc4JPVNN2HWXJaYV cYdzNGEiUZiMnhXfkCWUjYwE5iKgQRU2XbhudmhackccdQOBV6Fsj4ye5Jz3fXg+dnIn JKsjJvB5P7DkOEozn48MJfzylqgT6dA8ADx+VbUXOq7vAwWTzTMo7S3IFLOEALR731/Y Mw2w== X-Gm-Message-State: AOAM532OX3b+eL2XIRrVKijqXLGNAE/j4jCqrvuW8vEfFsYiJs7u9O8z Pu9PBp/eX1+ENoq+N4eNtZY= X-Google-Smtp-Source: ABdhPJw/E26yjJEohaTP7ApEdDRtaSfWTjVTMQOkzfNuPiHlz5TFw2OnaE0hnGXZ8o7aQSs7ynbtnA== X-Received: by 2002:a17:90a:9289:: with SMTP id n9mr4238282pjo.67.1607143750294; Fri, 04 Dec 2020 20:49:10 -0800 (PST) Received: from localhost ([1.129.238.242]) by smtp.gmail.com with ESMTPSA id 126sm5352861pgg.46.2020.12.04.20.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 20:49:09 -0800 (PST) Date: Sat, 05 Dec 2020 14:49:04 +1000 From: Nicholas Piggin Subject: Re: [RFC v2 2/2] [MOCKUP] sched/mm: Lightweight lazy mm refcounting To: Andy Lutomirski Cc: Anton Blanchard , Arnd Bergmann , Catalin Marinas , Dave Hansen , Jann Horn , linux-arch , LKML , Linux-MM , linuxppc-dev , Andy Lutomirski , Mathieu Desnoyers , Nadav Amit , Rik van Riel , Will Deacon , X86 ML References: <1607065599.ecww2w3xq3.astroid@bobo.none> In-Reply-To: MIME-Version: 1.0 Message-Id: <1607141044.0ibmnpwoeq.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Excerpts from Andy Lutomirski's message of December 5, 2020 12:37 am: >=20 >=20 >> On Dec 3, 2020, at 11:54 PM, Nicholas Piggin wrote: >>=20 >> =EF=BB=BFExcerpts from Andy Lutomirski's message of December 4, 2020 3:2= 6 pm: >>> This is a mockup. It's designed to illustrate the algorithm and how th= e >>> code might be structured. There are several things blatantly wrong wit= h >>> it: >>>=20 >>> The coding stype is not up to kernel standards. I have prototypes in t= he >>> wrong places and other hacks. >>>=20 >>> There's a problem with mm_cpumask() not being reliable. >>=20 >> Interesting, this might be a way to reduce those IPIs with fairly=20 >> minimal fast path cost. Would be interesting to see how much performance= =20 >> advantage it has over my dumb simple shoot-lazies. >=20 > My real motivation isn=E2=80=99t really performance per se. I think there= =E2=80=99s considerable value in keeping the core algorithms the same acros= s all architectures, and I think my approach can manage that with only a si= ngle hint from the architecture as to which CPUs to scan. >=20 > With shoot-lazies, in contrast, enabling it everywhere would either malfu= nction or have very poor performance or even DoS issues on arches like arm6= 4 and s390x that don=E2=80=99t track mm_cpumask at all. I=E2=80=99m sure w= e could come up with some way to mitigate that, but I think that my approac= h may be better overall for keeping the core code uniform and relatively st= raightforward. I'd go the other way. The mm_cpumark, TLB, and lazy maintainence is=20 different between architectures anyway. I'd keep the simple refcount, and the pretty simple shoot-lazies approaches for now at least until a bit more is done on other fronts. If x86 is shooting down lazies on=20 the final TLB flush as well, then I might be inclined to think that's the better way to go in the long term. Shoot-lazies would be a bit of a bolted on hack for powerpc/hash but it has ~zero impact to core code really. Thanks, Nick