Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1062193lqt; Tue, 19 Mar 2024 11:26:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5fdQD6v+srsODi45GLZPG5u37QPbH5sW+QcbmRU7pxtCC2hrF+paPYQBcULNiuRrqVPEMemEtB7oPovOymcUo2/ULjymcFjTWFF7ldQ== X-Google-Smtp-Source: AGHT+IEPEBm/uPSNcet5I+QXXE1j89sgankwmNJ6QIVtfZaUTSHBtYFYyzNJlzATKT6NPdAdVOW6 X-Received: by 2002:a17:903:190:b0:1e0:188c:ad4f with SMTP id z16-20020a170903019000b001e0188cad4fmr457373plg.26.1710872806334; Tue, 19 Mar 2024 11:26:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710872806; cv=pass; d=google.com; s=arc-20160816; b=AiuoM/cB6OhbgPRf1RFBp83WtYhYumZ7zEim2QUpDDrv08H/6jQCxnQCAdO+DBWw5f DFmOlMCkDTL5KnibBp6Inz2SHNQfPCDXis0kUo7WcTzm5bPDBJPhz3bmBaNyuvtrs74G J4sYoJhgTDU/fW2PCj9JyFhQyIvGK/yMT/YJpHU6F1nOC3gO2Xkzw4LcBFlL3S7+HIwU LYPhAHelbhT+UyDh08IcHYD9NQnnH1ObdhBREO7W0b850L9GHSm/hljbaOayeBhc4aoc ulYPyHqgV+DK65TevBx/aeQf//dvUx3wV5wEQJF/ccenZQCa3lNJLnXmtP88DgIvI6GN +jbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=LQQHHewpOhGKoazUBzUqPFuOzvhctJZdxOAAtuphGlU=; fh=BeFJMVGpSB9Bixk5LhC1i6lXARDj664hFsfDO+HsGeg=; b=KOHyMAL9JMlf35aEG4A2GKHi6fISJoppCDW0bzDOn66NXqi+eA392OpGHFI7FLBjEd Vx373JsHBakNyi6AyxHH0tO83uDRJUHTG7f8SJREg0W65Hd0Z30kOX2B2Jb4OphaQbIT zzXoTCv3OH48yAyZzAzXMvEJ09VCgVYNb85gKvYRfWtWGQ2FPyuHrymLl4HP77WTMs48 OIp8KI/4jzEV2Kd4QAMkYUWMD+cBX6zdWVE3+hOAbHAqFXjKJjCyQq2SLNGsd0M/0yA2 GnLpA1d7VMAOPlunTXlxA7zLJWe5wovVWQxIZ1MJDGc4YIkVlY7x0j7jcHD9g6eGJ8/B YDYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gq6agP8c; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-108009-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108009-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a1-20020a170902ecc100b001dd5c2dcf2fsi11810625plh.595.2024.03.19.11.26.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 11:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108009-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gq6agP8c; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-108009-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108009-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C1233285257 for ; Tue, 19 Mar 2024 18:26:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C96AD2E416; Tue, 19 Mar 2024 18:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gq6agP8c" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2840C2D057; Tue, 19 Mar 2024 18:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872780; cv=none; b=DN00Em1siPZmYy1GXSWTc9NUkUdexrrOoxk15B/wuWhaaOOrPfrDnKmpz+sDmbXDU+9gyS2pSLgoOLDFEqG7LfOMsuEcBrowRtSzMXSvI46pC4w9W5H7pU5qm1ZrhNEeZukZVDzgdXAMWgN6UkjmkEWo3mq3bdbL/HOCWuBPb2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872780; c=relaxed/simple; bh=wahjo+tEz7j6H35clrL52KHbAR1sKv6X+PRW9bAHaTA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KkPqA+pAVzP+2b4H61geHrYtjr9cyhSHpQo6IcL34CCOedSdYuNbywohHXtRtF7yl6WeNSo4LxIXw+AG/t6/fGYm8Ky2YVfL0YQC+AnzbR98khKIjiN9TdfY9cy10sj67WJ602c2pwITg0bDx2FocdtrM/gbc4iQMM9jZynfWZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gq6agP8c; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1dddbe47ac1so972975ad.1; Tue, 19 Mar 2024 11:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710872778; x=1711477578; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=LQQHHewpOhGKoazUBzUqPFuOzvhctJZdxOAAtuphGlU=; b=gq6agP8c89/lq/LOPoL5nYCInxFk8IX/bcD37lR27b/BHcstfV9WGeB9o6TOOGd2fm 3i0W7O0I1dkOLYCBTNSqbHsJ1qvZwgflKWJfjorezuwetmo8SXlIkH+ZiwyjebtseJSH RTKiDxRWOTDp44PA5Ga+7h4dZm5tEvgGhV32XiDwTt+vj2v9oLotkqHZrv7fLs+5Dv7N 3Onfcf9rjJWg3qYISe3rDkvJyiKG79kGD7uCs96Hc+0hJddAcG+uGJOj21n9v0t0Wnou xkCq7yJVBY5bsU7dishdVwIWwK2DPKlqQ9SJtzbMc9y8V0BgiaD+LbRAiYNaeMJm3b4R /Bwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710872778; x=1711477578; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LQQHHewpOhGKoazUBzUqPFuOzvhctJZdxOAAtuphGlU=; b=fV2CYQkXgFv98G9MxUpyhrYrkBtRff7Wj3nww+4dQ42UUBYMRygUAhLXFOjFhAMKVw rkKiXrgI5RdgQpA1kW6bbra9YDg2hF4+eKgYtulFRAcBgWx2BeKxDgmEfcgQ4jgdqUHO 5NUn5Vdhow8g/vWM1tfA1AXmAwDlSIFtlaTU+zhRtyf/Ycff9x7p9KOVr4b1u0GknlUw ACPFw7Ga18FTKr2S96SnWa+Xjl5lRyB8g4IeY137H+nBU/V1+Gr7l+kkBdKEMT7yJzHm 5osZoubGrK/9WkshbFEf7r9dUpBifNrPaxDYeVUSBNoV/CXx4gb2t8WIGo5IEKEldf0n iRAw== X-Forwarded-Encrypted: i=1; AJvYcCWQwLy9VQfthD1B8Fvj5YfvBh2AL9MVoo+FUG1wr1hvbjrOEsvmz3YHY7Z//VlxPovr9bNnRCU56n2F9wIo0wRallN7jkReqmWpxsBk X-Gm-Message-State: AOJu0YzYpYqQ5vcjlFL35zKbjLN1DwT+BR3tbIet02KqHf4juqEXjk6i m41GMEkoHOMSfOMXs0NlnEG9nICPQwUmJIARHNErGPtOJBf78xyF X-Received: by 2002:a17:902:ecc4:b0:1e0:3f3:1d71 with SMTP id a4-20020a170902ecc400b001e003f31d71mr396275plh.13.1710872778390; Tue, 19 Mar 2024 11:26:18 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b5-20020a170902bd4500b001e043df262dsm2030759plx.33.2024.03.19.11.26.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Mar 2024 11:26:17 -0700 (PDT) Sender: Guenter Roeck Message-ID: <02180516-6d4c-4446-b12b-8451cb4adebc@roeck-us.net> Date: Tue, 19 Mar 2024 11:26:16 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [patch 5/9] x86: Cure per CPU madness on UP Content-Language: en-US To: Thomas Gleixner , Arnd Bergmann , Linus Torvalds Cc: LKML , x86@kernel.org, Uros Bizjak , linux-sparse@vger.kernel.org, kernel test robot , oe-kbuild-all@lists.linux.dev References: <20240303235029.555787150@linutronix.de> <20240304005104.622511517@linutronix.de> <87y1ajjsv9.ffs@tglx> <87o7bfjeae.ffs@tglx> <877ci3j80k.ffs@tglx> <87le6fih5w.ffs@tglx> <28ceb124-b634-44e0-bcd4-848fc3b0be7a@app.fastmail.com> <87edc6i45s.ffs@tglx> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk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eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <87edc6i45s.ffs@tglx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/19/24 09:21, Thomas Gleixner wrote: > On Mon, Mar 18 2024 at 20:13, Arnd Bergmann wrote: >> FWIW, I did some experiments a few weeks ago on 32-bit ARM, >> using a fairly minimal kernel in a virtual machine, and >> checking the runtime memory consumption rather than compile-time. >> In a kvm guest with 32MiB RAM, I saw a difference of multiple >> megabytes in memory usage: >> >> Linux testvm 6.8.0-rc4-00410-gc02197fc9076-dirty #1 SMP PREEMPT armv7l >> root@testvm:~# free >> total used free shared buff/cache available >> Mem: 26932 14956 1732 52 12800 11976 >> Swap: 16360 3632 12728 >> >> Linux testvm 6.8.0-rc4-00410-gc02197fc9076-dirty #2 PREEMPT armv7l >> root@testvm:~# free >> total used free shared buff/cache available >> Mem: 26932 13744 5648 32 10092 13188 >> Swap: 16360 3880 12480 >> >> There is a little difference between runs, but this does seem >> significant enough to keep it. The SMP build was with >> CONFIG_NR_CPUS=2 (the smallest supported compile-time number), >> but running on a single-CPU qemu instance. > > With a SMP=y, NR_CPUS=1 build on x86 64bit I get: > > total used free shared buff/cache available > Mem: 32882056 498068 32590580 4884 128884 32383988 > Swap: 998396 0 998396 > > Same config just SMP=n: > > total used free shared buff/cache available > Mem: 32885804 461704 32635284 4876 119480 32424100 > Swap: 998396 0 998396 > > So the delta for available is ~40 MiB. > > But if I look at it with init=/bin/sh on the command line then the delta > is significantly different: > > With a SMP=y, NR_CPUS=1 build on x86 64bit I get: > > total used free shared buff/cache available > Mem: 32883680 324120 32822728 216 10864 32559560 > Swap: 0 0 0 > > Same config just SMP=n: > > total used free shared buff/cache available > Mem: 32885804 326876 32821972 216 11100 32558928 > Swap: 0 0 0 > > Delta available = 632 KiB > > I haven't had the time to stare at that in detail, but comparing > /proc/meminfo for the full boot case above does not immediately give me > a hint. It's confusing at best... > That makes me wonder if the number is affected by the total memory size. How about a system with 1GB of memory or less ? Guenter