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>] [day] [month] [year] [list]
Date:	Mon, 6 Jul 2015 22:53:35 +0530
From:	Pintu Kumar <pintu.ping@...il.com>
To:	Valdis.Kletnieks@...edu, Pintu Kumar <pintu.k@...sung.com>
Cc:	corbet@....net, akpm@...ux-foundation.org, vbabka@...e.cz,
	gorcunov@...nvz.org, mhocko@...e.cz, emunson@...mai.com,
	kirill.shutemov@...ux.intel.com, standby24x7@...il.com,
	hannes@...xchg.org, vdavydov@...allels.com, hughd@...gle.com,
	minchan@...nel.org, tj@...nel.org, rientjes@...gle.com,
	xypron.glpk@....de, dzickus@...hat.com, prarit@...hat.com,
	ebiederm@...ssion.com, rostedt@...dmis.org, uobergfe@...hat.com,
	paulmck@...ux.vnet.ibm.com, iamjoonsoo.kim@....com,
	ddstreet@...e.org, sasha.levin@...cle.com, koct9i@...il.com,
	mgorman@...e.de, cj@...ux.com, opensource.ganesh@...il.com,
	vinmenon@...eaurora.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	linux-pm@...r.kernel.org, cpgs@...sung.com,
	pintu_agarwal@...oo.com, vishnu.ps@...sung.com,
	rohit.kr@...sung.com, iqbal.ams@...sung.com,
	Pintu Kumar <pintu.ping@...il.com>
Subject: Re: [PATCH 1/1] kernel/sysctl.c: Add /proc/sys/vm/shrink_memory feature

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


----- Original Message -----
> From: "Valdis.Kletnieks@...edu" <Valdis.Kletnieks@...edu>
> To: Pintu Kumar <pintu.k@...sung.com>
> Cc: corbet@....net; akpm@...ux-foundation.org; vbabka@...e.cz; gorcunov@...nvz.org; mhocko@...e.cz; emunson@...mai.com; kirill.shutemov@...ux.intel.com; standby24x7@...il.com; hannes@...xchg.org; vdavydov@...allels.com; hughd@...gle.com; minchan@...nel.org; tj@...nel.org; rientjes@...gle.com; xypron.glpk@....de; dzickus@...hat.com; prarit@...hat.com; ebiederm@...ssion.com; rostedt@...dmis.org; uobergfe@...hat.com; paulmck@...ux.vnet.ibm.com; iamjoonsoo.kim@....com; ddstreet@...e.org; sasha.levin@...cle.com; koct9i@...il.com; mgorman@...e.de; cj@...ux.com; opensource.ganesh@...il.com; vinmenon@...eaurora.org; linux-doc@...r.kernel.org; linux-kernel@...r.kernel.org; linux-mm@...ck.org; linux-pm@...r.kernel.org; cpgs@...sung.com; pintu_agarwal@...oo.com; vishnu.ps@...sung.com; rohit.kr@...sung.com; iqbal.ams@...sung.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 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