[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <555AFBF3.1010601@suse.cz>
Date: Tue, 19 May 2015 11:01:39 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: "Kirill A. Shutemov" <kirill@...temov.name>
CC: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
Dave Hansen <dave.hansen@...el.com>,
Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
Christoph Lameter <cl@...two.org>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Steve Capper <steve.capper@...aro.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.cz>,
Jerome Marchand <jmarchan@...hat.com>,
Sasha Levin <sasha.levin@...cle.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCHv5 19/28] mm: store mapcount for compound page separately
On 05/19/2015 05:55 AM, Kirill A. Shutemov wrote:
>>
>>> + if (compound_mapcount(page))
>>> + ret += compound_mapcount(page) - 1;
>>
>> This looks like it could uselessly duplicate-inline the code for
>> compound_mapcount(). It has atomics and smp_rmb() so I'm not sure if the
>> compiler can just "squash it".
>
> Good point. I'll rework this.
Hm BTW I think same duplication of compound_head() happens in
lock_page(), where it's done by trylock_page() and then __lock_page(),
which is also in different compilation unit to make things worse.
I can imagine it's solvable by introducing variants of __lock_page* that
expect to be already given a head page... if it's worth the trouble.
>>
>> On the other hand, a simple atomic read that was page_mapcount() has turned
>> into multiple atomic reads and flag checks. What about the stability of the
>> whole result? Are all callers ok? (maybe a later page deals with it).
>
> Urghh.. I'll look into this.
>
--
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