From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752195AbbCYK4B (ORCPT ); Wed, 25 Mar 2015 06:56:01 -0400 Received: from mta-out1.inet.fi ([62.71.2.195]:53688 "EHLO jenni1.inet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbbCYK4A (ORCPT ); Wed, 25 Mar 2015 06:56:00 -0400 Date: Wed, 25 Mar 2015 12:55:35 +0200 From: "Kirill A. Shutemov" To: Hugh Dickins Cc: "Kirill A. Shutemov" , Andrew Morton , Andrea Arcangeli , Dave Hansen , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 00/16] Sanitize usage of ->flags and ->mapping for tail pages Message-ID: <20150325105535.GA10932@node.dhcp.inet.fi> References: <1426784902-125149-1-git-send-email-kirill.shutemov@linux.intel.com> <20150323100433.GA30088@node.dhcp.inet.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2015 at 04:42:48PM -0700, Hugh Dickins wrote: > On Mon, 23 Mar 2015, Kirill A. Shutemov wrote: > > Yes, it works until some sound driver decide it wants to use > > page->mappging. > > (a) Why would it want to use page->mapping? No idea. > (b) What's the problem if it wants to use page->mapping? It would need to be initalized for all subpages to get core mm see correct value. And this doesn't match with current ->mapping users of __GFP_COMP page (THP and hugetlb) which initialize ->mapping only for head pages. > (c) Or perhaps some __GFP_COMP driver does already use page->mapping? I haven't found any. > > It's just pure luck that it happened to work in this particular case. > > We were lucky that it fitted together without needing extra code, yes. > But this didn't happen by accident, it was known and considered. I don't agree it was considered well enough. > > You only need to pay the expense if you hit tail page which is very rare > > in current kernel. I think we can pay this cost for correctness. > > But it's correct as is. See above. > > > > We will shave some cost of compound_head() if/when my refcounting patchset > > get merged: no need of barrier anymore. > > And if these changes are necessary for that, sure, go ahead: > but as part of that work. I believe the patchset has value by its own. And having it merged makes my life easier. But up to Andrew. -- Kirill A. Shutemov