linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pintu Kumar <pintu.ping@gmail.com>
To: Valdis.Kletnieks@vt.edu, Pintu Kumar <pintu.k@samsung.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 Kumar <pintu.ping@gmail.com>
Subject: Re: [PATCH 1/1] kernel/sysctl.c: Add /proc/sys/vm/shrink_memory feature
Date: Mon, 6 Jul 2015 22:53:35 +0530	[thread overview]
Message-ID: <CAOuPNLi56Eb5fVf86eHJtr6Q1jt1gSNqEMVZCEabrE=14ca25g@mail.gmail.com> (raw)

Sorry, looks like some problem with the yahoo mail. Some emails are bouncing.
Sending again with the gmail.


----- Original Message -----
> From: "Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu>
> To: Pintu Kumar <pintu.k@samsung.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
> Sent: Sunday, 5 July 2015 1:38 AM
> Subject: Re: [PATCH 1/1] kernel/sysctl.c: Add /proc/sys/vm/shrink_memory feature
>
> On Fri, 03 Jul 2015 18:50:07 +0530, Pintu Kumar said:
>
>> This patch provides 2 things:
>
>> 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.
>
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>
>> @@ -3571,12 +3571,17 @@ unsigned long shrink_all_memory(unsigned long
> nr_to_reclaim)
>>       struct reclaim_state reclaim_state;
>>       struct scan_control sc = {
>>           .nr_to_reclaim = nr_to_reclaim,
>> +#ifdef CONFIG_SHRINK_MEMORY
>> +        .gfp_mask = (GFP_HIGHUSER_MOVABLE | GFP_RECLAIM_MASK),
>> +        .hibernation_mode = 0,
>> +#else
>>           .gfp_mask = GFP_HIGHUSER_MOVABLE,
>> +        .hibernation_mode = 1,
>> +#endif
>
>
> That looks like a bug just waiting to happen.  What happens if we
> call an actual hibernation mode in a SHRINK_MEMORY=y kernel, and it finds
> an extra gfp mask bit set, and hibernation_mode set to an unexpected value?
>
Ok, got it. Thanks for pointing this out.
I will handle HIBERNATION & SHRINK_MEMORY case and send again.
I will try to handle it using ifdefs. Do you have any special
suggestions on how this can be handled?
I verified only for the ARM case without hibernation. But, it is
likely that this feature can be enabled in laptop mode also. So we
should handle it.

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

             reply	other threads:[~2015-07-06 17:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 17:23 Pintu Kumar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-06 18:38 Pintu Kumar
2015-07-03 13:20 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

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='CAOuPNLi56Eb5fVf86eHJtr6Q1jt1gSNqEMVZCEabrE=14ca25g@mail.gmail.com' \
    --to=pintu.ping@gmail.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --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.k@samsung.com \
    --cc=pintu_agarwal@yahoo.com \
    --cc=prarit@redhat.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