Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5780621rwi; Sun, 23 Oct 2022 11:48:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+cR4ALjDB7UQ6fP19J3DZMnSwMZVok/VhyAC/3U9zOLhoZ4co/uhQlM+SlPdbIT9l59Zn X-Received: by 2002:a17:907:628f:b0:72f:57da:c33d with SMTP id nd15-20020a170907628f00b0072f57dac33dmr24156459ejc.374.1666550888588; Sun, 23 Oct 2022 11:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666550888; cv=none; d=google.com; s=arc-20160816; b=tqTx3GlwSMO25uMT8pmjLnI1JIEyJ777SIMdiFC8PIMwZggKH8CwMWCpRahO+uq7d0 2dJ6d4N4QnUovweIbr027Icjb7JbwyZ9LKvJElprDH7Ru4w6NmHKmIspwnv5Y5fb/RwT C7Mr015vwZp+o7YM33cav76JsYJuV3zUMqMXEdojJzSkQ8XjWdk9oVfaO/t9dWxzyslR p5w9L0Kb5eV34QPYpBN5kHMfU8o7CK4KCPbBgQoQKTdyxLH+z4NoTG5KLKVodr3GrM6s w6f/an/jP527zxuZBGRZb7DVZyE+91qbSdgkOTVJ0P4K7QkDvfy4AsNhhiq/DeaWViDx gLzQ== 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=NFwZa2BSHLpJ/lHsM1/KFIQbs54rf/ACzYwP1+4ugaw=; b=YEgeqo+OI1DWaK5VyiWUN4P45Y67jUb9WPH4AxqWL3pY68gUWk/kkK/dpfSu1gpwgm ARALe1KgoqgDjYMoVPFYrgHLj5yHslWefBvtx6/hBsbi4QjVhizBi/eLm89339aTefp+ WK/yC9Todwjz7g/MY2ew4+le7zic18eSWSxlpTghMvYckqUt3YZHAyeJzu/uoBcnUInv OSrh1KS1u/Kg3s8wd0zL+EiXMdmmbjgUqWG8VUgyjTp0NQKJK2MILWYHoJuGq5hOJYe7 2zsirtufT2vrrbA8CDbIS/GGbMK6TtHx8IDwMJI5OTLAxtBma0GDUHvroAulkKomxkir tVRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ITvi3rBP; 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 f7-20020a056402354700b0043d00293d23si27267898edd.391.2022.10.23.11.47.43; Sun, 23 Oct 2022 11:48:08 -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=ITvi3rBP; 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 S230396AbiJWSg3 (ORCPT + 99 others); Sun, 23 Oct 2022 14:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbiJWSg1 (ORCPT ); Sun, 23 Oct 2022 14:36:27 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5834C74B85 for ; Sun, 23 Oct 2022 11:36:24 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id y67so8893560oiy.1 for ; Sun, 23 Oct 2022 11:36:24 -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=NFwZa2BSHLpJ/lHsM1/KFIQbs54rf/ACzYwP1+4ugaw=; b=ITvi3rBPRo+s4zvDf4M4WyGOffaL0RJJNGqOZQuErWkjAEPNfnRmZ4B3ffcQdmzvMp WMf6Xbdnhk06ww0KbNPn18ZNGaQKwWK7VGEfphxAytN6Uiiy83nDtpGOHdzkA6UAtpg/ 807/T6zRKYGlv2Lw3Vx2FQfKIAMWBz1+NxzXs= 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=NFwZa2BSHLpJ/lHsM1/KFIQbs54rf/ACzYwP1+4ugaw=; b=tFKOlvst2Ez4/Vqi8+a+QlHF/S4JU3CMDdSr1n/ljtfKG9xO6aAZIKbfXzCbeHvdHH b8nY92jg2fkra06FG4GtgHy7nXen2hF6h7/O+y+Ofv/SnQKMkqOI/z1Pdz6DAPp+uyPf tsvBeaUU0gV+nPQr8BrtD/I8MLw0SzbFGd5FMfMAkjmhYgz07CcPnj1lpK8+Zys062tJ e9VU0iLmJRXPr2OSbecVkPBj8pAFfBOcHldCjdlO+E3DrziM/hkEZtu+CKGQnGJBRnlZ UldKBwz3z+4qSWyDpRCFTBNB21kO3MsuEMELFKdEhaaZ38lUyJp5R/8d0dysmgiTiPRL kzxw== X-Gm-Message-State: ACrzQf2yzr8hFQaS/XW8DydmpxblzVTA2b+chJtPx+YBBjZO6CmqCZcX 9R5rmj0SxwMGt5qYiCcQSUFMr8FnsbHYvQ== X-Received: by 2002:a05:6808:3097:b0:355:347e:2df6 with SMTP id bl23-20020a056808309700b00355347e2df6mr19200999oib.44.1666550183972; Sun, 23 Oct 2022 11:36:23 -0700 (PDT) Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com. [209.85.161.42]) by smtp.gmail.com with ESMTPSA id g186-20020aca39c3000000b0035493cbd9absm3315780oia.21.2022.10.23.11.36.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Oct 2022 11:36:22 -0700 (PDT) Received: by mail-oo1-f42.google.com with SMTP id r11-20020a4aa2cb000000b004806f49e27eso1145443ool.7 for ; Sun, 23 Oct 2022 11:36:21 -0700 (PDT) X-Received: by 2002:a81:114e:0:b0:36a:fc80:fa62 with SMTP id 75-20020a81114e000000b0036afc80fa62mr7845582ywr.58.1666550170598; Sun, 23 Oct 2022 11:36:10 -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: Sun, 23 Oct 2022 11:35:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v14 08/14] mm: multi-gen LRU: support page table walks To: "Maciej W. Rozycki" Cc: Matthew Wilcox , Peter Zijlstra , "the arch/x86 maintainers" , Yu Zhao , Andrew Morton , Andi Kleen , Aneesh Kumar , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Johannes Weiner , Jonathan Corbet , 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.8 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 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 Sun, Oct 23, 2022 at 10:55 AM Maciej W. Rozycki wrote: > > Given the presence of generic atomics we can emulate CMPXCHG8B easily > LL/SC-style using a spinlock with XCHG even on SMP let alone UP. We already do that (admittedly badly - it's not SMP safe, but 486-class SMP machines have never been supported even if they technically did exist), see arch/x86/lib/cmpxchg8b_emu.S arch/x86/lib/atomic64_386_32.S for some pretty disgusting code. But it's all the other infrastructure to support this that is just an unnecessary weight. Grep for CONFIG_X86_CMPXCHG64 and X86_FEATURE_CX8. We already have increasingly bad coverage testing for x86-32 - and your example of MIPS really doesn't strengthen your argument all that much, because MIPS has never been very widely used in the first place, and doesn't affect any mainline development. The odd features and CPU selection really do not help. Honestly, I wouldn't mind upgrading the minimum requirements to at least M586TSC - leaving some of those early "fake Pentium" clones behind too. Because 'rdtsc' is probably an even worse issue than CMPXCHG8B. In fact, I don't understand how current kernels work on an i486 at all, since it looks like exit_to_user_mode_prepare -> arch_exit_to_user_mode_prepare ends up having an unconditional 'rdtsc' instruction in it. I'm guessing that you don't have RANDOMIZE_KSTACK_OFFSET enabled? In other words, our non-Pentium support is ACTIVELY BUGGY AND BROKEN right now. This is not some theoretical issue, but very much a "look, ma, this has never been tested, and cannot actually work" issue, that nobody has ever noticed because nobody really cares. It took me a couple of minutes of "let's go hunting" to find that thing, and it's just an example of how broken our current support is. That RANDOMIZE_KSTACK_OFFSET code *compiles* just fine. It just doesn't actually work. That's the kind of maintenance burden we simply shouldn't have - no developer actually cares (correctly), nobody really tests that situation (also correctly - it's old and irrelevant hardware), but it also means that code just randomly doesn't actually work. Linus