From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (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 901B13F3295 for ; Thu, 23 Jul 2026 07:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784793079; cv=none; b=OKKY2yDfe6rJ/Za4FCYZul3qj/QclyFjq2AUN1CIKoGpNBUnGN1yenFGl3OiCF3pW9STwoRf9i17qvjsHO1vPsf5NahkDNTSCPVo/y8P5UU3SYnryyYDfjed5sYPN7AQdyVYxAIdVNnSX4PgzHi/GXF/ub90iziulkJhyXF+8eM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784793079; c=relaxed/simple; bh=6d7zGfBxdjpfyOtH1AKzBxybhaHYpOYr8NQxpni3W34=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=dsgRXxdJx1kG5flzOXdOIbONybEY7JYmV4wdhZoMRVgo82ObdcSqcPqzHi2xe/BPZYGoGpi3J6A95g//mdCCIKD6mew+InSdQ/itZBz4hznDC3ahfBe2cVqFj5+i88ko2ofZzoG6bDMbYNPJ5EEJveZ+X/nRcE366h4784cDkhA= 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=ZQtcmZbm; arc=none smtp.client-ip=209.85.215.200 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="ZQtcmZbm" Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cb74d5db64eso507690a12.2 for ; Thu, 23 Jul 2026 00:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784793078; x=1785397878; 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=5YYey/5Hv4fNNykpHycfCnNQ7fymswCzBiRznc3m07I=; b=ZQtcmZbm4cCeEN8tCbr04GMpdop3cpP8uRHhLzDCwKWE8EDi6sGteVi3qw8wjcobdy KmJYdVEEqefcpSE/dYLnhVRKHlbkWl9AnuBfouUvYFZGIKhTbRH116RcJ9++GmPe92aG +gpaY0O3Mv6m4YpKjz1OaTCFn8nKMNK9BSJl8/1S8sj8xEBoiACznTWUwv4yUZIaNbLj FQwnFcVLt/vzGQ5QmADEvmTHeD6MSwOh9wtS/EN+lsUH9Ogygj67pTQ9MPgZgQjmqqSc n2wuyYDchnAihvoSlS9Si501moikN06a2zMLRD35BnZeN2TBSgbclXfj+zQCq+7IdU7l nSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784793078; x=1785397878; 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=5YYey/5Hv4fNNykpHycfCnNQ7fymswCzBiRznc3m07I=; b=bAt8VzQIU+VfPXnf0lNo+1Sbw/yQv2ZhbmaJD4clRYi7fejcsrRbtbyT8IqbqQ3Y/s qG67+syV/WbkHg+9ib8TI/79m5Tt8Y3RsrZx773GyMnrjUK7TqSl7/r5eTLnymyN4I2u Ve6836nGDJqFp9fM1PUSNtfWBcfyZbZRjN5LgynQ2VPddC3nMrqsU/Jj/Xo6/HXsNJnf LbXYHCN5ZcY4hNcbV98Y2CKjLUPfz857CbgYoEzYGhO1sjzJoS3pE348c8Wp7NWvfcfY BkOaIspCL3IwKlr8ocEy4YJoiwy/mdv5h4KJ1fp7gLhKb2JyxlMWKMwpT9EoLPU4ggSS zH7g== X-Forwarded-Encrypted: i=1; AHgh+RrvKacmmlCOkkAD5zVZdsfvLv7Q4whHES1NVAfWOEjQ3Qri81p1ukc6t3QH6tKZ77rVEDBZygSInAv6tU4=@vger.kernel.org X-Gm-Message-State: AOJu0YzNW5ZnyqxK4Z2eY6sIO9rfcSMBGrV6FF/WHc3f2kOzJkWo3g81 UwAvcFQA7sUz6dR6FnLNNufJJgsu7TY9ThNbeU6ImP/taJV8Xwp5/yZKmoH++uM+A/yBlLlB8qu DQmy0nnVzlA== X-Received: from dyvo21-n2.prod.google.com ([2002:a05:693c:41d5:20b0:311:4890:b1b9]) (user=jyescas job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:7a96:b0:3c0:9c19:65b9 with SMTP id adf61e73a8af0-3c44b26f282mr2124168637.65.1784793077775; Thu, 23 Jul 2026 00:51:17 -0700 (PDT) Date: Thu, 23 Jul 2026 00:47:20 -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-17-jyescas@google.com> Subject: [RFC PATCH 16/16] mm: Release resources when the page alloc hogger module exits 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" When the page alloc hogger module exits: - free all the previously allocated pages - Erase all the entries from the xarray Signed-off-by: Juan Yescas --- mm/page_alloc_hogger.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/page_alloc_hogger.c b/mm/page_alloc_hogger.c index 5fe9c545e884..f554bbb4afa7 100644 --- a/mm/page_alloc_hogger.c +++ b/mm/page_alloc_hogger.c @@ -590,6 +590,14 @@ static int __init page_alloc_hogger_debugfs_init(void) static void __exit page_alloc_hogger_debugfs_exit(void) { + struct page_alloc *pa; + unsigned long idx; + + xa_for_each(&allocs_xa, idx, pa) { + __free_pages(pa->page, pa->req_alloc->order); + xa_erase(&allocs_xa, idx); + } + debugfs_remove_recursive(mmdir); kmem_cache_destroy(req_alloc_cache); kmem_cache_destroy(page_alloc_cache); -- 2.55.0.229.g6434b31f56-goog