Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753593AbbGOUUG (ORCPT ); Wed, 15 Jul 2015 16:20:06 -0400 Received: from resqmta-ch2-10v.sys.comcast.net ([69.252.207.42]:50174 "EHLO resqmta-ch2-10v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753097AbbGOUUE (ORCPT ); Wed, 15 Jul 2015 16:20:04 -0400 Date: Wed, 15 Jul 2015 15:20:01 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: "Kirill A. Shutemov" cc: Andrew Morton , Andrea Arcangeli , Hugh Dickins , Dave Hansen , Mel Gorman , Rik van Riel , Vlastimil Babka , 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 In-Reply-To: <1426784902-125149-1-git-send-email-kirill.shutemov@linux.intel.com> Message-ID: References: <1426784902-125149-1-git-send-email-kirill.shutemov@linux.intel.com> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1592 Lines: 33 On Thu, 19 Mar 2015, Kirill A. Shutemov wrote: > Currently we take naive approach to page flags on compound -- we set the > flag on the page without consideration if the flag makes sense for tail > page or for compound page in general. This patchset try to sort this out > by defining per-flag policy on what need to be done if page-flag helper > operate on compound page. Well we hand pointers to head pages around if handling compound pages. References to tail pages are dicey and should only be used in a limited way. At least that is true in the slab allocators and that was my understanding in earlier years. Therefore it does not make sense then check for tail pages. > For now I catched one case of illigal usage of page flags or ->mapping: > sound subsystem allocates pages with __GFP_COMP and maps them with PTEs. > It leads to setting dirty bit on tail pages and access to tail_page's > ->mapping. I don't see any bad behaviour caused by this, but worth fixing > anyway. Does this catch any errors? > This patchset makes more sense if you take my THP refcounting into > account: we will see more compound pages mapped with PTEs and we need to > define behaviour of flags on compound pages to avoid bugs. Ok that introduces the risk of pointers to tail pages becoming more of an issue. But that does not affect non pagecache pages. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/