From fac8fe3f7851cfa5751b60fb3c8d03e30e8122a6 Mon Sep 17 00:00:00 2001 From: Charan Teja Kalla Date: Wed, 19 Feb 2025 16:08:04 +0530 Subject: [PATCH] ANDROID: mm/shmem: fix trace hook used to get the shmem folio Before mTHP for shmem is added, there used different API for huge and order-0 folios. With mTHP, shmem_alloc_folio() is used for both and is differentiated at the order passed. To make better decission at the client, pass the order. Bug: 397599006 Change-Id: Idfc0fc82a8c6443fc6259d8b2f05a2d91d60ab38 Signed-off-by: Charan Teja Kalla --- include/trace/hooks/mm.h | 4 ++-- mm/shmem.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index de497de19043..3f882265c50f 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -14,8 +14,8 @@ struct folio; struct folio_batch; DECLARE_RESTRICTED_HOOK(android_rvh_shmem_get_folio, - TP_PROTO(struct shmem_inode_info *info, struct folio **folio), - TP_ARGS(info, folio), 2); + TP_PROTO(struct shmem_inode_info *info, struct folio **folio, int order), + TP_ARGS(info, folio, order), 3); DECLARE_RESTRICTED_HOOK(android_rvh_try_alloc_pages_gfp, TP_PROTO(struct page **page, unsigned int order, gfp_t gfp, enum zone_type highest_zoneidx), diff --git a/mm/shmem.c b/mm/shmem.c index 1f127a218f9d..375f4d89d836 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1776,7 +1776,7 @@ static struct folio *shmem_alloc_folio(gfp_t gfp, int order, struct folio *folio = NULL; mpol = shmem_get_pgoff_policy(info, index, order, &ilx); - trace_android_rvh_shmem_get_folio(info, &folio); + trace_android_rvh_shmem_get_folio(info, &folio, order); if (folio) goto done; folio = folio_alloc_mpol(gfp, order, mpol, ilx, numa_node_id());