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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHO5Pa0srsWS6ukpxUo=EqCOxRmYa7c_7PDg1YPh7gcMGWPpaw@mail.gmail.com>
Date:	Wed, 3 Apr 2013 12:10:22 +0200
From:	Michael Kerrisk <mtk.manpages@...il.com>
To:	Minchan Kim <minchan@...nel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>, Mel Gorman <mgorman@...e.de>,
	Rik van Riel <riel@...hat.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Hugh Dickins <hughd@...gle.com>,
	Sangseok Lee <sangseok.lee@....com>,
	Michael Kerrisk-manpages <mtk.manpages@...il.com>
Subject: Re: [RFC 1/4] mm: Per process reclaim

Hello Minchan,

On Mon, Mar 25, 2013 at 7:21 AM, Minchan Kim <minchan@...nel.org> wrote:
> These day, there are many platforms avaiable in the embedded market
> and they are smarter than kernel which has very limited information
> about working set so they want to involve memory management more heavily
> like android's lowmemory killer and ashmem or recent many lowmemory
> notifier(there was several trial for various company NOKIA, SAMSUNG,
> Linaro, Google ChromeOS, Redhat).
>
> One of the simple imagine scenario about userspace's intelligence is that
> platform can manage tasks as forground and backgroud so it would be
> better to reclaim background's task pages for end-user's *responsibility*
> although it has frequent referenced pages.
>
> This patch adds new knob "reclaim under proc/<pid>/" so task manager
> can reclaim any target process anytime, anywhere. It could give another
> method to platform for using memory efficiently.
>
> It can avoid process killing for getting free memory, which was really
> terrible experience because I lost my best score of game I had ever
> after I switch the phone call while I enjoyed the game.
>
> Writing 1 to /proc/pid/reclaim reclaims only file pages.
> Writing 2 to /proc/pid/reclaim reclaims only anonymous pages.
> Writing 3 to /proc/pid/reclaim reclaims all pages from target process.

This interface seems to work as advertized, at least from some light
testing that I've done.

However, the interface is a quite blunt instrument. Would there be any
virtue in extending it so that an address range could be written to
/proc/PID/reclaim? Used in conjunction with /proc/PID/maps, a manager
process might then choose to trigger reclaim of just selected regions
of a processes address space. Thus, one might reclaim file backed
pages in a range using:

    echo '2 start-address end-address' > /proc/PID/reclaim

What do you think?

Thanks,

Michael
--
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