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]
Date:   Thu, 13 Feb 2020 19:58:40 -0800
From:   Yang Shi <yang.shi@...ux.alibaba.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     willy@...radead.org, mhocko@...e.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: migrate.c: migrate PG_readahead flag



On 2/13/20 6:55 PM, Andrew Morton wrote:
> On Fri, 14 Feb 2020 08:29:45 +0800 Yang Shi <yang.shi@...ux.alibaba.com> wrote:
>
>> Currently migration code doesn't migrate PG_readahead flag.
>> Theoretically this would incur slight performance loss as the
>> application might have to ramp its readahead back up again.  Even though
>> such problem happens, it might be hidden by something else since
>> migration is typically triggered by compaction and NUMA balancing, any
>> of which should be more noticeable.
>>
>> Migrate the flag after end_page_writeback() since it may clear
>> PG_reclaim flag, which is the same bit as PG_readahead, for the new
>> page.
>>
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -647,6 +647,14 @@ void migrate_page_states(struct page *newpage, struct page *page)
>>   	if (PageWriteback(newpage))
>>   		end_page_writeback(newpage);
>>   
>> +	/*
>> +	 * PG_readahead share the same bit with PG_reclaim, the above
>> +	 * end_page_writeback() may clear PG_readahead mistakenly, so set
>> +	 * the bit after that.
>> +	 */
>> +	if (PageReadahead(page))
>> +		SetPageReadahead(newpage);
>> +
>>   	copy_page_owner(page, newpage);
>>   
> Why not

The newpage may not have writeback set, migrating readahead flag should 
not depend on it.

>
>    	if (PageWriteback(newpage)) {
>    		end_page_writeback(newpage);
> 		/*
> 		 * PG_readahead share the same bit with PG_reclaim, the above
> 		 * end_page_writeback() may clear PG_readahead mistakenly, so
> 		 * set the bit after that.
> 		 */
> 		if (PageReadahead(page))
> 			SetPageReadahead(newpage);
> 	}
>
> ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ