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: <53999563.9060105@suse.cz>
Date:	Thu, 12 Jun 2014 13:56:19 +0200
From:	Vlastimil Babka <vbabka@...e.cz>
To:	David Rientjes <rientjes@...gle.com>
CC:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg Thelen <gthelen@...gle.com>,
	Minchan Kim <minchan@...nel.org>, Mel Gorman <mgorman@...e.de>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Michal Nazarewicz <mina86@...a86.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Christoph Lameter <cl@...ux.com>,
	Rik van Riel <riel@...hat.com>
Subject: Re: [RFC PATCH 4/6] mm, compaction: skip buddy pages by their order
 in the migrate scanner

On 06/12/2014 02:21 AM, David Rientjes wrote:
> On Wed, 11 Jun 2014, Vlastimil Babka wrote:
>
>>> I hate to belabor this point, but I think gcc does treat it differently.
>>> If you look at the assembly comparing your patch to if you do
>>>
>>> 	unsigned long freepage_order = ACCESS_ONCE(page_private(page));
>>>
>>> instead, then if you enable annotation you'll see that gcc treats the
>>> store as page_x->D.y.private in your patch vs. MEM[(volatile long unsigned
>>> int *)page_x + 48B] with the above.
>>
>> Hm sure you compiled a version that used page_order_unsafe() and not
>> page_order()? Because I do see:
>>
>> MEM[(volatile long unsigned int *)valid_page_114 + 48B];
>>
>> That's gcc 4.8.1, but our gcc guy said he tried 4.5+ and all was like this.
>> And that it would be a gcc bug if not.
>> He also did a test where page_order was called twice in one function and
>> page_order_unsafe twice in another function. page_order() was reduced to a
>> single access in the assembly, page_order_unsafe were two accesses.
>>
>
> Ok, and I won't continue to push the point.

I'd rather know I'm correct and not just persistent enough :) If you 
confirm that your compiler behaves differently, then maybe making 
page_order_unsafe a #define instead of inline function would prevent 
this issue?

> I think the lockless
> suitable_migration_target() call that looks at page_order() is fine in the
> free scanner since we use it as a racy check, but it might benefit from
> either a comment describing the behavior or a sanity check for
> page_order(page) <= MAX_ORDER as you've done before.

OK, I'll add that.
--
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