Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3105521lqo; Tue, 14 May 2024 22:40:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXq5yoyopY/h5ooxRewFpWkPQm+NGd57K/OfWWFmTqIlvmW6HqAgtMt0pevQXA6+d27o3CxOklWJWp4bfUq3eE+P1FjsA85UJ/+/aB5Yw== X-Google-Smtp-Source: AGHT+IHunIhX/GdKK81XVm+geGh1tI+PHDwhcMZVJPDUSjjqSIza30JpoNFy+S1F1mjAGNkLWkPH X-Received: by 2002:a50:f60d:0:b0:572:7c13:c7d8 with SMTP id 4fb4d7f45d1cf-5734d6effa0mr13767230a12.34.1715751609392; Tue, 14 May 2024 22:40:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715751609; cv=pass; d=google.com; s=arc-20160816; b=kc8/7pWL2U7JfHgcG29CXPcKgaot0n4U4GFoxYsnFB46gtvTNHu74KZaw/Q/lh0VYm npHMlmGBuWez8mUM3wcoAv9SUPUo/nWGa7lC5P7vLHU3/tYbyjJK6tXOHEwhb21I6iiV tq3eTalOOb/22O3kPwNVOqXzvPlKtXwvsRxcdsUp8EZ2/Y6V9fay0KEKYrp7atRrWzru CGjMO/wGF+PkfRfAGlZunDqaWcfzZJSHoHDqNncsvMoxOLN1cbFHA7cB3SjrQ4qaxodi K8Xya34I7JrGGK3MhT8/hmcE39VqJf88KCe0igurmVd5j/Wd4yIC2MbatSusnAJpVHSN Zi9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=qgfgtIkQYgpjWNOudfdaNpbRMK6rSZI+kLjU1IbLZdk=; fh=LRfPxBk2OP+DAuo3YbunrPBRmYFxBo7eeB8ZJxeFdOY=; b=XTMkfM6X06Wg++plG3iMLzIr89VUyFU6zO73wO4RJchyRBV0Cw4bMVU/q/JJmQ7Hk6 QmR8gCjgjqGeCLy2smJKWXtS6O68Db3cmWLW9T6De7ZUqrmsZ4kvBiR9V7CdOAKPmMv+ O4ydGKE6APM7bhVd/JtPTksoJvbwulrqDnPhKFb3oTH+ARZHaoU5Mb72AgRTRvz2gpap N+qDYvLqFR17MRKx1k6AoTR5USEDRvrUzRTa4khO/vQgX0MlhN8WDx3xfLbksgujjRFt jYFjSBHr/VYY7MyhgdjfspmkER4xqxMet99TBBBm/7e8Lh+Ujn40bmd6Z5GBpFUUCLj/ dvrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ca5UtmZX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c37825asi7333176a12.645.2024.05.14.22.40.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 22:40:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ca5UtmZX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 25BE71F216DD for ; Wed, 15 May 2024 05:40:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23EDC3BB22; Wed, 15 May 2024 05:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ca5UtmZX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40D5C3B781 for ; Wed, 15 May 2024 05:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715751601; cv=none; b=neTQ4QwuVrB7Qy+R84lJYXF/c5PbXhrjl6xyFIl5PKxyTBe7ywgtRwra8DTLC8UVWRSBOL816GO/2aFH045HvCJd8OnYhSsXXc7iNMJJwmlP+3d2DO2qA0lpZBnauObJT7Gk5Cc4DYhkdFiGJKslPq5wCMSxDgni1gR4OREIe7w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715751601; c=relaxed/simple; bh=qFeWv8GsFEP94NiH8hpu0MILQkrgqqI5f7XEUQ/bekw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=tO/rwCV/aFKBXoXQdA8py/2fDsMuobx266UJgavcJh33g0XjLztoxu8Z9LyohLPR3f+Q2q3OxyeLPYoZvsorOJkAPgzEHcZ5zIrcmqurUCRgbu4r6u+Cpjf1z5LOsJaMc4yRUeAeZ/XH5+eJgREmVAVDvFKKCSS5qWd5iA7mXew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ca5UtmZX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D1DDC116B1; Wed, 15 May 2024 05:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715751600; bh=qFeWv8GsFEP94NiH8hpu0MILQkrgqqI5f7XEUQ/bekw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ca5UtmZXO0PHjPXUUdc+VZYnkPVpb5jib4ktCpzzV3ZhA546YhW9UHk5pBrTsB8fs 5OCudtSHCOl3d3tTP3zo7RdBrJ8iHRR/KdAfFY0cca7m/EF0pacW8X7Wpz3cWwdto7 QOq82dcN4g4o9WbzMkFB9Q12wjhuxcMlhN5k61iDy/Hdzzp2lWztAOY+rqK8b1NDji 7PoAKLqCS0xjrsOBxo4Pjl81GboukdaMGq7BdQUF1nz0FsP8sokZnjlqgS/O9SKSKy ASyYdWBijdb1z+6/2VB4SVQs5vdkkYQlveAVRDdcnzToprQ2NzuYIZYWyPJQVwjBm2 +I5sghOxb1v1A== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Oscar Salvador Cc: Alexandre Ghiti , Albert Ou , David Hildenbrand , Palmer Dabbelt , Paul Walmsley , linux-riscv@lists.infradead.org, =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Andrew Bresticker , Chethan Seshadri , Lorenzo Stoakes , Santosh Mamila , Sivakumar Munnangi , Sunil V L , linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 2/8] riscv: mm: Change attribute from __init to __meminit for page functions In-Reply-To: References: <20240514140446.538622-1-bjorn@kernel.org> <20240514140446.538622-3-bjorn@kernel.org> Date: Wed, 15 May 2024 07:39:57 +0200 Message-ID: <87r0e3k502.fsf@all.your.base.are.belong.to.us> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Oscar Salvador writes: > On Tue, May 14, 2024 at 04:04:40PM +0200, Bj=C3=B6rn T=C3=B6pel wrote: >> From: Bj=C3=B6rn T=C3=B6pel >>=20 >> Prepare for memory hotplugging support by changing from __init to >> __meminit for the page table functions that are used by the upcoming >> architecture specific callbacks. >>=20 >> Changing the __init attribute to __meminit, avoids that the functions >> are removed after init. The __meminit attribute makes sure the >> functions are kept in the kernel text post init, but only if memory >> hotplugging is enabled for the build. >>=20 >> Also, make sure that the altmap parameter is properly passed on to >> vmemmap_populate_hugepages(). >>=20 >> Signed-off-by: Bj=C3=B6rn T=C3=B6pel > > Reviewed-by: Oscar Salvador > >> +static void __meminit create_linear_mapping_range(phys_addr_t start, ph= ys_addr_t end, >> + uintptr_t fixed_map_size) >> { >> phys_addr_t pa; >> uintptr_t va, map_size; >> @@ -1435,7 +1429,7 @@ int __meminit vmemmap_populate(unsigned long start= , unsigned long end, int node, >> * memory hotplug, we are not able to update all the page tables with >> * the new PMDs. >> */ >> - return vmemmap_populate_hugepages(start, end, node, NULL); >> + return vmemmap_populate_hugepages(start, end, node, altmap); > > I would have put this into a separate patch. Thanks for the review, Oscar! I'll split this up (also suggested by Alex!). Cheers, Bj=C3=B6rn