From mboxrd@z Thu Jan 1 00:00:00 1970 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 117AE429825 for ; Thu, 30 Apr 2026 14:52:40 +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=1777560761; cv=none; b=KONkOkh7m1/RH6M48KUHMdbr4OuQtumWbK59IRdCG07PBptlNe9kfarTPR5Sx3C0TvbonFkPh6OkNdVFEdYg2SJ7TXJWzvamfgjTgjHgiKBXmGVa4KpwkqMrwV8Wwmj/mJpM0j34Qbc+pac5F333Ru/hmFTDsjvuysfyYe59DgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777560761; c=relaxed/simple; bh=YbFKQp1CWU2BNmbn4Lt+wO5guEbZeGI4xVzO7V9p7JQ=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=EAOijfrXpisdg7J+kLFbeDIrqFmQ88w5J6VZg7x31MvcPfsu0V9S5jobawh4Er55kA2gune+acPcvSeUR1kZO7tFnw8Mhvl6ezenWtoigZE+0Uh/pKoJhaReN820tVCwRGv4W+24F3dP2rnSIPKrdctSMwfwsmvj/Q5rwZfnuIg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=n69zv3t9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="n69zv3t9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 712A6C2BCB3; Thu, 30 Apr 2026 14:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777560760; bh=YbFKQp1CWU2BNmbn4Lt+wO5guEbZeGI4xVzO7V9p7JQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=n69zv3t9cf9ZBucWEfY3LTmi1/f8ekNkqKP3mixu6Gc6c6ujNL2kTcNeNbKgD8g5r X+eZrJ+RwT9e/m9mQQUV8Z/LHgFUuHn0dvN8q5HUVq/zwzfd8W0dX/cglBnI6+Uiyk bSjw1C8zeVbBqjU1ep4zK14JWCVKmuWstOS4i7c0= Date: Thu, 30 Apr 2026 07:52:39 -0700 From: Andrew Morton To: Hao Ge Cc: Suren Baghdasaryan , Kent Overstreet , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] mm/alloc_tag: replace fixed-size early PFN array with dynamic linked list Message-Id: <20260430075239.efcceac3d83ede2a2d22158c@linux-foundation.org> In-Reply-To: <20260430020226.34116-1-hao.ge@linux.dev> References: <20260430020226.34116-1-hao.ge@linux.dev> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 30 Apr 2026 10:02:26 +0800 Hao Ge wrote: > Pages allocated before page_ext is available have their codetag left > uninitialized. Track these early PFNs and clear their codetag in > clear_early_alloc_pfn_tag_refs() to avoid "alloc_tag was not set" > warnings when they are freed later. > > Currently a fixed-size array of 8192 entries is used, with a warning if > the limit is exceeded. However, the number of early allocations depends > on the number of CPUs and can be larger than 8192. > > Replace the fixed-size array with a dynamically allocated linked list > of pfn_pool structs. Each node is allocated via alloc_page() and mapped > to a pfn_pool containing a next pointer, an atomic slot counter, and a > PFN array that fills the remainder of the page. > > The tracking pages themselves are allocated via alloc_page(), which > would trigger __pgalloc_tag_add() -> alloc_tag_add_early_pfn() and > recurse indefinitely. Introduce __GFP_NO_CODETAG (reuses the > %__GFP_NO_OBJ_EXT bit) and pass gfp_flags through pgalloc_tag_add() > so that the early path can skip recording allocations that carry this > flag. Thanks. AI review asked a couple of questions: https://sashiko.dev/#/patchset/20260430020226.34116-1-hao.ge@linux.dev Please check to see if there's anything legitimate there? It also asked some different questions of the v3 patch: https://sashiko.dev/#/patchset/20260423083756.157902-1-hao.ge@linux.dev