lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55CA882F.3030403@sr71.net>
Date:	Tue, 11 Aug 2015 16:41:35 -0700
From:	Dave Hansen <dave@...1.net>
To:	vinayakm.list@...il.com, gregkh@...uxfoundation.org,
	arve@...roid.com, akpm@...ux-foundation.org
CC:	linux-kernel@...r.kernel.org,
	"Wood, Brian J" <brian.j.wood@...el.com>
Subject: Re: [PATCH v3] staging: android: lowmemorykiller: neglect swap cached
 pages in other_file

On 02/26/2014 11:06 AM, vinayakm.list@...il.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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ