Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18528819rwd; Tue, 27 Jun 2023 19:17:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/b36896kmI5e5Kj+E3tIb55ZT2RuSg0Epcci4pR+MjM0wP5fxC4CXKtm9/sbIZztHYB9q X-Received: by 2002:a17:90a:f016:b0:262:e045:a6a5 with SMTP id bt22-20020a17090af01600b00262e045a6a5mr5957945pjb.9.1687918630046; Tue, 27 Jun 2023 19:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687918630; cv=none; d=google.com; s=arc-20160816; b=ecGJH1EZFWbWCOYWp16Uq0i5aRPbodC8DaxFRiIBsKHHea24U/tAbcyharH3iKfAYZ m7KGsfFeYyuP5kd6EZng1lkg5gLQFQk+BiMp99Esh93ubaRmN5xuY94QiFKFVEh0JYLW kYjMmnJmygJgiSLvwt+auhAG160enY5FtjPxqnJT+SWK0dL18UpVvaY2v114RNYZ1I/i f4R8j/w85LWM/sycBHy4q1M3AkAHS50L62aboXSK2zLQfJcOqw/zdnIbZJSvZQrGRCIS IbtesqtvOcRstBJ73Fh1TNmh5abjt6NbH2OZf+RT6lhs039DO36xruk26C5ROsLxf9Kr UojQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:dkim-signature:mime-version; bh=oOyzcJ8VePO1Q+C6BRDa2asTrgF7Hq/6F0KbFPox+Ks=; fh=KzIjReYihDz9l+k9JaqtbcT+sLhZMOp0uk+kSkzyDs0=; b=aPm0sDpO5BD8Qpycq7KkloyirPk9B3KbxLggFPQMwsEZmofw3Mav2Qb8i+8Cn5pQ8F zsoTqOOc3p9E2Tv6p6L6pK+//E182BOwPWO4zTH6dcYJcaQpsRo/sUmdg40C+8Euip0M 0BLEuPvmi0Iw230MUmMhs3rHzhGjHUvPBpvVzB1eEARtU+6CWKa0BNHaRxoJNYPHzf+y 0h3JQBB8FE/fhDyEl+Ptc7oe/Zm/daTZGjIAXkffOpm2FNVlBS/Ac5pXD01D8YZzXES1 4vclPenw6IhWCxY8eIlQ2lQefDvXHXUMJF7D3wOaxQri2ctlBxw1tQjlMv3V2aLr83C5 rSxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qPmhKnIN; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a17090a710c00b0025bafac22e9si8104814pjk.157.2023.06.27.19.16.55; Tue, 27 Jun 2023 19:17:09 -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=@linux.dev header.s=key1 header.b=qPmhKnIN; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231131AbjF1BtX (ORCPT + 99 others); Tue, 27 Jun 2023 21:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjF1BtV (ORCPT ); Tue, 27 Jun 2023 21:49:21 -0400 Received: from out-21.mta1.migadu.com (out-21.mta1.migadu.com [95.215.58.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86F421BD7 for ; Tue, 27 Jun 2023 18:49:20 -0700 (PDT) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687916956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oOyzcJ8VePO1Q+C6BRDa2asTrgF7Hq/6F0KbFPox+Ks=; b=qPmhKnINywNfOvxpUNbxYp+kqBqH7hwkNQ4PS5AIPiIJaX0M49bhKlHhjx5OtyxVwP1Ld8 FotqAp9S+ioG+EmE3dPT3UWQ7Th8gejYgE6sKLCqLr+BFczkqKArPEpr4WMO1hZ5I2Bv1E GMuJWgzgd1K8mMmQa3dwmny1jAZL/Ok= Date: Wed, 28 Jun 2023 01:49:16 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Yajun Deng" Message-ID: <45683de8eea1912297542aad909ece6d@linux.dev> Subject: Re: [PATCH] memblock: Introduce memblock_reserve_node() To: "Mike Rapoport" Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org In-Reply-To: <20230627143318.GN52412@kernel.org> References: <20230627143318.GN52412@kernel.org> <20230625050850.GJ52412@kernel.org> <20230624024622.2959376-1-yajun.deng@linux.dev> <4c361d62e0b77242fe4b8592c82c4d90@linux.dev> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 June 27, 2023 10:33 PM, "Mike Rapoport" wrote:=0A=0A> O= n Tue, Jun 27, 2023 at 12:13:16AM +0000, Yajun Deng wrote:=0A> =0A>> June= 26, 2023 2:21 PM, "Mike Rapoport" wrote:=0A>> =0A>> On= Sun, Jun 25, 2023 at 07:39:10AM +0000, Yajun Deng wrote:=0A>> =0A>> June= 25, 2023 1:08 PM, "Mike Rapoport" wrote:=0A>> =0A>> On= Sat, Jun 24, 2023 at 10:46:22AM +0800, Yajun Deng wrote:=0A>> =0A>> It o= nly returns address now in memblock_find_in_range_node(), we can add a=0A= >> parameter pointing to integer for node id of the range, which can be u= sed=0A>> to pass the node id to the new reserve region.=0A>> =0A>> Introd= uce memblock_reserve_node() so that the node id can be passed to=0A>> the= reserve region in memblock_alloc_range_nid().=0A>> =0A>> Signed-off-by: = Yajun Deng =0A>> =0A>> What problem does this patch= solve?=0A>> =0A>> If we set nid and flags in memblock_alloc_range_nid(),= we may not need=0A>> memblock_set_node() in memmap_init_reserved_pages()= .=0A>> =0A>> When memblock_reserve() is called before NUMA setup, the nod= e ids are still=0A>> unset in memblock.memory, so very early reservations= will be missed and we=0A>> still have to update node ids in memblock.res= erved later.=0A>> =0A>> Even so, we still need to pass the 'flags' to the= new reserve region.=0A>> choose_memblock_flags() may return MEMBLOCK_MIR= ROR in memblock_alloc_range_nid(),=0A>> memblock_reserve() couldn't pass = this flag in this case.=0A> =0A> flags are only relevant to memblock.memo= ry, we don't care about the flags=0A> in memblock.reserved.=0A> =0A=0Aget= it.=0A=0A>> I tested this patch and delete memblock_set_node() in memmap= _init_reserved_pages().=0A>> It works fine. I did not delete memblock_set= _node() in this patch just in case.=0A>> =0A>> --=0A>> Sincerely yours,= =0A>> Mike.=0A> =0A> --=0A> Sincerely yours,=0A> Mike.