Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3032492rwd; Fri, 19 May 2023 13:55:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FlsZ8XBiSEOFHMuKx36FfcJ0vtn6OC9IzedQdp8aCwQiJmcLb12gmUbhkON/Q8xSbS0pI X-Received: by 2002:a17:903:2343:b0:1ae:35b8:d5ae with SMTP id c3-20020a170903234300b001ae35b8d5aemr4367088plh.19.1684529727896; Fri, 19 May 2023 13:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684529727; cv=none; d=google.com; s=arc-20160816; b=ZFWcNvWmziEtUzuHutu8jfcuBQx2JuTyAbIq19YKKUm6d50NvAr+68cRUGKC1oBHQ0 x50/1yweeVaJNpcSL3hspVVykfztuV/ROkyBZgKYX3rGnLjBMaBw/21BZ4dz6IBv520l i53izGxVwReWYeNGvz3C5nqsX7y1mhPuf7oj8AV+3imIdH/SzdhaqFAOncmxR6sjl64q w2L1ABlBTabB36G8zct5+xCU7asJTHXZQg1dxuwUuMJ3KNoqJvnTFq1zFrmOxo3TygvC hjQP7EGoOEgNY3MJ6U4fYpzESnPn3KC4NtV8C1rBDvQyIl82nBcvmhelXMRTjJ/iu2rJ cP+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=oIJfFfhJfrFit/dFRNXoBCxBw8LbYIGZS18hb/Tgxjk=; b=cKci2f0vGYgXqj8YdhiyCvog4df/UaMZ1vfoLf+LOf/BVHGsKmL4PwAXfYSctx5WEv EBV+XRUUQDKKXEL2YR/nJ3NYBI6RYf4rZcjQRS6T81D2f4PrDlUqE4/KeVRRdsef+s0E jtcgrBvh/iL/JkOyvlwcT8CMrpBVf/7uUKfasYuhtxBTAOiQFbKNXZ9rnGADmWlm2LmL /EDHli/BEXH7i2+B8sQRGH8RKLjeIiMOhsN+zUla2jGCJvedhXrhtaJUKohI4F3zjJJf d1MduwhgFIDGwHvEUnTSvNBx2BHdPqqwCaMKi23hq1DWC/xxcN9+4TcHZxHenj+LRQ78 5vPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=f3ZkNvTp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="aoLi/APT"; 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 bi10-20020a170902bf0a00b001a6e719421asi89329plb.366.2023.05.19.13.55.12; Fri, 19 May 2023 13:55:27 -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=f3ZkNvTp; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="aoLi/APT"; 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 S230373AbjESUVB (ORCPT + 99 others); Fri, 19 May 2023 16:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjESUVA (ORCPT ); Fri, 19 May 2023 16:21:00 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 094E6102; Fri, 19 May 2023 13:20:47 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id E987432005BC; Fri, 19 May 2023 16:20:43 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Fri, 19 May 2023 16:20:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc: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=1684527643; x=1684614043; bh=oI JfFfhJfrFit/dFRNXoBCxBw8LbYIGZS18hb/Tgxjk=; b=f3ZkNvTprv0bWj9ozZ MdUK0zGhSmAyXcHmPJ6qbVfWmrpn3ByC9jsOzGIt4lKARxpzUUcjWsRHAlg2GjCH pS9GwC5PGcSdbYlgqvAp6YCdagg1X2xpGiarYWp4uzU5Uy2sQNPRVnl+ZM7a1gPh TtnAzTuHoKqS+giSVNNvxMNoTFNcqyC/ZbvA1UPF+6ei4TAhjpJ0AI6D8XxJWE6B VKOoI+DUB3L0IQCHLDk8LxfY5snJzRXoDPRzzJaralCKAfswbnzNqmoRuTcA/xdH waV6docyZYaW1KGzTA493KL4uOZHU8q/ASjCHRmYvCSW11G/xcs7kSVFgTZ2KimP rEuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1684527643; x=1684614043; bh=oIJfFfhJfrFit /dFRNXoBCxBw8LbYIGZS18hb/Tgxjk=; b=aoLi/APTXljwnO2BmJWbRFXr53n9v Y77nUM8qaiD720EcWMgd3IWkinmqH2o/XLRxlBPBHsABVkmfjWi1SibnzYbQTpCx dIA7bBwAuMpuT5LkgDRk63zVBsY3E4lRzLM0TrDF1+xZRwRF9GxNMV3yW3/dwSMJ Sv1g0p3SP7ossBoVOxBVU3Vr2fIrjdvUJGBJDGtJAcL5bbTmru0z2qBdnBSOcPrg JYwm3E/mSSiVoOmTCHDH400EBVJrjXjvJYuZHi3Lx55guFf/m1KzACMlxnseGm4E clVPVf7kgUYP7vXhr0vhuI1USkheTKxrBXUOlCPODBgiNt1LJAbAADyLw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeihedgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 07D16B6008D; Fri, 19 May 2023 16:20:42 -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: <20230518131013.3366406-1-guoren@kernel.org> References: <20230518131013.3366406-1-guoren@kernel.org> Date: Fri, 19 May 2023 22:20:21 +0200 From: "Arnd Bergmann" To: guoren , "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" Cc: 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 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,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 Thu, May 18, 2023, at 15:09, guoren@kernel.org wrote: > From: Guo Ren > Why 32-bit Linux? > ================= > The motivation for using a 32-bit Linux kernel is to reduce memory > footprint and meet the small capacity of DDR & cache requirement > (e.g., 64/128MB SIP SoC). > > Here are the 32-bit v.s. 64-bit Linux kernel data type comparison > summary: > 32-bit 64-bit > sizeof(page): 32bytes 64bytes > sizeof(list_head): 8bytes 16bytes > sizeof(hlist_head): 8bytes 16bytes > sizeof(vm_area): 68bytes 136bytes > ... > Mem-usage: > (s32ilp32) # free > total used free shared buff/cache available > Mem: 100040 8380 88244 44 3416 88080 > > (s64lp64) # free > total used free shared buff/cache available > Mem: 91568 11848 75796 44 3924 75952 > > (s64ilp32) # free > total used free shared buff/cache available > Mem: 101952 8528 90004 44 3420 89816 > ^^^^^ > > It's a rough measurement based on the current default config without any > modification, and 32-bit (s32ilp32, s64ilp32) saved more than 16% memory > to 64-bit (s64lp64). But s32ilp32 & s64ilp32 have a similar memory > footprint (about 0.33% difference), meaning s64ilp32 has a big chance to > replace s32ilp32 on the 64-bit machine. I've tried to run the same numbers for the debate about running 32-bit vs 64-bit arm kernels in the past, but focused mostly on slightly larger systems, but I looked mainly at the 512MB case, as that is the most cost-efficient DDR3 memory configuration and fairly common. What I'd like to understand better in your example is where the 14MB of memory went. I assume this is for 128MB of total RAM, so we know that 1MB went into additional 'struct page' objects (32 bytes * 32768 pages). It would be good to know where the dynamic allocations went and if they are reclaimable (e.g. inodes) or non-reclaimable (e.g. kmalloc-128). For the vmlinux size, is this already a minimal config that one would run on a board with 128MB of RAM, or a defconfig that includes a lot of stuff that is only relevant for other platforms but also grows on 64-bit? What do you see in /proc/slabinfo, /proc/meminfo/, and 'size vmlinux' for the s64ilp32 and s64lp64 kernels here? Arnd