From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by kanga.kvack.org (Postfix) with ESMTP id 404046B0311 for ; Mon, 24 Apr 2017 13:24:02 -0400 (EDT) Received: by mail-oi0-f72.google.com with SMTP id q199so101303780oic.2 for ; Mon, 24 Apr 2017 10:24:02 -0700 (PDT) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com. [2607:f8b0:4003:c06::22e]) by mx.google.com with ESMTPS id j64si10083783otc.142.2017.04.24.10.24.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 10:24:00 -0700 (PDT) Received: by mail-oi0-x22e.google.com with SMTP id w12so31224538oiw.3 for ; Mon, 24 Apr 2017 10:24:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20170423233125.nehmgtzldgi25niy@node.shutemov.name> References: <20170423233125.nehmgtzldgi25niy@node.shutemov.name> From: Dan Williams Date: Mon, 24 Apr 2017 10:23:59 -0700 Message-ID: Subject: Re: get_zone_device_page() in get_page() and page_cache_get_speculative() Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Linux MM , Catalin Marinas , "Aneesh Kumar K.V" , Steve Capper , Thomas Gleixner , Peter Zijlstra , Linux Kernel Mailing List , Ingo Molnar , Andrew Morton , "Kirill A. Shutemov" , "H. Peter Anvin" , Dave Hansen , Borislav Petkov , Rik van Riel , Dann Frazier , Linus Torvalds , Michal Hocko , linux-tip-commits@vger.kernel.org On Sun, Apr 23, 2017 at 4:31 PM, Kirill A. Shutemov wrote: > On Thu, Apr 20, 2017 at 02:46:51PM -0700, Dan Williams wrote: >> On Sat, Mar 18, 2017 at 2:52 AM, tip-bot for Kirill A. Shutemov >> wrote: >> > Commit-ID: 2947ba054a4dabbd82848728d765346886050029 >> > Gitweb: http://git.kernel.org/tip/2947ba054a4dabbd82848728d765346886050029 >> > Author: Kirill A. Shutemov >> > AuthorDate: Fri, 17 Mar 2017 00:39:06 +0300 >> > Committer: Ingo Molnar >> > CommitDate: Sat, 18 Mar 2017 09:48:03 +0100 >> > >> > x86/mm/gup: Switch GUP to the generic get_user_page_fast() implementation >> > >> > This patch provides all required callbacks required by the generic >> > get_user_pages_fast() code and switches x86 over - and removes >> > the platform specific implementation. >> > >> > Signed-off-by: Kirill A. Shutemov >> > Cc: Andrew Morton >> > Cc: Aneesh Kumar K . V >> > Cc: Borislav Petkov >> > Cc: Catalin Marinas >> > Cc: Dann Frazier >> > Cc: Dave Hansen >> > Cc: H. Peter Anvin >> > Cc: Linus Torvalds >> > Cc: Peter Zijlstra >> > Cc: Rik van Riel >> > Cc: Steve Capper >> > Cc: Thomas Gleixner >> > Cc: linux-arch@vger.kernel.org >> > Cc: linux-mm@kvack.org >> > Link: http://lkml.kernel.org/r/20170316213906.89528-1-kirill.shutemov@linux.intel.com >> > [ Minor readability edits. ] >> > Signed-off-by: Ingo Molnar >> >> I'm still trying to spot the bug, but bisect points to this patch as >> the point at which my unit tests start failing with the following >> signature: >> >> [ 35.423841] WARNING: CPU: 8 PID: 245 at lib/percpu-refcount.c:155 >> percpu_ref_switch_to_atomic_rcu+0x1f5/0x200 > > Okay, I've tracked it down. The issue is triggered by replacment > get_page() with page_cache_get_speculative(). > > page_cache_get_speculative() doesn't have get_zone_device_page(). :-| > > And I think it's your bug, Dan: it's wrong to have > get_/put_zone_device_page() in get_/put_page(). I must be handled by > page_ref_* machinery to catch all cases where we manipulate with page > refcount. The page_ref conversion landed in 4.6 *after* the ZONE_DEVICE implementation that landed in 4.5, so there was a missed conversion of the zone-device reference counting to page_ref. > Back to the big picture: > > I hate that we need to have such additional code in page refcount > primitives. I worked hard to remove compound page ugliness from there and > now zone_device creeping in... > > Is it the only option? Not sure, I need to spend some time to understand what page_ref means to ZONE_DEVICE. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org