From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56235C282C1 for ; Thu, 27 Feb 2025 17:20:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACC6B6B007B; Thu, 27 Feb 2025 12:20:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A7BF66B0082; Thu, 27 Feb 2025 12:20:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9447B6B0083; Thu, 27 Feb 2025 12:20:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7543B6B007B for ; Thu, 27 Feb 2025 12:20:23 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2219C141A4F for ; Thu, 27 Feb 2025 17:20:23 +0000 (UTC) X-FDA: 83166388326.16.6ED547D Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf14.hostedemail.com (Postfix) with ESMTP id B6C8B10001F for ; Thu, 27 Feb 2025 17:20:20 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=wu0ppAXx; spf=pass (imf14.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740676821; h=from:from:sender: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:dkim-signature; bh=xkF+oKOLzsqihO895ZKdKMiAlH7piGTcjUjNfw+BEIg=; b=uUkGhPj8rk6Vyjlf7+dD1RQ82Bdv7ofBURAHOugA4Wi7H+biw+s0nAUjsHJogweqsJ8phi LwFgvbvkagxf+E56v2TmZDcChSmxTc+gQjCtVZ41wB5S1RLgwsj+EyUFkrdxMAbZLi5KcQ Tg9i0IOnaOcMBEyb+tCOmj4tr00OuCY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=wu0ppAXx; spf=pass (imf14.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740676821; a=rsa-sha256; cv=none; b=7dGXitxGUHmrwX62BJwaz0vrm8ggCPYi0Ocvk8qsGyaINqD73wYPdRJBg4MW0KdZkzYPj0 rlrYq6+t5KQAjgz2kMw93YPUZhBhIPA7J+H63blLvsLkCIAgF/nKLXvcDTldK45BR+Iv25 DQZQrX+NfthjbJtfHWSX6TZBdg9z/r8= Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6dd15d03eacso12095516d6.0 for ; Thu, 27 Feb 2025 09:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1740676819; x=1741281619; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xkF+oKOLzsqihO895ZKdKMiAlH7piGTcjUjNfw+BEIg=; b=wu0ppAXxoXtNJdXcuf1fsKJ71yfxY5TYPi/YbjU1HH5GvOQeVefTKQHTqfw/l+F054 R5dKS4JjARPa0y2PQci90FFrLoFp1ySkEwr4OL4DkEHLw7Sq7g7NIgRGdNc+xEBZBOsY Fd63Sll7KDbwLSwWhpklnY1o2p+zLTzCI6AcuauwizKC+lxAIEL5pv9jRK6rFj0DuaCo vqdnQk+5A3yNVV4/MzAfxbxjSLa2dzrnTAX12EjhcNDOuZ4j6INtq9/veJkeQbk42MO9 2jhQBmutr9rW8ESb4J0mIBWPxeLm9yJ55yOSeu8lMP9CUPaVnTZoN25CwCGxV2LLQ53D Mfng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740676819; x=1741281619; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xkF+oKOLzsqihO895ZKdKMiAlH7piGTcjUjNfw+BEIg=; b=vs898D5ZBkeoW2lut4eIA4NOrzGyPXTWYrTpXJWahxsoxqPqnYcB9os3xw5ZbTqSYG jTrHcQJZdjY58Zzm4jHGzVlvnUMe2TpFKa7xwvC8E1WDKbzlLacFRyiMyaPiRu2zoHEK mi6XuF6fSg41YmE5BTb0zJM6IUeIswJyqSlBUjuiaWIJRAESxtE/Rgh7pJdZAhDCHXBc IpMz3JWBdOji0jkVAmNa4Z7rnR1phBx2QeyXymqDm1N3vufSLIZ8++LqelKlWiyk8SW0 roO1aC4qL5ll2Pm+5CzFlFwYbLk+75znN/Q4bcR89xza5Oy3RWns0ZGTMljK0N8f051c dVFQ== X-Forwarded-Encrypted: i=1; AJvYcCW1RH6vaKXyMoOjExMVECdEvbNkMJZnfLAuugSF4qQ/yqjtIszUNvlVCs5JwY914Wm8ide4ToXBuw==@kvack.org X-Gm-Message-State: AOJu0YzAdpS4EUVvg5K7UayHV3KFfwT2Dn5xm3FpNNDJpL/ORO8Ypljx 3qjjZOhqQvdnhu+k7B3fUHsDQdFXfmKWapVxo/JtG9neaS94tgtO215sPak9Jeg= X-Gm-Gg: ASbGncutvJ0As3AqZYOan5Te6+AEaN936I497EBUb1ZFnJv9psBl63SdPh8g/vflT0J C1XdQ+8Il8o9PyW5CF6/fQBQmXCvDWg/svk+AVcbefLT+yJ+szZ1aNcOhnOvCMMTJEyWXC3jrWq SKO35BZtAU6xEQWTiCkT971yc0CfdcQLrVlztt0AI4tVVlYlUieYtliajHJQv4EeW7+Y1bC3Vw0 clZHH0KcG3C+xzCqRVsGKyeK2H5gec6pZ8HmXMtIpBDwGeXyetsglxrECea+X6q4Z+sSS6cshEp OZSuv/p1Ds/0pwdUgvrRb4l0 X-Google-Smtp-Source: AGHT+IHYdFq65bDVHKEvy9PllmIUfIQ1sDzyYzXU29H6mgO9datE1+4OGR7iAKqeSXBKN69623GlPg== X-Received: by 2002:a05:6214:2462:b0:6e4:2479:d59b with SMTP id 6a1803df08f44-6e8a0d775e9mr3865626d6.16.1740676818915; Thu, 27 Feb 2025 09:20:18 -0800 (PST) Received: from localhost ([2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with UTF8SMTPSA id 6a1803df08f44-6e8976ccad9sm11798956d6.70.2025.02.27.09.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2025 09:20:18 -0800 (PST) Date: Thu, 27 Feb 2025 12:20:14 -0500 From: Johannes Weiner To: Frank van der Linden Cc: akpm@linux-foundation.org, muchun.song@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, yuzhao@google.com, usamaarif642@gmail.com, joao.m.martins@oracle.com, roman.gushchin@linux.dev Subject: Re: [PATCH v4 10/27] mm/sparse: allow for alternate vmemmap section init at boot Message-ID: <20250227172014.GB115948@cmpxchg.org> References: <20250218181656.207178-1-fvdl@google.com> <20250218181656.207178-11-fvdl@google.com> <20250226180900.GA1042@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B6C8B10001F X-Stat-Signature: teweg14cr9ywyhdhexbwy3t7pw6fze3u X-HE-Tag: 1740676820-385881 X-HE-Meta: U2FsdGVkX19We+Jrzik0jTzO/NP54jubQUP39KaeSUb+4qGOKjtDas7K+Bcr9FgjdEHKEvDpaGaZgqy7DthZYq98x5uac7eGWur4evto6n3M8GSwuR5y3ahE5K4h5+V59nCCW8LACZbCOY5oCkbGrld9q/SdGzWv+OhWYLyHyZYB7mesmSSwoO2yC3iIrk71jCPlDq8CfsRwdBW7Y2qJTjyoP5oerw823gv7T07AV4G9uJY1uYJUm6uiuVDFOxm+ieq1IvTby36khFnNLATEwYxzBl55sENEQd4AP9yU4MBxxeF0e95I4b0I6Wpb/eTBY+6sPcDaV6X6rbKE9gUY3ivS2j4e16WrdMopXMjA94KGB9xNOqV5kq8qzthfZtyPuNO8gI+gRc3XucKtVPZNSTqIqIZfiRoUot/DOrwmkIJA0unqCsnOp/NkuPIww4LLCJDJBdKEVKn2CrurAEJzEPUJCzS8E1XM4+yPy7++ZP/mobV7DSA4mWl3/hnV/s32FRff8Yy9cRLWKayxjxE8CSnawQqEt3WervZywTGdTWuChrkYKyZIAISQbu97dQYO2Izz+XPAsq4D5mVSYDB4Gvs4N3IUjFww/qXOfBTCVlXNQh5hvXOm1GRqrnfmPtbCi6j2BVwpeI53vtQK8Y2EBCDMb038DWvuFKowjE4R5HZWQjDTCvk2Bn0zjeYawvRx2yMUTpJlEBrCmCCYgmkFFr1uiDCXzD5/RXMOSE9/qfqO4Iig8yDvcntpDRNE0UzJlD8bwDtqPYpM3S1YhgfXr6+IHaDRa/O9dOGAC8/hlsmvKxp5h7IEqgdzloUlQOGc3zhWcWWuxsKMpNpbbY7HpiGtyC0AiX73eOqcouxv4Xtmg0Py/R4M6exkY7czl8AH1YUVucpNs8D5EkNRvH3MBHsUo3qvRgzCVeYqL/elp8KEuZ3CT9hA6V4FmleLCkIbLmynqQz0bYxWlMdmY1H D1jCq774 ztwgnKKqNnfh0lzqSgen8y0S7KcZ0JWEnFGHwk5vaxMof6/8rj0nJVpXy3SJTZOHrEGOmCpkLgbV311Y1gLvyah8Tch11yrtlldDR6u8fSxrIo4KcVMCbkIjKCfOae4BklQDzruJ0KCaFW/2/d2QdAf6irCUrS9lDWAl18ZWbjnrEvmbF8DHErODsthdgmE8H6aWemmv1tsg2FUEo+5x/UZpXGjeeAWJZ4QcDCE4ZLd78oJnWkg6i/K/DGKXvVeczCIrlcz/HE8nyKqTfsPy9TFCMG3rfc/dFuDN4Id2HWeVyhJhDKvj5mjBGy86ryfAkWGPJHtrPa4oSW4NsfJ3+EGSX+fWgSXpyMOnUn+PHxUFdnkxhi4ZpMcW8J92Ex3gCnqVjgnaL1uUo7ICQtuhtHDuQEVzy4IRwETZ7aJcTHMB3Y4pXGSgnL4WaBlvSn8sOB5K9frA7z3vQMmNS7vSnesPFyOE6uAtyxeFTJcf1A/eig52KG0E6WHE2ptYJEnDTFFNv X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Feb 27, 2025 at 08:47:18AM -0800, Frank van der Linden wrote: > On Wed, Feb 26, 2025 at 10:09 AM Johannes Weiner wrote: > > > > On Tue, Feb 18, 2025 at 06:16:38PM +0000, Frank van der Linden wrote: > > > @@ -489,6 +489,14 @@ config SPARSEMEM_VMEMMAP > > > SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise > > > pfn_to_page and page_to_pfn operations. This is the most > > > efficient option when sufficient kernel resources are available. > > > + > > > +config ARCH_WANT_SPARSEMEM_VMEMMAP_PREINIT > > > + bool > > > + > > > +config SPARSEMEM_VMEMMAP_PREINIT > > > + bool "Early init of sparse memory virtual memmap" > > > + depends on SPARSEMEM_VMEMMAP && ARCH_WANT_SPARSEMEM_VMEMMAP_PREINIT > > > + default y > > > > oldconfig just prompted me on this, but it's not clear to me what it > > does. Not even after skimming the changelog of the patch to be honest. > > > > Can you please add a help text that explains the user-visible effects > > of the toggle, as well as guidance as to who might care to change it? > > Hi Johannes, > > Thanks for your comment. How's this: Thanks for the quick reply! > Enables subsystems to pre-initialize memmap in their own way, > allowing for memory savings during boot. The HugeTLB code uses > this to initialize memmap for bootmem allocated gigantic hugepages > in a way that is done by HUGETLB_PAGE_OPTIMIZE_VMEMMAP. This > means saving this memory right away, instead of allocating it > first and then freeing it later. Not allocating these pages > at all during boot allows for specifying a bigger number of > hugepages on the kernel commandline on larger systems. That makes sense. But if it's infra code for a hugetlb feature, it should either be something that HUGETLB_PAGE_OPTIMIZE_VMEMMAP pulls in automatically, or at least be a hugetlb-specific option that pulls it in. Keep in mind that not everybody enables HUGETLBFS. In fact, hugetlb is default N. It's moot to ask users whether they want to enable infra code for a feature they aren't using, and default to Y no less. You're regressing innocent bystanders doing this.