Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1890223rwi; Thu, 20 Oct 2022 19:24:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4dQn5FT2GcOXXAh2Kdy4WhXXDUcuKtOi4d/Hrf2wCF2z+CMeGj0sopltl5CMFuWgA2uTda X-Received: by 2002:a17:907:d90:b0:78d:48b1:496d with SMTP id go16-20020a1709070d9000b0078d48b1496dmr13890832ejc.665.1666319052282; Thu, 20 Oct 2022 19:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666319052; cv=none; d=google.com; s=arc-20160816; b=PIP1Ip+uO+RfrRKbJM0UHnlyDN2oJlY6y79zlnq0qWoydZEoUuMh+KIa+jS5torlyW hz8nyqkVbnTWOut1x3RrgAuvyRQoyI9blSYp293lyJoTw5koyAaJ3DxquLNFkvkU4Eik 53HKPdPpFzDMlVq/pP6IpS8F0adzhSxK5cOvAGfej2BxsrdZFkLp/M1ild97cEqo4TvS ulIS4+ggbfU4lB9oLQagasC7Oy0qCbHvxYPVRXOq7fmH+qIjM7V0tKh76LSARZpds0VD M91UP5JWk+/UCaSanAzNYNyKkf9mOWwQad3Pc7j9G9XYJAGVLy74SCoZyb5L3D7/ZN/Z i/4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ASIrxtSBDsxk4HGQqbLDireIOxv7TbGHiig0CHntdSI=; b=U/kOIy4oirUANqMTcBK3pM8VJgOH0SjursZfp/MsKq/GSahjhCu+5zASPtxjSbw5hu H2x1QnDX4nCha7Oz1Ec53Xhcpw38Hq4Qmyn40WQQAgfoQ8MY3rB5jB3BQMHEPrwaITr7 UrKceCntsTBSaUQFEzR+isNA83iO+nLRJm8rgYlxUnLzOGSY9Ug0W09JRyHqaT+Efy4t mcafDGy+fxWP9xZ0wfwyNcovdOUW8LjApLSB9nrhUfR1+NU4t4/bCLhr90pQuimsRUNA be2bVaSb+WNd1cCCVX++XfAyyaU47fUvJ2WJrZlheAsD08ewamoSPDkM2DeoJRUSeIve yO0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=d0RcTWc1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba13-20020a0564021acd00b0044e702cd711si15785586edb.98.2022.10.20.19.23.46; Thu, 20 Oct 2022 19:24:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=d0RcTWc1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229802AbiJUCLT (ORCPT + 99 others); Thu, 20 Oct 2022 22:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbiJUCLR (ORCPT ); Thu, 20 Oct 2022 22:11:17 -0400 Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EE001EA573 for ; Thu, 20 Oct 2022 19:11:16 -0700 (PDT) Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1322d768ba7so1880037fac.5 for ; Thu, 20 Oct 2022 19:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ASIrxtSBDsxk4HGQqbLDireIOxv7TbGHiig0CHntdSI=; b=d0RcTWc1MKBOhhT5dKEG1Usy/aOhsV4HKs+lZmjbd5YXaVGizlNl0Eie/W1sistU3G 5sKn7isal7vO0hl/3+xRKCOlZ1eBybkH73NcCluO/7XBbtsmJ6Fw5Wjx2PKGV4IR35QH +YloN2juFf0i7OOlQFZH+/wfTO9SBo0yFEw6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ASIrxtSBDsxk4HGQqbLDireIOxv7TbGHiig0CHntdSI=; b=gGYQOPS1rqX24sJZrS8/WFFnuFmWZZ1ogNOhaHpWKV2ra6qKW8REwaYxQCas7M0p5v O6eve22bM1j8wUTW8XwXz6z+i+JtBO2j/34dtnscGJfjzUETaSI3fAzAUsE+AamCgKc/ aPIk6lHYmlf3emDdfj4buW1O414CXfANRZjXhWVg8och5nh5vt7bZrWIhpAIYR8xf9mZ U/TSxK3KV72iEXRGywyHgqUMBdBXVslUtr/tHoW/6przLSPAqNxKm98jr3cchsgq47a4 /es8jws7eKhmPCPwF29cFAqyGI57Jm5WadjPmLYDmf+HsY7q4j6r3xSWtx7oTP22GVCB WmsQ== X-Gm-Message-State: ACrzQf3MLcT2vZF6bN59pf7dFsE3bAsgCtyPB28IOxgSEI6Wj4b4nUlH eEZGwFvxu8YrRQUIbXX7EzznMYLLsGZPFA== X-Received: by 2002:a05:6870:8a14:b0:132:5c65:1024 with SMTP id p20-20020a0568708a1400b001325c651024mr11618527oaq.291.1666318275666; Thu, 20 Oct 2022 19:11:15 -0700 (PDT) Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com. [209.85.161.41]) by smtp.gmail.com with ESMTPSA id l7-20020a056808020700b00354b0850fb6sm626699oie.33.2022.10.20.19.11.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 19:11:14 -0700 (PDT) Received: by mail-oo1-f41.google.com with SMTP id j6-20020a4ab1c6000000b004809a59818cso250563ooo.0 for ; Thu, 20 Oct 2022 19:11:14 -0700 (PDT) X-Received: by 2002:a05:6902:1352:b0:6bb:3f4b:9666 with SMTP id g18-20020a056902135200b006bb3f4b9666mr13522092ybu.101.1666318263133; Thu, 20 Oct 2022 19:11:03 -0700 (PDT) MIME-Version: 1.0 References: <20220815071332.627393-1-yuzhao@google.com> <20220815071332.627393-9-yuzhao@google.com> In-Reply-To: From: Linus Torvalds Date: Thu, 20 Oct 2022 19:10:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v14 08/14] mm: multi-gen LRU: support page table walks To: Peter Zijlstra , "the arch/x86 maintainers" Cc: Yu Zhao , Andrew Morton , Andi Kleen , Aneesh Kumar , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Johannes Weiner , Jonathan Corbet , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Mike Rapoport , Tejun Heo , Vlastimil Babka , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , =?UTF-8?Q?Holger_Hoffst=C3=A4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh , Vaibhav Jain Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 20, 2022 at 11:55 AM Peter Zijlstra wrote: > > On Thu, Oct 20, 2022 at 10:35:28AM -0700, Linus Torvalds wrote: > > That said, I reacted to that cmpxchg loop: > > > > } while (cmpxchg64(&pmdp->pmd, old.pmd, 0ULL) != old.pmd); > > > > is this series just so old (but rebased) that it doesn't use "try_cmpxchg64()"? > > Yep -- it's *that* old :-/ You're not in fact the first to point that > out. > > I'll make time tomorrow to fix it up and respin and send out. This is as > good a time as any to get rid of carrying these patches myself. Hmm. Thinking some more about it, even if you do it as a try_cmpxchg64() loop, it ends up being duplicated twice. Maybe we should just bite the bullet, and say that we only support x86-32 with 'cmpxchg8b' (ie Pentium and later). Get rid of all the "emulate 64-bit atomics with cli/sti, knowing that nobody has SMP on those CPU's anyway", and implement a generic x86-32 xchg() setup using that try_cmpxchg64 loop. I think most (all?) distros already enable X86_PAE anyway, which makes that X86_CMPXCHG64 be part of the base requirement. Not that I'm convinced most distros even do 32-bit development anyway these days. (Of course, if we require X86_CMPXCHG64, we'll also hit some of the odd clone CPU's that actually *do* support the instruction, but do not report it in cpuid due to an odd old Windows NT bug. IOW, things like the Cyrix and Transmeta CPU's did support the instruction, but had the CX8 bit clear because otherwise NT wouldn't boot. We may or may not get those cases right, but I doubt anybody really has any of those old CPUs). We got rid of i386 support back in 2012. Maybe it's time to get rid of i486 support in 2022? That way we could finally get rid of CONFIG_MATH_EMULATION too. Linus