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: <53A161C1.2070304@redhat.com>
Date:	Wed, 18 Jun 2014 11:54:09 +0200
From:	Jerome Marchand <jmarchan@...hat.com>
To:	Chen Yucong <slaoub@...il.com>
CC:	akpm@...ux-foundation.org, minchan@...nel.org, mgorman@...e.de,
	hannes@...xchg.org, mhocko@...e.cz, riel@...hat.com,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/vmscan.c: fix an implementation flaw in proportional
 scanning

On 06/18/2014 11:08 AM, Chen Yucong wrote:
> On Wed, 2014-06-18 at 11:00 +0200, Jerome Marchand wrote:
>>>               if (!nr_file || !nr_anon)
>>>                       break;
>>>  
>>> -             if (nr_file > nr_anon) {
>>> -                     unsigned long scan_target =
>> targets[LRU_INACTIVE_ANON] +
>>>
>> -                                             targets[LRU_ACTIVE_ANON]
>> + 1;
>>> +             file_percent = nr_file * 100 / file_target;
>>> +             anon_percent = nr_anon * 100 / anon_target;
>>
>> Here it could happen.
>>
>>
> The snippet 
> 	...
>                if (!nr_file || !nr_anon)
>                       break;

Looks like nr[] values can only decrease and stay positive. Then the
following should be true at all times:

file_target >= nr_file >= 0
anon_target >= nr_anon >= 0

and the code above should indeed avoid the divide by zero.

Thanks,
Jerome

>         ...
>  can help us to filter the situation which you have described. It comes
> from Mel's patch that is called:
> 
> mm: vmscan: use proportional scanning during direct reclaim and full
> scan at DEF_PRIORITY
> 
> thx!
> cyc
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
> 

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