Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1693305rwl; Thu, 5 Jan 2023 18:16:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXsn2zjmDMd8YFCvlPE7kpLH7cGxAJUm8J0u+zcv+VmPi3RwPToqrUNRLXqjX5lAZHrfC3Zj X-Received: by 2002:a17:906:6b0f:b0:78d:f454:ba3d with SMTP id q15-20020a1709066b0f00b0078df454ba3dmr41057119ejr.60.1672971409138; Thu, 05 Jan 2023 18:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672971409; cv=none; d=google.com; s=arc-20160816; b=y50+RJOa8q0A1vezSrWp0bhjH9ifoFzIQ73Z/jL9kU9fdzUWQ3wNMJ/WUU5SLdGMTs eCmeZvGehNYp0tBFABwhy4G0ewpdRuC58lDyb3i3Y6zheMxNH1DDhTxzkozSxIM7jxGW 8AMj3hvT7j8YDBMcevcc8ta6Z4PlNsP1RGooHPjQPYSkksJgwVDm/yNgC07O6ZhRi5oL x6UCkzin/jl/1jSit2ToZfvRJddvQB3v7oqMZY0aOQKvPhWkAMOGFaAMStLl3zTh+usf Zw8OgCWE9eTbVTrzbapd4Em1AOzTE/C1pxvcMlytp1K7sJO2gx6FL+UFKvcMdEbjgJih Gc8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding:message-id :user-agent:references:in-reply-to:subject:cc:to:from:date :mime-version:dkim-signature:dkim-signature; bh=K2hl0SfPWQQ28j56wQsOOvclozCcGcv1dHqwKncoTUU=; b=SvnMrpAay8jtSEbOqv+GPxp1yW9mVDu8GU3IjTviAoVZ6/fV9m163QtZQFDGemaiPX qBsSW/6ZIolSLldJqWy6hjxtlRdz0M6szP8GzluD+U9eqo/O9k/J4gdxf+lY5bz6zufR BJRrph1BfVCWPIUOc8NM4wrRozAkkPPDrDbJuKS8MfOlGMPz9ItAykWrtV+gygZ+BRxQ oPfXh5aL6xL8ezjQlCNbF9bUDNEOjezKK8G3WX+jWVe2yPsl8i+oBzkxzxAWGBoNP4Po vLS3hlyatJ8J/BzRAdpip0MUdJpCHwVhG0tDQqFdEqIQtNPxpq9DsjCqAjYWyp4SLYPQ RqIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aaront.org header.s=ude52klaz7ukvnrchdbsicqdl2lnui6h header.b=OTSv+DlU; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=Qh0aaAYS; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=aaront.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr20-20020a170906d55400b007bbf9652314si37903493ejc.435.2023.01.05.18.16.35; Thu, 05 Jan 2023 18:16:49 -0800 (PST) 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=@aaront.org header.s=ude52klaz7ukvnrchdbsicqdl2lnui6h header.b=OTSv+DlU; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=Qh0aaAYS; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=aaront.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbjAFCGx (ORCPT + 57 others); Thu, 5 Jan 2023 21:06:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjAFCGv (ORCPT ); Thu, 5 Jan 2023 21:06:51 -0500 X-Greylist: delayed 260 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 05 Jan 2023 18:06:49 PST Received: from a27-19.smtp-out.us-west-2.amazonses.com (a27-19.smtp-out.us-west-2.amazonses.com [54.240.27.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1F0C3C0FD; Thu, 5 Jan 2023 18:06:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ude52klaz7ukvnrchdbsicqdl2lnui6h; d=aaront.org; t=1672970549; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID:Content-Type:Content-Transfer-Encoding; bh=Cmz24rg2v6sSkGwNw58tGKSlPXAtf7goihufSQSgRQU=; b=OTSv+DlU2mrxugOLjgqSj9NaHzlzF78TX1RzcACgtYB7/UWRCeIuAk/4LRW+/8u2 yX/hekQVtyXKsgabL3qmmCRWr8THpEy0R1uJ6WYTnu0HUsf4rx0iCzy7iAftNyDr6lq D8M+2+Q5pQoI5jMkDNAwg+YFeqO1lnJ3mGcHowPs= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx; d=amazonses.com; t=1672970549; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=Cmz24rg2v6sSkGwNw58tGKSlPXAtf7goihufSQSgRQU=; b=Qh0aaAYSWQyh97c8Ybx7gKS/oDcIXWJnAFQgrL/ojIIOEculrzvQcpAm5v0VEURn uEwmxT0YqZjp+/KRWtJC2wwMOII11gX+RMMo+MuO3X7dRtTY2WdbX+y88NioN7hYxFt EI6pa2GS6TiQpp5SCkO2l1Ob833jY8Xb1CPHkdiM= MIME-Version: 1.0 Date: Fri, 6 Jan 2023 02:02:28 +0000 From: Aaron Thompson To: Ingo Molnar Cc: Mike Rapoport , linux-mm@kvack.org, "H. Peter Anvin" , Alexander Potapenko , Andrew Morton , Andy Shevchenko , Ard Biesheuvel , Borislav Petkov , Darren Hart , Dave Hansen , David Rientjes , Dmitry Vyukov , Ingo Molnar , Marco Elver , Thomas Gleixner , kasan-dev@googlegroups.com, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 1/1] mm: Always release pages to the buddy allocator in memblock_free_late(). In-Reply-To: References: <010101857bbc3a41-173240b3-9064-42ef-93f3-482081126ec2-000000@us-west-2.amazonses.com> <20230105041650.1485-1-dev@aaront.org> <010001858025fc22-e619988e-c0a5-4545-bd93-783890b9ad14-000000@email.amazonses.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <0101018584d0b5a3-ea0e4d67-b00f-4254-8e1c-767fcafbec31-000000@us-west-2.amazonses.com> X-Sender: dev@aaront.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Feedback-ID: 1.us-west-2.OwdjDcIoZWY+bZWuVZYzryiuW455iyNkDEZFeL97Dng=:AmazonSES X-SES-Outgoing: 2023.01.06-54.240.27.19 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 2023-01-05 02:48, Ingo Molnar wrote: > * Aaron Thompson wrote: > >> For example, on an Amazon EC2 t3.micro VM (1 GB) booting via EFI: >> >> v6.2-rc2: >> # grep -E 'Node|spanned|present|managed' /proc/zoneinfo >> Node 0, zone DMA >> spanned 4095 >> present 3999 >> managed 3840 >> Node 0, zone DMA32 >> spanned 246652 >> present 245868 >> managed 178867 >> >> v6.2-rc2 + patch: >> # grep -E 'Node|spanned|present|managed' /proc/zoneinfo >> Node 0, zone DMA >> spanned 4095 >> present 3999 >> managed 3840 >> Node 0, zone DMA32 >> spanned 246652 >> present 245868 >> managed 222816 # +43,949 pages > > [ Note the annotation I added to the output - might be useful in the > changelog too. ] > > So this patch adds around +17% of RAM to this 1 GB virtual system? That > looks rather significant ... > > Thanks, > > Ingo It is significant, but I wouldn't describe it as being added. I would say that the system is currently losing 17% of RAM due to a bug, and this patch fixes that bug. The actual numbers depend on the mappings given by the EFI, so they're largely out of our control. As an example, similar VMs that I run with the OVMF EFI lose about 3%. I couldn't say for sure which is the outlier, but my point is that the specific values are not really the focus, this is just an example that shows that the issue can be encountered in the wild with real impact. I know I'll be happy to get that memory back, whether it is 3% or 17% :) Thanks, -- Aaron