From patchwork Mon Jul 24 13:46:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Usama Arif X-Patchwork-Id: 125014 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1832948vqg; Mon, 24 Jul 2023 07:20:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHax/Y3V8TwNjixfxMqxt2DoEy5P8Uu0khK5SSLgRm9pTP3w3XsTyvONdQ260uLO4t2RnYd X-Received: by 2002:a05:6a20:b709:b0:12e:adbd:797a with SMTP id fg9-20020a056a20b70900b0012eadbd797amr6689303pzb.62.1690208446111; Mon, 24 Jul 2023 07:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690208446; cv=none; d=google.com; s=arc-20160816; b=sY5WY4GJj+QWzyAyvBKiSFYFyeySLigF9YvLUbghnjqupHwtevIhb1XBNv+0wA5o++ QfQ0OqMD6YPOo1PlP58EHfzfHSPYCsLs6iiWxHkFBL70bI/XQ+a611QTDXSN1NUMC+Zv Q1LCJ/5qkEafbEWcxUMqSWHb8d09oMRFZk/yoXLgtF3a3c8N4/oapyXmSKIkCSVyXhG/ Nj4/pkZIW/D1UnzvzABVy3uSBqIFj72OAzD0EolwX/iAxZwQCARUiFuMNdMUzNc56mC9 Zj13AChH6TPrvraxGBMw+Wwct97tUjpse8QIGdItcIvs3ZOT942ap4shh1i4+Njb+GZz 5l3Q== 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=VUFHsk/m/GY1eTNfZx8Py//rj4lEwu1OMjpML8i4XiA=; fh=6ywE3cadAEHt3CqWKbi2najT+v0c7si89uhbZ0SfPzA=; b=FRuDR4oqCJkGlbAm5oX+9N6oDIO/vgNBpBiysBNZZbe/mIfea6jBYA4KR8p6viHpad XPm46R9C6hi02gdNCjcYZ6IzAPqjC99BshMdOyAUE7JmSWwqyrvszOQrRY0L/GYhornz 7+DnsPgm19Xd7oyMG9N+Fl6yHSF1SfyP8PEQ3ZVYV90XQqqHQEnCPq006nzF9JxqgtrS hOVU3YB3K9W6Okp/b/LCtHwFRRpBepmEPwZSd0Foj+hIhMWMv0FbT+Zt9Ry5qRDsFua+ cP+z8wDtj2TsE+SSAvF75ASp+beQMLVkTcmpe5w+0ZFAZXata25DCxj8JWjdaI4XVK/b ZFLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=MgcuJRY5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca13-20020a056a00418d00b006823a64b0a6si8886651pfb.350.2023.07.24.07.20.28; Mon, 24 Jul 2023 07:20:46 -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=@bytedance.com header.s=google header.b=MgcuJRY5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjGXNuQ (ORCPT + 99 others); Mon, 24 Jul 2023 09:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbjGXNtw (ORCPT ); Mon, 24 Jul 2023 09:49:52 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE1BC1BE7 for ; Mon, 24 Jul 2023 06:46:52 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbc1218262so41886315e9.3 for ; Mon, 24 Jul 2023 06:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1690206410; x=1690811210; 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=VUFHsk/m/GY1eTNfZx8Py//rj4lEwu1OMjpML8i4XiA=; b=MgcuJRY5CZqiaM6oN+2ZgOrZfx75ny19uB226sSasic7Mnx54MWMiPH2vVvPOLfApJ prGjNWXiRaSzV4+PdVcYOKWYfpjwq8s/M8+afykb+Nc06bZYe/+gbxa1+Be4Rm3jeWI0 8cCsZq8cfyydU59ItSQYEJs5yxH0yKdyeTfFZmwx6fK1dDSSKyPHBvlQzTgukYT3kPUX EQcr7s+o30vHTb1ipJOy2fJMjidD+R8BdV4yReZet1FTj9rlNgXk8HK6ZpTxwwfR3+Y5 MrrxBs3KhFwb0TnnMWnCPZSjTb//F/UJ43wX8Vj0/TqJXnIo2EGyycAVn4dvvn7wm2nd L09Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690206410; x=1690811210; 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=VUFHsk/m/GY1eTNfZx8Py//rj4lEwu1OMjpML8i4XiA=; b=XhtmUH4OuJ4WByiG5qJ3hctyQSSnW2cEK8uJQNivA21DpL1qHugvL90JO0BAyUUQwo 368/i0Rthopp0qxK3N3cpwh47d19QU/9//VqhWB8jHJKvE0mZYOi4wn7zWJii9CW49C0 o2D/v3Q5vWv+tg311fjZdHBkp6I01Srv6uoUfvM0gln8LwUCkycNNsqeJi9vUWS0wiMX VQ3l1jHxo6bgR3H1YfJlaVvUi5bOAv79PxcmVMorHKw7EK9iKu8AyDfM1qnDveFBeH4x sMrpKz5ePFxJBPhVYF8fi7bqmhCqq9jbPUOcwOc5wnJQFI4VUrbzeddvrUdi5yA6tltw NPXg== X-Gm-Message-State: ABy/qLY12o5WG42qKKKFekNAuic5JSHMIyUgceW6yh+l3S9DMq2UCm0A 50eeD/h0kL1xam8mPF9IqOWUMw== X-Received: by 2002:a7b:c349:0:b0:3fc:5bcc:a909 with SMTP id l9-20020a7bc349000000b003fc5bcca909mr7478357wmj.2.1690206410523; Mon, 24 Jul 2023 06:46:50 -0700 (PDT) Received: from localhost.localdomain ([2a02:6b6a:b465:0:d7c4:7f46:8fed:f874]) by smtp.gmail.com with ESMTPSA id e19-20020a05600c219300b003fbe791a0e8sm10209354wme.0.2023.07.24.06.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 06:46:49 -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, fam.zheng@bytedance.com, liangma@liangbit.com, simon.evans@bytedance.com, punit.agrawal@bytedance.com, Usama Arif Subject: [RFC 3/4] mm/hugetlb_vmemmap: Use nid of the head page to reallocate it Date: Mon, 24 Jul 2023 14:46:43 +0100 Message-Id: <20230724134644.1299963-4-usama.arif@bytedance.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230724134644.1299963-1-usama.arif@bytedance.com> References: <20230724134644.1299963-1-usama.arif@bytedance.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772312011832760966 X-GMAIL-MSGID: 1772312011832760966 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 --- 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 b721e87de2b3..bdf750a4786b 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -324,7 +324,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;