From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E58A4369A for ; Tue, 30 Jun 2026 07:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782804140; cv=none; b=MEugCBIagKktbE4aYDAcotAlV9kIgBGmlVqSm00Z/Jhinynmyht3GYAE66pU35eEpJ53NwCKa8pEefRAlcbSZaWVXJ/vuBnaF0UbE4FIjMM06LmL6ItpAdnPNfKlzBWBihH0C4uxCJGchBiqATNfMgBGlU4RED9A8iRU7Iix6g8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782804140; c=relaxed/simple; bh=7iqd4bWCc0/E/po0L1My6P4w8P73AvrEJpxiqjD5ckM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KaFrXkIZ0BRTOD7MBW9Leq6XjRk1+l28SQ/nIeHOuuLMk1Vaei1zjtQwGJgBtN0BQjcbv/IJePRiPuN5arYcFDi7A2IrTTxS1M8cMHZbUMyzg7tTOhlLKQbRPVARZYSAspv67S6K4DYX8eRM0WuhvqkH6Ya1N9yTVqPg99C+GtI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cce8FDBX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cce8FDBX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F34A51F000E9; Tue, 30 Jun 2026 07:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782804139; bh=9AOmCcxEPq4W+TaAmY6U28nuZoCb0YCtTlU91i3LIHs=; h=From:To:Cc:Subject:Date; b=cce8FDBXbqgDflei6/4+Fiw5Z/p3Zw/gZOC8n/SOHM6rUSzSqbjOlePD7rnfkQiAq ezo6QyUbA5t+vaynuc+kC3e1rlc5z7HYmGmg6L6+TauGjQBdhGubhygkvqBxtS/H49 FY6U/p5TFaOyrporioULcYpP8G2ZU2nqHuVP9W+d6h5ayIbpSRQJ0pkclkooGxU8pp Y4FwjLYUyKkxWTMF119gardiLrTmgOOHUtnI0NHCy2c57OuK/UskuKW3OMWpf2gRpg iRiSLcNejB4mXdrxU1hOJ+xW0Y4mFsv8JUPtimBrMpV8DtNrnrl/bzprgaHZuxm/4O aOmu0IPCHyCow== From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , David Hildenbrand , Mike Rapoport , Taku Izumi , Wei Yang , Yuan Liu , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] mm/mm_init: don't overlap zones with kernelcore=mirror Date: Tue, 30 Jun 2026 10:22:10 +0300 Message-ID: <20260630072212.624305-1-rppt@kernel.org> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Mike Rapoport (Microsoft)" Hi, These patches make the behaviour of kernelcore= parameter uniform and treat mirror just as another way to size the zones and cleanup a weird part of the memory map initialization. For example, for the memory layout below with the first two memory ranges being mirrored (flags=0x2) memory[0x0] [0x0000000000001000-0x000000000009efff], 0x000000000009e000 bytes on node 0 flags: 0x2 memory[0x1] [0x0000000000100000-0x00000000bffdefff], 0x00000000bfedf000 bytes on node 0 flags: 0x2 memory[0x2] [0x0000000100000000-0x000000013fffffff], 0x0000000040000000 bytes on node 0 flags: 0x2 memory[0x3] [0x0000000140000000-0x00000001bfffffff], 0x0000000080000000 bytes on node 0 flags: 0x0 with kernelcore=mirror set zone ranges would be Normal [100000, 1c0000] Movable [140000, 1c0000] and range [140000, 1c0000] is spanned by both NORMAL and MOVABLE zones. This range will be passed twice to memmap_init_range() - once for each zone that spans it. The memory map for this range will be initialized as ZONE_NORMAL during the first pass and skipped because of overlap_memmap_init() during the second pass (ZONE_MOVABLE initialization), although the pages in this range actually belong to ZONE_MOVABLE. Aligning kernelcore=mirror behaviour with other variants of kernelcore=/movablecore= resolves this issue and makes the code less obfuscated. I intend to carry this via memblock tree. Mike Rapoport (Microsoft) (2): mm/mm_init: don't overlap NORMAL and MOVABLE zones with kernelcore=mirror mm/mm_init: drop overlap_memmap_init() mm/mm_init.c | 60 +++------------------------------------------------- 1 file changed, 3 insertions(+), 57 deletions(-) base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482 -- 2.53.0