Questions about LMK default minfree/adj settings

閲覧: 246 回
最初の未読メッセージにスキップ

Joel Fernandes

未読、
2014/11/03 15:34:352014/11/03
To: android...@googlegroups.com、ccr...@android.com、ar...@android.com、s...@android.com、Greg KH
Hi, I am some questions and LMK's thresholds:

1.
I am trying to understand what is the reason for setting the default
values of minfree and adj to the following in lowmemorykiller.c? Why
not just use a linear mapping? for example, if the free memory is
below 50%, then just kill all processes which have prirority lower
than 50% of the highest priority plus or minus offset? In other words,
some kind of linear mapping? If a log mapping is required, then one
can just that no?

static int lowmem_adj[6] = {
0,
1,
6,
12,
};

static int lowmem_minfree[6] = {
3 * 512, /* 6MB */
2 * 1024, /* 8MB */
4 * 1024, /* 16MB */
16 * 1024, /* 64MB */
};

2. I see that the framework code (userspace) overrides these values on
boot in Line 90 of [1]. I find this a bit overkill. Why can't the
kernel just figure out what values in needs and why does userspace
have to tell the kernel? I have seen in the past that tuning the MM
system too much from userspace (such as the zone watermarks) have been
frowned up alot so it seems counter intuitive to me to allow userspace
to be allowed in the LMK case.

[1] https://android.googlesource.com/platform/frameworks/base/+/master/services/java/com/android/server/am/ProcessList.java

Thanks a lot and Regards,
Joel
全員に返信
投稿者に返信
転送
新着メール 0 件