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] [day] [month] [year] [list]
Date:   Mon, 26 Nov 2018 08:41:49 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Matthew Wilcox <willy@...radead.org>,
        Yang Yang <yang.yang29@....com.cn>
Cc:     akpm@...ux-foundation.org, mhocko@...e.com,
        pavel.tatashin@...rosoft.com, osalvador@...e.de,
        rppt@...ux.vnet.ibm.com, iamjoonsoo.kim@....com,
        alexander.h.duyck@...ux.intel.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
        wang.yi59@....com.cn
Subject: Re: [PATCH] mm: do not consider SWAP to calculate available when not
 necessary

On 11/26/18 3:01 AM, Matthew Wilcox wrote:
> On Mon, Nov 26, 2018 at 07:58:23AM +0800, Yang Yang wrote:
>> When si_mem_available() calculates 'available', it takes SWAP
>> into account. But if CONFIG_SWAP is N or SWAP is off(some embedded system
>> would like to do that), there is no need to consider it.
> 
> I don't understand this patch.  The pagecache can be written back to
> storage if it is dirty, regardless of whether there is swap space.
> 
>> @@ -4724,9 +4726,13 @@ long si_mem_available(void)
>>  	 * Not all the page cache can be freed, otherwise the system will
>>  	 * start swapping. Assume at least half of the page cache, or the

I guess the first sentence in the comment above might be misleading by
using the word 'swapping', where 'thrashing' would be more accurate and
unambiguous.

So this is not related to the swap, but to the assumption that somebody
is accessing the pages in pagecache, and if too much would be freed,
most accesses would mean reading data from disk, i.e. thrashing.

>>  	 * low watermark worth of cache, needs to stay.
>> +	 * But if CONFIG_SWAP is N or SWAP is off, do not consider it.
>>  	 */
>>  	pagecache = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE];
>> -	pagecache -= min(pagecache / 2, wmark_low);
>> +#ifdef CONFIG_SWAP
>> +	if (i.totalswap > 0)
>> +		pagecache -= min(pagecache / 2, wmark_low);
>> +#endif
>>  	available += pagecache;
>>  
>>  	/*
>> -- 
>> 2.15.2
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ