Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16900614rwd; Mon, 26 Jun 2023 17:18:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/6Vva16910rUrXgGS2PBdmnzAp7v9mIGgjH2PgGDXWYXCFlsefseDosSDnJ2a91JYw1WK X-Received: by 2002:aa7:d148:0:b0:51b:f860:29a5 with SMTP id r8-20020aa7d148000000b0051bf86029a5mr7280683edo.4.1687825097234; Mon, 26 Jun 2023 17:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687825097; cv=none; d=google.com; s=arc-20160816; b=XUCNxbmwaVCkiep4D6zLAWWgz1QUpSzcEWETa4BhZIswROVRIl9TadfOkVTZ1TbYQF gyu2BG1L2bB+ybqfVfcvtFqIyk5UKEUD111cFFb6EJZb0vMcu3J8lrYt6wGgKAPw2SW3 q0uRkunS6aJfgSfzJNpfnStHUg78uD1bZRO2h78bHelp+uB6NifjIwjR1ZUuQKEAmEeL xoEfS6trEIbTAjkyE2O3yxXdXu90j7fSJ6QZix/vxZaWyia64ppy9TaLoWx/F4Q+Q6XX yxWTANYRAvfa6NuwUgGC9SCWIvlsMOGs8NcaYCnkvhhmhfU6Mu1ofgVkNuZibZyu1TMe 1MEA== 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=TFgU9qn91+n5dnmwJFQd5phUqXXyZnU0m9ZLzY0G0lQ=; fh=KzIjReYihDz9l+k9JaqtbcT+sLhZMOp0uk+kSkzyDs0=; b=FVUlxF7JAzPBXZKyKLzHiORrOMt8QPOJ8qJlU278+Ug6Gu1zp/7sOTKvmkYnuvCIuR wPx0jT6TTktmve39sLyWjXUYakpMLmkYhTQ8T0izPcAQcBdp7w3EdvZEoRv4gjZ4ZNez 0s0VrT/brZdGs+izRcSuq61ejRaeH2mesCNvw898FE820yzIaGhgyeeBMUDVL3N4xYx8 G+DkVe4BeyRwkCLQg6Vm36s7Spdc0fZo5MT5XR1FrDpifh2MTtKrXwGIDGWogR78V7gc qQVD+8gPwQra+hzJQb47QBsLhSJBLJM1qr0PwfsyZdMJWyO+6Snd4FYU7doFGenDUApP ux3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=iijq2dGR; 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 h2-20020a50ed82000000b0051da08fe94fsi1125387edr.74.2023.06.26.17.17.51; Mon, 26 Jun 2023 17:18:17 -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=iijq2dGR; 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 S229775AbjF0ANV (ORCPT + 99 others); Mon, 26 Jun 2023 20:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjF0ANT (ORCPT ); Mon, 26 Jun 2023 20:13:19 -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 99852106 for ; Mon, 26 Jun 2023 17:13:18 -0700 (PDT) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687824796; 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=TFgU9qn91+n5dnmwJFQd5phUqXXyZnU0m9ZLzY0G0lQ=; b=iijq2dGRrhXtGry+SS/vYvXL2SGxp0knv6IxSR/oDlmCIHBV3tD+DGWTQ9tHwykJbxLR40 K8gXTRR0zfx3vcwMGJzh1BAR0QA2F5hsQxw3+U61vl1Kgt+sV/yPliVjH2HoEK/kJBuiQb XmMjL7Zmqq2L1/+s/wmpudpPgXk1H14= Date: Tue, 27 Jun 2023 00:13: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: 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: References: <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 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 on= ly 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 us= ed=0A>> to pass the node id to the new reserve region.=0A>> =0A>> Introdu= ce 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: Y= ajun 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 node i= ds are still=0A> unset in memblock.memory, so very early reservations wil= l be missed and we=0A> still have to update node ids in memblock.reserved= later.=0A=0AEven so, we still need to pass the 'flags' to the new reserv= e region.=0Achoose_memblock_flags() may return MEMBLOCK_MIRROR in membloc= k_alloc_range_nid(),=0Amemblock_reserve() couldn't pass this flag in this= case.=0A=0A=0A>> I tested this patch and delete memblock_set_node() in m= emmap_init_reserved_pages().=0A>> It works fine. I did not delete membloc= k_set_node() in this patch just in case.=0A> =0A> --=0A> Sincerely yours,= =0A> Mike.