Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15739869rwd; Mon, 26 Jun 2023 00:10:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6k5bpalCAmoUsDRtm9qnzBeE/6XRdZS8foEm0CmQfniroxsxzF0LbG7KgmsXRtzlk+rGlL X-Received: by 2002:a17:902:ea0b:b0:1b2:676d:1143 with SMTP id s11-20020a170902ea0b00b001b2676d1143mr7348769plg.15.1687763448943; Mon, 26 Jun 2023 00:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687763448; cv=none; d=google.com; s=arc-20160816; b=Hiva118njRgYqgNYqipPRpm32VNAToZA8g4mnzCUHnaPdX2Un7lDj4it/ALGg+ryaD BWzR/ZSEZCCsuFnkLit/ORarfRnaWMs9Xe3HoBFcrZSiTR8nTeRqmc84BEpXFY8DsMuW +MVvf9vk+Hhvj9dBVUrxMlkptbF2gcyVp7wXESG4GqS+Vu403DsA/3tIraN1Vr+WjA9Z m0K/o3X4543lgUm6Q7apqbVjnzZ/HA2xDIn7YTbL32lQLGEJ28IAm7P7QHw9AtqusOqE zfUtW0uZlkCz4l32xdWqOxbDthSfdLpoIQ3QR9VQNykl1DDROAFyPFEJu75KmWpQlWBD ppaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rb9n+zo8/7YDilqhPQGhjYMn13HwGky0JBW07nkRrJ0=; fh=iae8W7+YsuOdP40WCytoCMmYg2BD/IEWEocE6dbe21o=; b=mhREc6dJDzEZj4Lzf9NxllAsX83CIHn2VDZJhQMNfW/lzGHCbU3PhlzyECaMzLm/H6 vK2jUrmsAzYGF41fRYmZIeiSMBDkFC4/GRJTuDSrsYusf9ElIqC5B9UD1k5/cxYgPAb9 R0E6BrvOIbc+ACXYa1fuF2JHhKd/2reKqw8UkVq01FPbWmLHvE0h9OStyZDwluHHLV4Y BI+ETQ3ea2oBXE2euBzk+6JDJbCLCwIzW+Wyqc9RFVdiqeF5S4B9CYSIJ3/j5BvyLnpA HzBna2nHaHTW2H64FmBsKyxcAVl8AJm9KH14GkGaRskTqlssDKiXJ4DqIM2BCK+YSWPb xwbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WBqcc90o; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix19-20020a170902f81300b001b80b3106basi794296plb.564.2023.06.26.00.10.37; Mon, 26 Jun 2023 00:10:48 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=WBqcc90o; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbjFZGVv (ORCPT + 99 others); Mon, 26 Jun 2023 02:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjFZGVu (ORCPT ); Mon, 26 Jun 2023 02:21:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4947EF3 for ; Sun, 25 Jun 2023 23:21:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D30ED60C88 for ; Mon, 26 Jun 2023 06:21:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDD2CC433C0; Mon, 26 Jun 2023 06:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687760508; bh=32adzyDlBFSBWtLEHoNT9pfLD4gF8dQdYVhhOXCfYD0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WBqcc90oaWhYQCR+OXO6W6iA1ACE4SzpeVklyw8fJfxPwJz0K1YH3vIWMR84qSpaj OrwYeLr4DbDJTVWnrcaD6KDbdQfSQYSBFWOOlpgL7jB5vbzolI8iBDnA8JE6OPkBXm dbvViJB9f/0YTRMiBWnmnqVTLdOvLE/q63nO1zmW4NZXPmirC0L4RdZ4FCCQvKEqdv cPZ7mpUXnXdKxc1ryne6q4P3oABniHLHIoXGnVSLHcnSmNsERVnEm92VyNEuD7TaMA D2qtgyLYu1om93dBNc/LnJQpSuRvj5dz5MDHFvj+flBUWndo6hVGKx6EZtOH/8naDz xJWbQFYxOOYjg== Date: Mon, 26 Jun 2023 09:21:42 +0300 From: Mike Rapoport To: Yajun Deng Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memblock: Introduce memblock_reserve_node() Message-ID: References: <20230625050850.GJ52412@kernel.org> <20230624024622.2959376-1-yajun.deng@linux.dev> <4c361d62e0b77242fe4b8592c82c4d90@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c361d62e0b77242fe4b8592c82c4d90@linux.dev> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Sun, Jun 25, 2023 at 07:39:10AM +0000, Yajun Deng wrote: > June 25, 2023 1:08 PM, "Mike Rapoport" wrote: > > > On Sat, Jun 24, 2023 at 10:46:22AM +0800, Yajun Deng wrote: > > > >> It only returns address now in memblock_find_in_range_node(), we can add a > >> parameter pointing to integer for node id of the range, which can be used > >> to pass the node id to the new reserve region. > >> > >> Introduce memblock_reserve_node() so that the node id can be passed to > >> the reserve region in memblock_alloc_range_nid(). > >> > >> Signed-off-by: Yajun Deng > > > > What problem does this patch solve? > > > > If we set nid and flags in memblock_alloc_range_nid(), we may not need > memblock_set_node() in memmap_init_reserved_pages(). When memblock_reserve() is called before NUMA setup, the node ids are still unset in memblock.memory, so very early reservations will be missed and we still have to update node ids in memblock.reserved later. > I tested this patch and delete memblock_set_node() in memmap_init_reserved_pages(). > It works fine. I did not delete memblock_set_node() in this patch just in case. -- Sincerely yours, Mike.