From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E6C53ACA40 for ; Thu, 6 Aug 2026 01:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785978706; cv=none; b=Cmk0YH2EILqk2PPUGt7yz9MdAfXBt29fX+ZNiTJldm1eEzQBzfjJL4ORLjGyjlrsBq7lRZrX2dGdKc4w4LvCOOwglizZ8Ugn11FayeC1RhBYtkCdHwnO4Gffiy8/tnLPislbgTmtTMwd+7rpCQYAdZ92hZ+xWgiH7ZnOcKnGgEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785978706; c=relaxed/simple; bh=5AaApttVqbmS2RB38bffwjxMG95ohL6u4K18dqLzr2Q=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pHJy3FdXRwrQjQY69nj+3SOyBPfyqqMJH2UWRD5m3jqR0ngohtxO4ilkRGofXbXRiXxJPnOyYY7ozDgEllqKi7Llutsv0VWg/jkwppyTLqqqnzzUhkH0aNVIJlzPaDBlPvTIqdtQC7PTQ7ti4HoNk8dSpvBo4Vf8DYk1zEZqpXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jyescas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FCz0YAeo; arc=none smtp.client-ip=209.85.216.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jyescas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FCz0YAeo" Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38e475f83a2so2571546a91.1 for ; Wed, 05 Aug 2026 18:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785978704; x=1786583504; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=v2eQsWE6/2RUaKCIRrlhYiV3zZI+x2OroGpQf2kxf/g=; b=FCz0YAeocwurYxB4UqtLlYsgPfLNiuOJBpcTZGzeUQY3ohLhm7JbjSuRtXEBz00PZd 7wZ8EhoG40B7rl5N2iyPf6Do3l9KgoLwdDkrKcd9x0U+c5KdXt+vW+j/qwnuTeRxdijR uzTzB9EGKxCfsc+0i1oY6Wi7o5guwMBSDFziis7TdrCWrq/cCN6MQJqtokQfC5Jta+eh VajQHDL3rfIoYoWUX1sIkwtpOrFALdyZkgpH6MV5+dm67BtqkAN0vjxqBGaJ3UpX0pdE jxLjF05589UDM8OVZuIIIwl+tnyyLSKrHtTrvRpmvU7/STjBaNvil0ZbkLGNirssITAA rYBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785978704; x=1786583504; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=v2eQsWE6/2RUaKCIRrlhYiV3zZI+x2OroGpQf2kxf/g=; b=LgV5i4PVtxN97MVEqGUU88YQ4pjNYXah0zm5GHCCEldOaI7xUv8kwokX0gJaOrqTLA 7UdtQgQ3wG3wcDYevRRSQkxbEwp86LfxKVvl2DLYsg8ASedMirf3jIMdfcQU3JWhVFMZ Hyjae3EjwLZ7J596wNqV0Hxc6tcdm+07sFINtblFllEO76oVbsHOHHmlghROYq9NxOSG e4rgD5qYbKPRJqWx1tM1Hb9sI9XmknU5JLv7pTRB2izU3h8UasNq7o6KklCrUbf+bnlN xsA7HYeLorq6JWgchSNuo2oGkTAeoIjDnyQXzhV+x7NWZeo81rgZysra+lBuOVSmDaWk 0PlA== X-Forwarded-Encrypted: i=1; AHgh+RpgQg5wanNOKOwjO0sn58ZTV9dtiDx9Z45cL0OjwaHsJkkS/RIu/VL5IFaiWTSZqG61CyIvBGdsNY7gLW8=@vger.kernel.org X-Gm-Message-State: AOJu0YzH9ZdM/28eFhEhQWu7CrC1IePCAYv3PHzhaAe+1CA2AdnJjSXv NuGGhDlbLqPXLeBrtbsr/dVTkXaRs+yLc8LBQGITWl6VWmFnHVhoKqgEAY+thB4jCzgUDeQX/Oh CaRNCDvTm8Q== X-Received: from dloo4.prod.google.com ([2002:a05:7023:a44:b0:13d:1fe2:b775]) (user=jyescas job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3a8d:b0:38e:57a3:f218 with SMTP id 98e67ed59e1d1-3903c5b9f70mr9731131a91.13.1785978704313; Wed, 05 Aug 2026 18:11:44 -0700 (PDT) Date: Wed, 5 Aug 2026 18:09:03 -0700 In-Reply-To: <20260806011048.517229-1-jyescas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260806011048.517229-1-jyescas@google.com> X-Mailer: git-send-email 2.55.0.629.g250fe7f194-goog Message-ID: <20260806011048.517229-3-jyescas@google.com> Subject: [RFC PATCH v2 02/16] mm: Define structs for allocation requests and store allocations From: Juan Yescas To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , open list , "open list:MEMORY MANAGEMENT - CORE" Cc: jyescas@google.com, android-mm@google.com, ljs@kernel.org, fvdl@google.com, tkjos@google.com, minchan@google.com, dskiba@google.com, open list , "open list:MEMORY MANAGEMENT - CORE" Content-Type: text/plain; charset="UTF-8" This change introduces the next structs: - struct req_alloc to keep the request info for the allocation. - struct page_alloc to store a pointer to the page that was allocated, the request info and the file that represents this allocation. This file will be used to free the allocation when it is not longer needed. Signed-off-by: Juan Yescas --- Changes in v2: - Fix comment block. Add an extra * at the beginning. mm/page_alloc_hogger.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mm/page_alloc_hogger.c b/mm/page_alloc_hogger.c index 1d31e981920e..caeb2e5e8579 100644 --- a/mm/page_alloc_hogger.c +++ b/mm/page_alloc_hogger.c @@ -91,6 +91,34 @@ static struct dentry *mmdir; +/** + * struct req_alloc - Represents the requested allocation + * @node_idx: The Node index to allocate from. + * @zone_idx: The Zone index to allocate from. + * @order: The Order of pages to allocate. + * @migrate_type: The Migrate type to allocate from. + * @parentdir: The parent dir where the file representing the alloc was created. + */ +struct req_alloc { + int node_idx; + int zone_idx; + int order; + int migrate_type; + struct dentry *parentdir; +}; + +/** + * struct page_alloc - Represents the page allocation. + * @page: The pointer to the page(s) allocated. + * @req_alloc: The details of the allocation. + * @alloc_dentry: The pointer to the file that represents the allocation. + */ +struct page_alloc { + struct page *page; + struct req_alloc *req_alloc; + struct dentry *alloc_dentry; +}; + static int __init page_alloc_hogger_debugfs_init(void) { mmdir = debugfs_create_dir("mm", NULL); -- 2.55.0.629.g250fe7f194-goog