From: PINTU KUMAR <pintu.k@samsung.com>
To: 'Xishi Qiu' <qiuxishi@huawei.com>
Cc: corbet@lwn.net, akpm@linux-foundation.org, vbabka@suse.cz,
gorcunov@openvz.org, mhocko@suse.cz, emunson@akamai.com,
kirill.shutemov@linux.intel.com, standby24x7@gmail.com,
hannes@cmpxchg.org, vdavydov@parallels.com, hughd@google.com,
minchan@kernel.org, tj@kernel.org, rientjes@google.com,
xypron.glpk@gmx.de, dzickus@redhat.com, prarit@redhat.com,
ebiederm@xmission.com, rostedt@goodmis.org, uobergfe@redhat.com,
paulmck@linux.vnet.ibm.com, iamjoonsoo.kim@lge.com,
ddstreet@ieee.org, sasha.levin@oracle.com, koct9i@gmail.com,
mgorman@suse.de, cj@linux.com, opensource.ganesh@gmail.com,
vinmenon@codeaurora.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-pm@vger.kernel.org, cpgs@samsung.com,
pintu_agarwal@yahoo.com, vishnu.ps@samsung.com,
rohit.kr@samsung.com, iqbal.ams@samsung.com,
pintu.ping@gmail.com
Subject: RE: [PATCH 1/1] kernel/sysctl.c: Add /proc/sys/vm/shrink_memory feature
Date: Tue, 07 Jul 2015 12:30:39 +0530 [thread overview]
Message-ID: <10f201d0b882$c9dc9480$5d95bd80$@samsung.com> (raw)
In-Reply-To: <559B2D89.2070802@huawei.com>
Hi,
> -----Original Message-----
> From: Xishi Qiu [mailto:qiuxishi@huawei.com]
> Sent: Tuesday, July 07, 2015 7:08 AM
> To: PINTU KUMAR
> Cc: corbet@lwn.net; akpm@linux-foundation.org; vbabka@suse.cz;
> gorcunov@openvz.org; mhocko@suse.cz; emunson@akamai.com;
> kirill.shutemov@linux.intel.com; standby24x7@gmail.com;
> hannes@cmpxchg.org; vdavydov@parallels.com; hughd@google.com;
> minchan@kernel.org; tj@kernel.org; rientjes@google.com;
> xypron.glpk@gmx.de; dzickus@redhat.com; prarit@redhat.com;
> ebiederm@xmission.com; rostedt@goodmis.org; uobergfe@redhat.com;
> paulmck@linux.vnet.ibm.com; iamjoonsoo.kim@lge.com; ddstreet@ieee.org;
> sasha.levin@oracle.com; koct9i@gmail.com; mgorman@suse.de; cj@linux.com;
> opensource.ganesh@gmail.com; vinmenon@codeaurora.org; linux-
> doc@vger.kernel.org; linux-kernel@vger.kernel.org; linux-mm@kvack.org; linux-
> pm@vger.kernel.org; cpgs@samsung.com; pintu_agarwal@yahoo.com;
> vishnu.ps@samsung.com; rohit.kr@samsung.com; iqbal.ams@samsung.com
> Subject: Re: [PATCH 1/1] kernel/sysctl.c: Add /proc/sys/vm/shrink_memory
> feature
>
> On 2015/7/6 22:03, PINTU KUMAR wrote:
>
> > Hi,
> >
> >> -----Original Message-----
> >> From: Xishi Qiu [mailto:qiuxishi@huawei.com]
> >> Sent: Monday, July 06, 2015 3:53 PM
> >> To: Pintu Kumar
> >> Cc: corbet@lwn.net; akpm@linux-foundation.org; vbabka@suse.cz;
> >> gorcunov@openvz.org; mhocko@suse.cz; emunson@akamai.com;
> >> kirill.shutemov@linux.intel.com; standby24x7@gmail.com;
> >> hannes@cmpxchg.org; vdavydov@parallels.com; hughd@google.com;
> >> minchan@kernel.org; tj@kernel.org; rientjes@google.com;
> >> xypron.glpk@gmx.de; dzickus@redhat.com; prarit@redhat.com;
> >> ebiederm@xmission.com; rostedt@goodmis.org; uobergfe@redhat.com;
> >> paulmck@linux.vnet.ibm.com; iamjoonsoo.kim@lge.com;
> >> ddstreet@ieee.org; sasha.levin@oracle.com; koct9i@gmail.com;
> >> mgorman@suse.de; cj@linux.com; opensource.ganesh@gmail.com;
> >> vinmenon@codeaurora.org; linux- doc@vger.kernel.org;
> >> linux-kernel@vger.kernel.org; linux-mm@kvack.org; linux-
> >> pm@vger.kernel.org; cpgs@samsung.com; pintu_agarwal@yahoo.com;
> >> vishnu.ps@samsung.com; rohit.kr@samsung.com; iqbal.ams@samsung.com
> >> Subject: Re: [PATCH 1/1] kernel/sysctl.c: Add
> >> /proc/sys/vm/shrink_memory feature
> >>
> >> On 2015/7/3 21:20, Pintu Kumar wrote:
> >>
> >>> This patch provides 2 things:
> >>> 1. Add new control called shrink_memory in /proc/sys/vm/.
> >>> This control can be used to aggressively reclaim memory system-wide
> >>> in one shot from the user space. A value of 1 will instruct the
> >>> kernel to reclaim as much as totalram_pages in the system.
> >>> Example: echo 1 > /proc/sys/vm/shrink_memory
> >>>
> >>> 2. Enable shrink_all_memory API in kernel with new
> >> CONFIG_SHRINK_MEMORY.
> >>> Currently, shrink_all_memory function is used only during hibernation.
> >>> With the new config we can make use of this API for non-hibernation
> >>> case also without disturbing the hibernation case.
> >>>
> >>> The detailed paper was presented in Embedded Linux Conference,
> >>> Mar-2015
> >>> http://events.linuxfoundation.org/sites/events/files/slides/
> >>> %5BELC-2015%5D-System-wide-Memory-Defragmenter.pdf
> >>>
> >>> Scenarios were this can be used and helpful are:
> >>> 1) Can be invoked just after system boot-up is finished.
> >>> 2) Can be invoked just before entering entire system suspend.
> >>> 3) Can be invoked from kernel when order-4 pages starts failing.
> >>> 4) Can be helpful to completely avoid or delay the kerenl OOM condition.
> >>> 5) Can be developed as a system-tool to quickly defragment entire system
> >>> from user space, without the need to kill any application.
> >>>
> >>
> >> Hi Pintu,
> >>
> >> How about increase min_free_kbytes and Android lowmemorykiller's level?
> >>
> > Thanks for the review.
> > Actually in Tizen, we don't use Android LMK and we wanted to delay the
> > LMK with aggressive direct_reclaim offline.
> > And increasing min_free value also may not help much.
> > Currently, in our case free memory never falls below 10MB, with 512MB
> > RAM configuration.
> >
>
> How about the performance as you reclaim so much memory?
> (e.g. shrink page cache, use zram, ksm, compaction...) When launching the same
> app next time, it may be slow, right?
>
Yes, obviously, there will be slight degrade in performance for relaunch of
application.
But, it will be better that the first launch.
Please check the following data:
Browser Launch:
01-01 12:06:26.550
01-01 12:06:28.340
Time taken: 1790 ms
Relaunch:
01-01 12:09:08.130
01-01 12:09:08.380
Time: 250ms
After shrink_memory again:
01-01 12:12:17.280
01-01 12:12:17.770
Time: 490ms
The main point here is that the killing is avoided and application data is
retained.
Also, when the memory pressure situation arises leading to slowpath again and
again,
We will be already in the performance degraded state.
Instead of continuous performance degradation, a one time is better.
> How about use cgroup to manage the apps, but I don't know how to do the
> detail.
>
Yes, we already use cgroups, vmpressure, to manage memory threshold for reclaim,
swap and kill.
Even cgroup also have a similar force_reclaim mechanism, to reclaim pages within
groups for a particular threshold.
But, that is at a later stages and also it does not care about order of the
pages.
It does not perform system-wide reclaim.
> Thanks,
> Xishi Qiu
>
> >
> >
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-07-07 7:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-03 13:20 [PATCH 1/1] kernel/sysctl.c: Add /proc/sys/vm/shrink_memory feature Pintu Kumar
2015-07-03 17:21 ` Heinrich Schuchardt
2015-07-06 13:52 ` PINTU KUMAR
2015-07-03 18:38 ` Johannes Weiner
2015-07-04 6:04 ` PINTU KUMAR
2015-07-04 12:55 ` Johannes Weiner
2015-07-04 8:05 ` PINTU KUMAR
2015-07-04 20:08 ` Valdis.Kletnieks
2015-07-05 2:15 ` PINTU KUMAR
2015-07-05 8:20 ` PINTU KUMAR
2015-07-06 16:51 ` PINTU KUMAR
2015-07-06 10:22 ` Xishi Qiu
2015-07-06 14:03 ` PINTU KUMAR
2015-07-07 1:38 ` Xishi Qiu
2015-07-07 7:00 ` PINTU KUMAR [this message]
2015-07-17 6:29 ` [PATCHv2 " Pintu Kumar
2015-07-17 6:58 ` PINTU KUMAR
2015-07-20 4:29 ` [PATCH v3 " Pintu Kumar
2015-07-20 8:28 ` Mel Gorman
2015-07-20 8:49 ` Michal Hocko
2015-07-20 16:13 ` PINTU KUMAR
2015-07-20 17:55 ` Mel Gorman
2015-07-22 13:03 ` PINTU KUMAR
2015-07-22 14:05 ` Mel Gorman
2015-07-29 5:11 ` PINTU KUMAR
2015-07-29 12:07 ` Johannes Weiner
-- strict thread matches above, loose matches on Subject: below --
2015-07-06 17:23 [PATCH " Pintu Kumar
2015-07-06 18:38 Pintu Kumar
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='10f201d0b882$c9dc9480$5d95bd80$@samsung.com' \
--to=pintu.k@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=cj@linux.com \
--cc=corbet@lwn.net \
--cc=cpgs@samsung.com \
--cc=ddstreet@ieee.org \
--cc=dzickus@redhat.com \
--cc=ebiederm@xmission.com \
--cc=emunson@akamai.com \
--cc=gorcunov@openvz.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=iqbal.ams@samsung.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=koct9i@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-pm@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=opensource.ganesh@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=pintu.ping@gmail.com \
--cc=pintu_agarwal@yahoo.com \
--cc=prarit@redhat.com \
--cc=qiuxishi@huawei.com \
--cc=rientjes@google.com \
--cc=rohit.kr@samsung.com \
--cc=rostedt@goodmis.org \
--cc=sasha.levin@oracle.com \
--cc=standby24x7@gmail.com \
--cc=tj@kernel.org \
--cc=uobergfe@redhat.com \
--cc=vbabka@suse.cz \
--cc=vdavydov@parallels.com \
--cc=vinmenon@codeaurora.org \
--cc=vishnu.ps@samsung.com \
--cc=xypron.glpk@gmx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).