From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E8FEC433F5 for ; Fri, 26 Nov 2021 02:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359099AbhKZCpy (ORCPT ); Thu, 25 Nov 2021 21:45:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:49872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358816AbhKZCns (ORCPT ); Thu, 25 Nov 2021 21:43:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15A386127B; Fri, 26 Nov 2021 02:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637894147; bh=NPyiNdSls0xvC2dIMXhp1fPbJk3Za+5YMISEGyNyKw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QWB7Ew3/qHPJJK82m6CoM2nDZdEJr2NAk3pqlI0FBl/lzTkpNrXlJckdv+DzeJqxC CkqJT15cSRgW8Q44/4Ods2NV0+82hNVhH+zBJCG4btsuxRZQENft7itTDVwx3KgeAK V1ASZPOJyWYdoTQNvG+r9JP4zTShNil2fPS5P6Ziaf3QCQvE7BOEMzLMm6Aeb9S2uU DMjoN7rbOwhrLpaCuAT7VpMaYLfpjbrWPMtxoCXrpKoOK5qzolQEZSn4skOf1siOCe X6YJQZlw/biV+OCj1OUgIYv6BXyLbssQixOuf1cjZwbhIV2E6ZvzGQBPaRWmA1Q4Zm 5mdaIGPP9FjQg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vasily Gorbik , Heiko Carstens , Sasha Levin , borntraeger@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com, egorenar@linux.ibm.com, linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 07/15] s390/setup: avoid using memblock_enforce_memory_limit Date: Thu, 25 Nov 2021 21:35:25 -0500 Message-Id: <20211126023533.442895-7-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211126023533.442895-1-sashal@kernel.org> References: <20211126023533.442895-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasily Gorbik [ Upstream commit 5dbc4cb4667457b0c53bcd7bff11500b3c362975 ] There is a difference in how architectures treat "mem=" option. For some that is an amount of online memory, for s390 and x86 this is the limiting max address. Some memblock api like memblock_enforce_memory_limit() take limit argument and explicitly treat it as the size of online memory, and use __find_max_addr to convert it to an actual max address. Current s390 usage: memblock_enforce_memory_limit(memblock_end_of_DRAM()); yields different results depending on presence of memory holes (offline memory blocks in between online memory). If there are no memory holes limit == max_addr in memblock_enforce_memory_limit() and it does trim online memory and reserved memory regions. With memory holes present it actually does nothing. Since we already use memblock_remove() explicitly to trim online memory regions to potential limit (think mem=, kdump, addressing limits, etc.) drop the usage of memblock_enforce_memory_limit() altogether. Trimming reserved regions should not be required, since we now use memblock_set_current_limit() to limit allocations and any explicit memory reservations above the limit is an actual problem we should not hide. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/kernel/setup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index e8bfd29bb1f9f..098794fc5dc81 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -703,9 +703,6 @@ static void __init setup_memory(void) storage_key_init_range(reg->base, reg->base + reg->size); } psw_set_key(PAGE_DEFAULT_KEY); - - /* Only cosmetics */ - memblock_enforce_memory_limit(memblock_end_of_DRAM()); } /* -- 2.33.0