From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 2F4EE3E44EA for ; Fri, 26 Jun 2026 09:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782466196; cv=none; b=NFOJxJfgSCYmTG8zkm4Od1jPMhBXNsVy3ee14uzo6MVQsxHnW+Bu5vodALEBqenId6QUXI7yAS+zK4yNiNrNMhpF29Yr8qev/X/WztEKNjsesPdIwprFA0GtWf8YkbRHgZdr4+nPtRkXsIplVkXkUi1Ao1j5cXWenmGUYrYI52w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782466196; c=relaxed/simple; bh=Sn8f/7fQx0GO0SvMkuglOafCyRfVWcWqjPXaFDyeJJc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tFPJTCaYQnFhCATi891/55XuFFSVkxKiqffWKXfl2L5AzLAaVi5gB1vLx1g17ZlEl/bwXahdCWzBzPm24utb44n6cPByXPbhx7Z2Pf1gf2rVGR5LPwK5hnW7EPnWBydgreS5CqrStPKxJDdPZkwOzRpPbOOGpXpsT05OJ01kkic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NqjVOiKu; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NqjVOiKu" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-915c36e32abso72238785a.2 for ; Fri, 26 Jun 2026 02:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782466194; x=1783070994; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hM0SZhtB+D4y9Lg/i/wVWzrebqIOJYN4ewUhvqayhFA=; b=NqjVOiKuyRe+9zM3+x/tED79EiH+arUG6xHQDoA8v7tgcLyqqi7q+s5NZzCdzZ0Y4Z SSykJ575TJ8LPEMdhCE1ox1T6YS3/cXblLst9wvxtojzL9cgNxWb6UhiNz3igT4DbJqz yULLZe7levR/+LARgknl+5yG6+HNkMKn2Etse7BD2rgHuTA+DEMLyDWFNEgoutASK+ev bJym67qNR86D82rgSwpPVokn7h1T1JaEXdfb7qPtDHJ5rwIiNB46kOZb9QvzsJAqgy4B aLdECUxt9qkDjV0n13lduhqkpVnxS1m38cC3Rhjx4tFUVDmVnWF7CQqNNCpwhmZbEsuy tlRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782466194; x=1783070994; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hM0SZhtB+D4y9Lg/i/wVWzrebqIOJYN4ewUhvqayhFA=; b=GwEu1kjM+VsLTYqRsx1OGSiB96/gLpEvwIItd4U46YzY60UZ2W5Ll5c77cuzB4I2R6 3m0oefXRwFDn35XtmqXJk48/nr2Z4YwyVYCl7SLhtU/tL6g479TYW3ekQXM8d9wykNhb gSjoRKh1Zr1xIjboxf8uhvwZFEnqjFHvUiUPD6AnUYGVzmxNqyXCkZyaMCLzSdy1NJEF ayZlf07PxZ7SdRlP3V5+fagvrAISep7NslGqoU/W6Wdkd8bGUAMg1xb54AFFV21E3LtU qPZlvu0e1PTOCOrWhvX6QoZQ8knWt50kWTR/ASSnE4lAo52w1Q00ZVBxaCEFMMY5suJT XuUw== X-Forwarded-Encrypted: i=1; AFNElJ9ZItkuJubwKGJ57LfiIv7FF7MOubp9ybf0qq0Ibwv7yMSTqID/bFlYVXkKG9nW2K6aJap1FvlrQlQHCew=@vger.kernel.org X-Gm-Message-State: AOJu0Yxf2OOK1894i0hbEjF22cE+6tfFQ6IShCU5f+scQNX2SgNI64rN CiDzczM6uNBUBqtYhe66xEoHgrzHL4scHWlzGYrCMHSj/KKm64CQWnT1 X-Gm-Gg: AfdE7cnMLvfIq8CNCDX7e62/AFS0aioE7ZZa3QAnlqJvWQ/npC6AGShX5b6t6ImWtG7 g9Gq8JFi8J/WX+KcFWjLas4Ky+ypDXQHAAuI54UKMW+BUmBVN153UIKqWdqlZRKwV/2lo6gnxC0 ql07bTTnxEC1tpcsPNZIv5ELYs8r+p3s02GuFFqbyfF6ERNfshCFDOmgl0CdFQSdFfmnhW4zH2C mDIWG0wzPIls8wNji3wiQ5VVyPtxXDOp+lwNMZRMpCuJhk54yb+G2AOZmYWe4vb1NKuj/D6/fbR T6jEi/4IpLbGXWmqn+2ntv3WPVcD1hTlO0R2Sufxw8OwU9Gnlcfmj2tv35XI9vrCZ8dZkpse9DM lng82ud+ypUjR0ttxKE3AfUfXT2KyfVvXVB0k7JL3JRuN3fipU2yVhBdwZfWjndRamUKaDY+jsO Yw2oSaEEK4+VQ= X-Received: by 2002:a05:620a:460c:b0:915:a762:2735 with SMTP id af79cd13be357-9293d4b30b3mr925124485a.37.1782466194150; Fri, 26 Jun 2026 02:29:54 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8df8303ebe1sm206881796d6.49.2026.06.26.02.29.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jun 2026 02:29:53 -0700 (PDT) Date: Fri, 26 Jun 2026 09:29:52 +0000 From: Wei Yang To: Mike Rapoport Cc: Wei Yang , linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Taku Izumi , Yuan Liu , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/mm_init: drop overlap_memmap_init() Message-ID: <20260626092952.qoihjgphv43ezw6v@master> Reply-To: Wei Yang References: <20260625073941.145014-1-rppt@kernel.org> <20260625073941.145014-3-rppt@kernel.org> <20260625095846.4e2tl3fbduc24erg@master> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) On Fri, Jun 26, 2026 at 10:40:32AM +0300, Mike Rapoport wrote: >Hi Wei, > >On Thu, Jun 25, 2026 at 09:58:47AM +0000, Wei Yang wrote: >> On Thu, Jun 25, 2026 at 10:39:40AM +0300, Mike Rapoport wrote: >> >From: "Mike Rapoport (Microsoft)" >> > >> >When ZONE_NORMAL and ZONE_MOVABLE could overlap because kernelcore=mirror >> >didn't reduce the span of ZONE_NORMAL, initialization of the memory map had >> >to skip overlapping pages during initialization of ZONE_MOVABLE to avoid >> >double initialization of the same struct pages. >> > >> >Since kernelcore=mirror works now the same way as other variants of >> >kernelcore=/movablecore=, and adjusts the span of ZONE_NORMAL, there can't >> >be an overlap between ZONE_NORMAL and ZONE_MOVABLE. >> > >> >Remove overlap_memmap_init(). >> > >> >> Do you think this is valuable to mention the double init for the overlapped >> range? > >Not sure I follow. >We had this weird overlap_memmap_init() exactly to avoid double init. > Yes, this is really weird. As I described the detail in [1], before this change kernel would have overlapped zone range like: Normal [100000, 1c0000] Movable [140000, 1c0000] Which means [140000, 1c0000] belongs to both Normal and Movable. And memmap_init_range() would be called on this range twice for Normal and Movable respectively. And we want overlap_memmap_init() could skip init this to Normal. Because actually, the memory in this range belongs to Movable Zone. But overlap_memmap_init() only would skip for Zone Movable. This means when init to Zone Normal, it doesn't skip as we want. And when init to Zone Movable, we don't expect it to skip. [1]: https://lore.kernel.org/linux-mm/20260623092351.13031-3-richard.weiyang@gmail.com/ -- Wei Yang Help you, Help me