Hi kazu:
I found that vmlinux of GKI kernel-6.1 which is newest version in links below, it can make sure that nr_swapper_spaces not found.
https://ci.android.com/builds/submitted/11087000/kernel_aarch64/latest?hl=zh-cn
Download vmlinux in links and run: readelf -a vmlinux | grep nr_swapper_spaces
can not find this symbol.
Sent: Friday, December 1, 2023 4:07:08 PM
To: HAGIO KAZUHITO(?尾 一仁); devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: Lianbo Jiang
Subject: Re: [External Mail]Re: [BUG FIXED]fix bug of CACHED in kmem -i show memory
Hi kazu:
1. I know that kernel have nr_swapper_spaces since kernel 4.11 which brought into kernel with struct address_space *swapper_spaces[]
my team think GKI vmlinux did not have nr_swapper_spaces this symbol, may due to compile rule changed in AOSP code.
we will try to find the root cause of vmlinux without symbol name nr_swappera_space.
if (symbol_exists("nr_swapper_spaces") {
......
} else if (symbol_exists("swapper_spaces") {
......
} else if (symbol_exists("swapper_space") {
......
}
3. using my patch, it can fix output log of kmem -i which CACHED show not right.
Sent: Friday, December 1, 2023 3:08:03 PM
To: 薛国伦; devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: Lianbo Jiang
Subject: Re: [External Mail]Re: [BUG FIXED]fix bug of CACHED in kmem -i show memory
On 2023/11/30 22:05, 薛国伦 wrote:
> Hi kazu:
>
>
> 1. I found that vmlinux of kernel-6.1 did not have symbol nr_swapper_spaces but only have swapper_spaces
>
> Also check in GKI vmlinux, can not find nr_swapper_spaces
Hmm, upstream kernel 6.1 has it.
$ git show v6.1:mm/swap_state.c
struct address_space *swapper_spaces[MAX_SWAPFILES] __read_mostly;
static unsigned int nr_swapper_spaces[MAX_SWAPFILES] __read_mostly;
>
> It may have some problem in symbol of nr_swapper_spaces
>
>
> 2. I think that crash tools will check nr_swapper_spaces first and then check *swapper_spaces, swaper_space[] last.
>
> so first check nr_swapper_spaces not found, crash tool can use *swapper_spaces to enhance compatibility.
>
> The patch i send can resolve this situation which nr_swapper_spaces symbols can not found.
But I cannot determine whether your patch is correct and should be
applied, without kernel patches or the cause of no nr_swapper_spaces.
Could you please find the information (e.g. links) of the related kernel
patches?
Thanks,
Kazu
-- Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/ Contribution Guidelines: https://github.com/crash-utility/crash/wiki