Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540AbbDAXN7 (ORCPT ); Wed, 1 Apr 2015 19:13:59 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35159 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750874AbbDAXN6 (ORCPT ); Wed, 1 Apr 2015 19:13:58 -0400 Date: Wed, 1 Apr 2015 16:13:47 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: "Kirill A. Shutemov" cc: "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Andrew Morton , Andrea Arcangeli , Dave Hansen , Hugh Dickins , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , Johannes Weiner , Michal Hocko , Jerome Marchand , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv4 12/24] thp: PMD splitting without splitting compound page In-Reply-To: <20150401131753.GD17153@node.dhcp.inet.fi> Message-ID: References: <1425486792-93161-1-git-send-email-kirill.shutemov@linux.intel.com> <1425486792-93161-13-git-send-email-kirill.shutemov@linux.intel.com> <87lhicbbf8.fsf@linux.vnet.ibm.com> <20150401131753.GD17153@node.dhcp.inet.fi> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 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: 1557 Lines: 47 On Wed, 1 Apr 2015, Kirill A. Shutemov wrote: > On Wed, Apr 01, 2015 at 12:08:35PM +0530, Aneesh Kumar K.V wrote: > > > > With this we now have pte mapping part of a compound page(). Now the > > gneric gup implementation does > > > > gup_pte_range() > > ptem = ptep = pte_offset_map(&pmd, addr); > > do { > > > > .... > > ... > > if (!page_cache_get_speculative(page)) > > goto pte_unmap; > > ..... > > } > > > > That page_cache_get_speculative will fail in our case because it does > > if (unlikely(!get_page_unless_zero(page))) on a tail page. ?? > > Nice catch, thanks. Indeed; but it's not the generic gup implementation, it's just the generic fast gup implementation. > > But the problem is not exclusive to my patchset. In current kernel some > drivers (sound, for instance) map compound pages with PTEs. Nobody has cared whether fast gup works on those, just so long as slow gup works on those without VM_IO | VM_PFNMAP. Whereas people did care that fast gup work on THPs, so gave them more complicated handling. > > We can try to get page_cache_get_speculative() work on PTE-mapped tail > pages. Untested patch is below. I didn't check through; but we'll agree that it's sad to see the complexity you've managed to reduce elsewhere now popping up again in other places. Hugh -- 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/