From: Dave Hansen <dave@sr71.net>
To: vinayakm.list@gmail.com, gregkh@linuxfoundation.org,
arve@android.com, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, "Wood, Brian J" <brian.j.wood@intel.com>
Subject: Re: [PATCH v3] staging: android: lowmemorykiller: neglect swap cached pages in other_file
Date: Tue, 11 Aug 2015 16:41:35 -0700 [thread overview]
Message-ID: <55CA882F.3030403@sr71.net> (raw)
In-Reply-To: <1393441582-3730-1-git-send-email-vinayakm.list@gmail.com>
On 02/26/2014 11:06 AM, vinayakm.list@gmail.com wrote:
> With ZRAM enabled it is observed that lowmemory killer
> doesn't trigger properly. swap cached pages are
> accounted in NR_FILE, and lowmemorykiller considers
> this as reclaimable and adds to other_file. But these
> pages can't be reclaimed unless lowmemorykiller triggers.
> So subtract swap pages from other_file.
...
> --- a/drivers/staging/android/lowmemorykiller.c
> +++ b/drivers/staging/android/lowmemorykiller.c
> @@ -88,7 +88,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
> int array_size = ARRAY_SIZE(lowmem_adj);
> int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
> int other_file = global_page_state(NR_FILE_PAGES) -
> - global_page_state(NR_SHMEM);
> + global_page_state(NR_SHMEM) -
> + total_swapcache_pages();
Sorry to dredge up an ancient thread. But, I'm not sure this is a good
commit
The swap cache is there for pages which are still in RAM but are also in
some stage of being written to disk. In this case, the "disk" in
question is ZRAM.
So, pages in the swap cache are probably "present" simultaneously in the
swap cache (the original copy) *and* in ZRAM (the compressed copy).
Swap cache pages *do* become reclaimable once their write to the backing
store is complete (just like any other dirty data).
I assume that this patch did *some* good, but perhaps it was via another
mechanism that what was described in the commit message. Or, perhaps
the fact that ZRAM consumes RAM has thrown the lowmemorykiller off
somehow, and this helps to compensate for that effect.
Vinayak, how have you seen this patch help?
prev parent reply other threads:[~2015-08-11 23:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 19:06 [PATCH v3] staging: android: lowmemorykiller: neglect swap cached pages in other_file vinayakm.list
2015-08-11 23:41 ` Dave Hansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55CA882F.3030403@sr71.net \
--to=dave@sr71.net \
--cc=akpm@linux-foundation.org \
--cc=arve@android.com \
--cc=brian.j.wood@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vinayakm.list@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.