Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3292462rdb; Wed, 13 Sep 2023 07:56:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5RdYMXcsHEcS1qKkb49pCT5b1/XoFMAa9UQD3zbmdfCr6yoMnKiiDzSj/ipqMb5O8zDBe X-Received: by 2002:a05:6e02:2145:b0:34f:75eb:f81 with SMTP id d5-20020a056e02214500b0034f75eb0f81mr3330235ilv.5.1694616970534; Wed, 13 Sep 2023 07:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694616970; cv=none; d=google.com; s=arc-20160816; b=XbauRfk1EN+zgECGhCrZ+y3JqM4fWPwWXxC1pdQSFerPdzv+goBQLsEXmDPfJOOJKS FdnEyMqdTyPbdH7owjlc8QtjEtb905XJx1FADxVOQ33ovEn6qjfLoXxm6JpsUUJbPuJN FVp1EA+eGSkxg8eGBcWATAxv5NIg6IV8QWiTQSCS+pMIEoxHtCyXY/7TIo6eXxOqDMNY I/JsTVJeTq3sATdRW5hGp6Avdv0O56EB7OUKlXs81gEhKizWZjX0TGBg36jATvj051hr sLiZdj/pvRGDfny/5mI5PlSUzy5jtI6J0FxJeGCrAQHEjZaOqc1+nsItc9wA+HX1jgoi 02GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=av0vrlLKsg9xBQaLOcb8CPCy93VQFu46a3TbtxpfU4U=; fh=pwE1+DxwRHQWbcOZzR2ABNMMQVcionEFVt3U0a73p7k=; b=NSIK02gtFMiwEnSHtJqI2IaEe2Im+6xP3zRjlyFz25qATy8dMkGGwD9oHJIdFJjqu8 OCcBlD5NPQ/b7fmMo4mJNbJKqHHRuX4GHzL2IOiLd6Mvi9Q0SoOFyNkfKYZnOOAInJ5q 0+2tvUHdzVnFdb7g/gV7ABXg7S2ViuJP9kKZla/N1TFkvIPJOrsbYJtn0T4Q8PgYWRE6 NVP4b1VWkKbp+T46EUvUjyMnBBWemr6i/njQTzNhzPgnBmARaDxXwow9RsShgG+21p6g RXdx3YikTY1BrYk3LwdvbwEngQQOVECRl42CHT5PyIcg6WtX+q6VS4I06ZJWt4VKlhNv Ga5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P5GWihmM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d22-20020a63d656000000b00573f9d916f6si10325667pgj.865.2023.09.13.07.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 07:56:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P5GWihmM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F18E3815CDAB; Wed, 13 Sep 2023 03:54:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239800AbjIMKyh (ORCPT + 99 others); Wed, 13 Sep 2023 06:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239766AbjIMKye (ORCPT ); Wed, 13 Sep 2023 06:54:34 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463AC1726 for ; Wed, 13 Sep 2023 03:54:08 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2bfb17435e4so15902811fa.0 for ; Wed, 13 Sep 2023 03:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1694602446; x=1695207246; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=av0vrlLKsg9xBQaLOcb8CPCy93VQFu46a3TbtxpfU4U=; b=P5GWihmMHmwcNkj9lfDILOmiDbCAze1/o2zhKzbWGEmPSTV6Vveaa4b96w64JfAGgH UXr2WFXck9FLMeG1WT6GZbzf1dY0VJ7tee9TjuJSGvzLjKfdSc7J7pv8T5I4d1SxIC8P JByflZJXcSNcu7WmFW2H9ub1Ppgi0oYGo0feH64uYnCcKfTojMGVee2IuWkhYXFMW70q TRqXzB/7caGX1dcpqMkotb0p1ELUEMNCICleLJsP3QpsshS90o22q0w5SDW+RF3jj4hr 9zQvnQaiBYEcw1vVXCq+x8xmtHHlgX/YgajPjDRBQsyonoW4ykWYYaMXEN/gNQV3y0pe FW9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694602446; x=1695207246; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=av0vrlLKsg9xBQaLOcb8CPCy93VQFu46a3TbtxpfU4U=; b=bUjMjqZHFrRNWI7FouGKUW7ZBBDYeX7cVgtXgdDJcDz3/KH8ikWxiNuBrNunmNR018 WmkG+GfdWRWqWSglr6e5XNXD/ytGLBuzeWFDzC93kXQb30+M8xUwyQKETCgmdbliVlyX p/oDjtcNdBJWLA28liaqWyEryB0Q/aPtA4HL9CZy5m2pu1aEBFag5AI/da64Pu8ZFUMi z3WeWNJmHsNWuJ0FIeg83/Y97Z8OW3xW/E6YbJb8aqgPamUBsv7vRQkMPaeCDAfpLnjo ieKporHgBGSkKTkYqp6RYpiXgafxnHh057NWQJERa4F2SWwVWI5uCB0csotv6MJUZYCZ PHqQ== X-Gm-Message-State: AOJu0Ywic08p1kjGAsL6vieFVDK5vh95s8iuQbzbDitcYME455NSr8Mt jIR9LOShvvFb0X5CD1SGlU0ptw== X-Received: by 2002:a05:651c:8f:b0:2bf:9576:afd4 with SMTP id 15-20020a05651c008f00b002bf9576afd4mr1875974ljq.16.1694602446317; Wed, 13 Sep 2023 03:54:06 -0700 (PDT) Received: from localhost.localdomain ([2a02:6b6a:b5c7:0:59d5:28b9:7f13:cd1b]) by smtp.gmail.com with ESMTPSA id p36-20020a05600c1da400b003ff013a4fd9sm1757055wms.7.2023.09.13.03.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 03:54:05 -0700 (PDT) From: Usama Arif To: linux-mm@kvack.org, muchun.song@linux.dev, mike.kravetz@oracle.com, rppt@kernel.org Cc: linux-kernel@vger.kernel.org, songmuchun@bytedance.com, fam.zheng@bytedance.com, liangma@liangbit.com, punit.agrawal@bytedance.com, Usama Arif Subject: [v5 1/4] mm: hugetlb_vmemmap: Use nid of the head page to reallocate it Date: Wed, 13 Sep 2023 11:53:58 +0100 Message-Id: <20230913105401.519709-2-usama.arif@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230913105401.519709-1-usama.arif@bytedance.com> References: <20230913105401.519709-1-usama.arif@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Sep 2023 03:54:37 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email If tail page prep and initialization is skipped, then the "start" page will not contain the correct nid. Use the nid from first vmemap page. Signed-off-by: Usama Arif Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz --- mm/hugetlb_vmemmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index aeb7dd889eee..3cdb38d87a95 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -319,7 +319,7 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end, .reuse_addr = reuse, .vmemmap_pages = &vmemmap_pages, }; - int nid = page_to_nid((struct page *)start); + int nid = page_to_nid((struct page *)reuse); gfp_t gfp_mask = GFP_KERNEL | __GFP_THISNODE | __GFP_NORETRY | __GFP_NOWARN; -- 2.25.1