From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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 4D0423EEAE1 for ; Thu, 23 Jul 2026 07:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784792977; cv=none; b=R1ToyHPYmqI+dxkvyw/KAKvmfZr0oV3idZmyPQdn/Wa9Zf+OdwU7i43refYdgjOc5WppKd4U1b7q5Nrl6mzyYtlsz+ezbZVjNKvJFBaBZaQgEEpiXo2TYPzUDeyedj9pGk7rBtFjXinNFR66OaGDv9nEPO1FL+x5hc3rTvcOqC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784792977; c=relaxed/simple; bh=cdll2SLRPsK8E8O2KPpha4m5jLkkhgIS39RCDPacR+4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YcVvB8lhfZA2E3fwkw7WbaERqkpzdQetNyX2c0oVErzRQztT4VilzBaazN3wZfI2Tu6DsbDLcRCn8J6/3D7QuwoqOI1+ez5g/jKCI6g5W+pNCNV7ndCX70d75w5zFmvwYnR3unWn5hlJFGxZt3QY2fsgnlZe2YJllZO6DggiZtY= 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=HQYoAXu9; arc=none smtp.client-ip=209.85.216.70 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="HQYoAXu9" Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-385d2703b64so245627a91.1 for ; Thu, 23 Jul 2026 00:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784792975; x=1785397775; 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=QZ586ewl8Eu4hmRzC2pHlsJckKHztM0Smyid7ZkeCg4=; b=HQYoAXu9NVk2R6zKj2z4YlA1EwLdaJIUFp7q5sSkt+2UiwGEJBfAOIDhLC1Daa13iy OAt3CDP+a0SEzhJaOOsMG4DU0XBpfZ69E/nWEkoBXhd9JqKpZPOOCZtiFG+AOHHAf9PD 7uE3xevJ6NnBLaSKdvnzvJtnbbzF/z1krbzK04B2brU8y6wz7TVh4sJ7ndPrktzzlPd5 2d/O052jU8iLHSfs3PQhGFTsijNk4A95hIAbYXgXU9YpY39IZggFFqgGPrV5s+l/Zlpf x9OXuLSRQZKPd4OSRLEtasMAxy3GDHaT2sWipUvtwYm3E8zGlCjFuF56cidRj2HUvsoc uNmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784792975; x=1785397775; 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=QZ586ewl8Eu4hmRzC2pHlsJckKHztM0Smyid7ZkeCg4=; b=HSJyi5gg8eOjZbY4uRh+PaKSUxMosFFzsbip4YmBMi0Th2WyV5ZRxNarjvigsMJXwy 79R0MbfS+D5gq2nGdAJLxEHswIt2BbBnHOjUplTfObveeR/wgLU27cax0HKdzWcRHhau RyFXNewDHCdo16hnq/e8rNmbgMnDtSwkXdTgJ+ANJdk4qjrHRGeYTS9QTNP1isNa37SP k/+jcCdFwcplgTNBqRzYn5Vu2wvl+axgEJ16KO+WoN7QTzF/3daS63iEWcCH/5dwiuWx kx1aA2sJY9kX7cSGwfZkebz5bX3pqnpxfieixT+y6HCg0jCL49RhD4wjmivUwf4Mx5pC Uk3Q== X-Forwarded-Encrypted: i=1; AHgh+RrEfuxYunbNJiOj08wrGWGXtQHzCdIgDknnF0WqbCQkpo4d4PIouYPJtv+qniVoX/DaAHgVxT01U2c+vaI=@vger.kernel.org X-Gm-Message-State: AOJu0YzTPat02qNMFpr+A3MGh/INuRIJ7vuLPUFGRGa+ercrf08lvHPJ j1coPlgpToOP1C59aW6ksSMkS/xRGEUWelxJvMs4wU7VbZdRABwWcubU4AL6jzMHPerzLL2MOOG No+XX5hfNow== X-Received: from dlec17-n2.prod.google.com ([2002:a05:701b:4291:20b0:13d:1fe2:b775]) (user=jyescas job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2b43:b0:38e:9784:dd47 with SMTP id 98e67ed59e1d1-38ec83975aemr1731583a91.1.1784792974394; Thu, 23 Jul 2026 00:49:34 -0700 (PDT) Date: Thu, 23 Jul 2026 00:47:06 -0700 In-Reply-To: <20260723074854.1013941-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: <20260723074854.1013941-1-jyescas@google.com> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog Message-ID: <20260723074854.1013941-3-jyescas@google.com> Subject: [RFC PATCH 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, 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 --- 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 dfdc2ee2eafe..47b08d056978 100644 --- a/mm/page_alloc_hogger.c +++ b/mm/page_alloc_hogger.c @@ -91,6 +91,34 @@ 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.229.g6434b31f56-goog