Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4209981imm; Mon, 8 Oct 2018 17:22:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Y+xn8TzC5Rl2dmk3WX2+6muAuDHMl7dnocelkuX8MIEpzJ0CzUfNptNW+pWHspImnGYEy X-Received: by 2002:a63:1e5c:: with SMTP id p28-v6mr23551739pgm.376.1539044555193; Mon, 08 Oct 2018 17:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539044555; cv=none; d=google.com; s=arc-20160816; b=jC6X43eOwBKAT3+3MEM72S+zmQvgQjQOJo87qRdiJKOH/hQXHosPJdahqQXhbVcTMB GQxzQ/LFw/UQQFA9reXRyAIpCd2rRL0jC9Uq0RqbSyovJH/Zh0eFX/tU8MG+vjOHalZ5 gfsZC28Ykt0ma2R9RwJ+4Ee7gAqu9vKCb6qyE4zKKPMNOTR1iteWLLzmLzA4qg0uXXO7 tEki6E3Ly3571bbEd7uo2EFCQXX7RkbotUL2z3fhwkdGqX6Z5UEh3ZQcTcrRBb9vM7Tt xgDQPDH3NHnYf+NEaZVIdFzeIwa4DtMGJkGo+2E18ba3vW8Be/+hsc6a4uZib33eVNHS Vysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hI78rxtz5Bd0a+EXEvrpCdRbNmmli+ezXBuYUh1EPuk=; b=qGo+rjAz2vmJBtmJcgQcqbXuLUaiQ3JWcSOQ0/ivdalmZ+7sE8F7gCVZuxRzpMXgPb cXCMR4v3JJSIzdEDmHsgYDNIXGcXFYpUOU1JGCsEHFZhwXGuPVPIg4x+i+vuNGcybXdf esIuhCcbSSOJYJ14iUZgA3Vz9nwQYX22lS8VB+uO84QP4ypwe1c0r5WiE078sqyJMz7M NtfTYGgSY88G1yWNEn02HX+cc4sPh8G8erTSYnjafZgQ1igXvriZCKW/S3jRz0lrmwdt iOnITyC3hJ906UjCRnCBOOiLQ9whf8SwG78Dg8CNdklhqi7UUdXcgXHaIOZVavOKFPZm Z2Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=WU+wbSj6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j184-v6si20973235pfg.210.2018.10.08.17.22.20; Mon, 08 Oct 2018 17:22:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=WU+wbSj6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbeJIHfW (ORCPT + 99 others); Tue, 9 Oct 2018 03:35:22 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:44356 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbeJIHfV (ORCPT ); Tue, 9 Oct 2018 03:35:21 -0400 Received: by mail-ot1-f68.google.com with SMTP id p23so10071780otf.11 for ; Mon, 08 Oct 2018 17:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hI78rxtz5Bd0a+EXEvrpCdRbNmmli+ezXBuYUh1EPuk=; b=WU+wbSj6cd4nFLJ6m4/sqtDyunCEkeuOs3okKm73wPdft3Jqa/uj3j6A1cXTnkc2Vw pb+Zt2HXNn0D9WidLDS2rpN4A+JormME+gh2wIWOG9HOS2CUUJRjTJQntHRP1wRQFpm2 ldwQxGY/bvGnIX8z1sSa8a4k/PqzJVSfMhLocbiqfAGUpGflkSMJ8nMY0Y7LqmMVNLBs CS5nQRwt9DhVmD2P34aJKUsAM5PF7uUVcjpMYymU3r7891daENdojEiU3b4gchu//y3h HE5DEHErHKVHX4zP1A+AMSswQVuooeWpsL5vEoX1sUE/udc8NxRvL0vcaDXuTS3Vj+XM EMxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hI78rxtz5Bd0a+EXEvrpCdRbNmmli+ezXBuYUh1EPuk=; b=r6gGf4YQwWJc3myK0FVFPc72o3YyevCwN0/652azqhEtnsnEwypA04i0TZBbtDDV2E SbHMPdOrfIxiFIADea6hYRJMaeQ1xiCst3c9pDBLVTQLBBNoLb0ZSmT8yCOICotsAZLG ds1YEHGw3QdIdAfRYSIvqZrhrB1WE35+ltRDnOHzMFFzc4InpNwbtU0dSHrmpj7umPUs YGnxnNJf4IWLEhFSVkvVvYR354eBs+ZdtLcNXIv5+gImbNHqyUkdCec6kcWBY8yRrJxi 64WluXg2G1/xrg9w2YMB4G3IIt2t7JpIt/BaRgdQ6SU/pjYhRLP4eTlf+VbLarwF8GtH lfug== X-Gm-Message-State: ABuFfoizS1NL/C+5+llb/oYUf+glTBe8vC8bCKFidmjTOY8AMfGVT5ME L/pJZphqJwWUakgBP3oezZ1ldSzxc8RAI72X4Rocqw== X-Received: by 2002:a9d:24c7:: with SMTP id z65mr14907617ota.229.1539044465520; Mon, 08 Oct 2018 17:21:05 -0700 (PDT) MIME-Version: 1.0 References: <20181008233404.1909.37302.stgit@localhost.localdomain> In-Reply-To: <20181008233404.1909.37302.stgit@localhost.localdomain> From: Dan Williams Date: Mon, 8 Oct 2018 17:20:54 -0700 Message-ID: Subject: Re: [mm PATCH] memremap: Fix reference count for pgmap in devm_memremap_pages To: alexander.h.duyck@linux.intel.com Cc: Linux MM , Andrew Morton , Pasha Tatashin , Michal Hocko , Dave Jiang , linux-nvdimm , Linux Kernel Mailing List , Dave Hansen , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Logan Gunthorpe , Ingo Molnar , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 8, 2018 at 4:34 PM Alexander Duyck wrote: > > In the earlier patch "mm: defer ZONE_DEVICE page initialization to the > point where we init pgmap" I had overlooked the reference count that was > being held per page on the pgmap. As a result on running the ndctl test > "create.sh" we would call into devm_memremap_pages_release and encounter > the following percpu reference count error and hang: > WARNING: CPU: 30 PID: 0 at lib/percpu-refcount.c:155 > percpu_ref_switch_to_atomic_rcu+0xf3/0x120 > > This patch addresses that by performing an update for all of the device > PFNs in a single call. In my testing this seems to resolve the issue while > still allowing us to retain the improvements seen in memory initialization. > > Reported-by: Dan Williams Tested-by: Dan Williams Thanks Alex!