From 640d3b737d4cb21290c2e9166cd984dea05863ff Mon Sep 17 00:00:00 2001 From: Bing Han Date: Fri, 15 Apr 2022 08:09:32 +0000 Subject: [PATCH] ANDROID: add vendor fields to swap_info_struct to record swap stats struct swap_info_struct :: ANDROID_VENDOR_DATA(1) It is pointer to a struct to record the following message: 1) total swapin pages; 2) total swapout pages; 3) total number of cold pages swapin; 4) total number of swapout pages, specified by userspace; 5) total number of swapout pages, specified by kernel; 6) the maxmium number of swapout pages; 7) the maxmium number of swapout pages allowed by kernel; 8) the maxmium number of swapout pages allowed by framework; Bug: 225795494 Change-Id: I779145a83d87e339db86ec81c7f962be99946afb Signed-off-by: Bing Han (cherry picked from commit af4eb0e377b09fe7e2f342bcca0e97fa43eaed41) (cherry picked from commit 29277e2bf79d36eede562b529c8e7b295e9a53df) --- include/linux/swap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/swap.h b/include/linux/swap.h index 56443d33ba2b..ea7cd815dd88 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -320,6 +320,7 @@ struct swap_info_struct { */ struct work_struct discard_work; /* discard worker */ struct swap_cluster_list discard_clusters; /* discard clusters list */ + ANDROID_VENDOR_DATA(1); struct plist_node avail_lists[]; /* * entries in swap_avail_heads, one * entry per node.