Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2782357rwd; Fri, 19 May 2023 10:05:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xcg08yaGntL1QxN3VnyNKzpMJBbkJIo/rpt+2oSVOx4i+Mh3tR4VgdhUNStJqCJTuYei9 X-Received: by 2002:a17:903:1108:b0:1ad:be4d:5dfe with SMTP id n8-20020a170903110800b001adbe4d5dfemr3834637plh.27.1684515928213; Fri, 19 May 2023 10:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684515928; cv=none; d=google.com; s=arc-20160816; b=nngbRvKd3vMfnqkProDbb7OB+Vxk3aTwB1aOaGGvO11vhuoY7bjUvrYWleIAg7k8q5 OlvxvQbhwEITQ/N/069gBk0v6mLIUpKKSAEsr9VyQfT6l7VYuJgkDSnIIxULGA74WX+K qkMsRdDIrB4pT44dK4eeTOlyYgYx/2GRy++yrlPa88PQQOBiqcraBfmyb/i/9GVXCHRQ A0ipx7msanomrp3NqAZKTp2rizlIgDVsLswcwSKB9OW2uUt4Vm5EDZ+r2P3uDbN4k7pV aAGQ5Y2yEBCCpaDTY8ngpkwGBRYFl653kd9x3hzKVd6qEDccEV/ODhwZNGhk1r+f3Rin wcag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=yhZY0s/47MOrcmNsSFhuJoECsMYmmsbPIqp0mRoiHMk=; b=IJ1TrFUX3my5Fwc+UIVM45VKF/iIKhFwrkdmhHO5O4R6GZ0QofqybUf6hJTFYID3uD RW1kAGapWPfTMxFAvGFGS+VNFM+YW86bqjfTHpuNaidSOinETu5pJF8FqA4xcIUwZg8w k2AE0bsJukWFy0F6jJtqWJtbovrNveLx9E0wp/o6wolXoU4KrqDf7zW7wR0F1WIGnBC6 eF956DeQN3jRD4LWlnsT2B5haEE6fVIgdpF4+9PLtIxlzIFAdP+eKqoWBfJ5AAV42EBQ G+vr9PJUXQnFw7pinkIMEJgY460EpSAkA2JC+JKJxvp9UYQaywK0MS79v6Rqr/JqUMOb i+fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=bmwkQjhb; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="F/0hcqq3"; 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 w24-20020a1709027b9800b001aadf9e2d15si3675875pll.491.2023.05.19.10.05.08; Fri, 19 May 2023 10:05:28 -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=@arndb.de header.s=fm3 header.b=bmwkQjhb; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="F/0hcqq3"; 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 S231442AbjESQyE (ORCPT + 99 others); Fri, 19 May 2023 12:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbjESQyD (ORCPT ); Fri, 19 May 2023 12:54:03 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5F7114; Fri, 19 May 2023 09:53:58 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C366F5C0096; Fri, 19 May 2023 12:53:57 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Fri, 19 May 2023 12:53:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1684515237; x=1684601637; bh=yhZY0s/47MOrcmNsSFhuJoECsMYmmsbPIqp 0mRoiHMk=; b=bmwkQjhbHOWz5dV5Cd6mu/m1Neq0V0I8nt1NOZCDWzG5SRkJ7bj P68sMNZ1n2l+nY1r9MAUb1Qjku3q93PCLHKXv+K7IE8q6bhUeFiY1i5kpand7kjc ojYi3fDh5X0LikoQ8VmE4g6FzhYGPwLPDguwcol0BIEdrBKhwZECKa533dwog1tR 0Nfp6RB1q+JkmYzufde6dET3U5w2gRAFC5L8bmKWFR5jyt20wB/s5DXZP/l/e8fi jXi1jjDcLp3xUIIQ2q/vkvOX6iRGi75+ILf14+HoEI9SyJmE/WWqUQFWmKngM1fV KVvpvSOm2oaFxHBNNRsxceKvI26Si1OlNHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684515237; x=1684601637; bh=yhZY0s/47MOrcmNsSFhuJoECsMYmmsbPIqp 0mRoiHMk=; b=F/0hcqq3GiXxzveFwLkngpTXJrLwBoVWdcv09xFv0ZX1dnxfv+y n02DKYYcVysDM2IOCJu2W3bszb3AqbxenpZjIo8GLvM+wHb9LaaCSCS6vEq6EJbj 70EZzC0OP2uK6ursqDFKVlgGQx+mKlp8jP+aTAF5vEWKVRlo8tUgv9SqIyjyQoEp g+5p3mhRKa9KJrAcIxmsCxcLG0WlSqdT3Wf5hf7NWGmQaYr7Gt2K5DjIf/RLWhtZ uEvHq0qz2UtPL3cVtwN4/KrgjzbwFWyUvhPaKiZ4sUzTjNf7NWL/QZhy0esXi8Zi 2QPBNg4ihcPjrO1NBN5kNwXL3m7Res3pZ8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeihedguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedf tehrnhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrf grthhtvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudek tdfgjeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id ED0CCB6008D; Fri, 19 May 2023 12:53:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-431-g1d6a3ebb56-fm-20230511.001-g1d6a3ebb Mime-Version: 1.0 Message-Id: In-Reply-To: References: <556bebad-3150-4fd5-8725-e4973fd6edd1@app.fastmail.com> Date: Fri, 19 May 2023 18:53:35 +0200 From: "Arnd Bergmann" To: guoren Cc: "Palmer Dabbelt" , "Thomas Gleixner" , "Peter Zijlstra" , "Andy Lutomirski" , "Conor.Dooley" , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "Jisheng Zhang" , "Huacai Chen" , "Anup Patel" , "Atish Patra" , "Mark Rutland" , =?UTF-8?Q?Bj=C3=B6rn_T=C3=B6pel?= , "Paul Walmsley" , "Catalin Marinas" , "Will Deacon" , "Mike Rapoport" , "Anup Patel" , shihua@iscas.ac.cn, jiawei@iscas.ac.cn, liweiwei@iscas.ac.cn, luxufan@iscas.ac.cn, chunyu@iscas.ac.cn, tsu.yubo@gmail.com, wefu@redhat.com, wangjunqiang@iscas.ac.cn, kito.cheng@sifive.com, "Andy Chiu" , "Vincent Chen" , "Greentime Hu" , "Jonathan Corbet" , wuwei2016@iscas.ac.cn, "Jessica Clarke" , Linux-Arch , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, "Guo Ren" Subject: Re: [RFC PATCH 00/22] riscv: s64ilp32: Running 32-bit Linux kernel on 64-bit supervisor mode Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Fri, May 19, 2023, at 17:31, Guo Ren wrote: > On Fri, May 19, 2023 at 2:29=E2=80=AFAM Arnd Bergmann = wrote: >> On Thu, May 18, 2023, at 17:38, Palmer Dabbelt wrote: >> > On Thu, 18 May 2023 06:09:51 PDT (-0700), guoren@kernel.org wrote: >> >> If for some crazy reason you'd still want the 64ilp32 ABI in user >> space, running the kernel this way is probably still a bad idea, >> but that one is less clear. There is clearly a small memory >> penalty of running a 64-bit kernel for larger data structures >> (page, inode, task_struct, ...) and vmlinux, and there is no > I don't think it's a small memory penalty, our measurement is about > 16% with defconfig, see "Why 32-bit Linux?" section. > > This patch series doesn't add 64ilp32 userspace abi, but it seems you > also don't like to run 32-bit Linux kernel on 64-bit hardware, right? Ok, I'm sorry for missing the important bit here. So if this can still use the normal 32-bit user space, the cost of this patch set is not huge, and it's something that can be beneficial in a few cases, though I suspect most users are still better off running 64-bit kernels. > The motivation of s64ilp32 (running 32-bit Linux kernel on 64-bit s-mo= de): > - The target hardware (Canaan Kendryte k230) only supports MXL=3D64, > SXL=3D64, UXL=3D64/32. > - The 64-bit Linux + compat 32-bit app can't satisfy the 64/128MB sce= narios. > >> huge additional maintenance cost on top of the ABI itself >> that you'd need either way, but using a 64-bit address space >> in the kernel has some important advantages even when running >> 32-bit userland: processes can use the entire 4GB virtual >> space, while the kernel can address more than 768MB of lowmem, >> and KASLR has more bits to work with for randomization. On >> RISCV, some additional features (VMAP_STACK, KASAN, KFENCE, >> ...) depend on 64-bit kernels even though they don't >> strictly need that. > > I agree that the 64-bit linux kernel has more functionalities, but: > - What do you think about linux on a 64/128MB SoC? Could it be > affordable to VMAP_STACK, KASAN, KFENCE? I would definitely recommend VMAP_STACK, but that can be implemented and is used on other 32-bit architectures (ppc32, arm32) without a huge cost. The larger virtual user address space can help even on machines with 128MB, though most applications probably don't care at that point. > - I think 32-bit Linux & RTOS have monopolized this market (64/128MB > scenarios), right? The minimum amount of RAM that makes a system usable for Linux is constantly going up, so I think with 64MB, most new projects are already better off running some RTOS kernel instead of Linux. The ones that are still usable today probably won't last a lot of distro upgrades before the bloat catches up with them, but I can see how your patch set can give them a few extra years of updates. For the 256MB+ systems, I would expect the sensitive kernel allocations to be small enough that the series makes little difference. The 128MB systems are the most interesting ones here, and I'm curious to see where you spot most of the memory usage differences, I'll also reply to your initial mail for that. Arnd