Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1285243ybd; Wed, 26 Jun 2019 14:50:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1wcee3s/zawgZcuicxdsIaPLeN8MyMieASJIQZaJz9jpzXy6BvwYCqTdYvcnBdAaqi5UI X-Received: by 2002:a17:902:4183:: with SMTP id f3mr340632pld.336.1561585839749; Wed, 26 Jun 2019 14:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561585839; cv=none; d=google.com; s=arc-20160816; b=bJf2BepH0pdMWWvcxxm4L0LgHyJspWrUw/KGWvFOP2vRHSlmtzaxtqHlwsDSx5F7Pe VrTY4ycpVuSBo3eOeRGedIyQcmpU1zRBsDGgDa8J+GE2MvObN7UwbjrTKZlP0lVBaxuQ 64OsMH1yovUaB9gGsuHuVTjn7YELiw35WIL0Z/5nijRCvfBaEeofWCizOMHWkgSTCjcg aJeavu5HmEqyfNBSE2XNyWYMMG6u71o0NWOIg84VNJcpHVXTJyssqfY3w//v5P5J9t8Z 1QcV7kXva65NYMU6zt1BwfEEM7GmyIiOGz8y+XKI2ZWnb3WZC2IR6pv41yCFiE/Irhvv O8Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2CMZicb0w5xhua+jFN0mV4WCy1W1G/plgZFdEFNJpgI=; b=KMvVfjESKG1gkftyyejn4Eqg9nhbRd35yH3pVO07Gr92qgwkN28WgtB3m8bjhrN756 O01u5Q9S8Mnez66P/xHsdAl5YaA0Nt7GG5JB3s/S7xyRaBTDEFXv/NITUNX6XsNlharL NfHrWcUJYgsRTeOtuM+pUJAp4uqtJoly833lJwR2v0ghtREyi9UAXWzrFAIlU+evN7Wb qRnKxK6pVelGWbfjrKdkSjf5c89YW7ZWwJc3knae+uUYE8whUeM5HZuqfrVS9nNSB9DN YWGVNUljaBEr41trlaj+JtCeRhFokb1FVyrU9Uen3PPHGgaT0DsIBV0iCIfXq5/flPAW AcUg== ARC-Authentication-Results: i=1; mx.google.com; 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 i4si186625pgk.8.2019.06.26.14.50.23; Wed, 26 Jun 2019 14:50:39 -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; 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 S1726472AbfFZVsZ (ORCPT + 99 others); Wed, 26 Jun 2019 17:48:25 -0400 Received: from mga06.intel.com ([134.134.136.31]:46974 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbfFZVsZ (ORCPT ); Wed, 26 Jun 2019 17:48:25 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 14:48:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,421,1557212400"; d="scan'208";a="183267604" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga001.fm.intel.com with ESMTP; 26 Jun 2019 14:48:23 -0700 Date: Wed, 26 Jun 2019 14:48:23 -0700 From: Ira Weiny To: Christoph Hellwig Cc: Dan Williams , =?iso-8859-1?B?Suly9G1l?= Glisse , Jason Gunthorpe , Ben Skeggs , linux-nvdimm@lists.01.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH 16/25] device-dax: use the dev_pagemap internal refcount Message-ID: <20190626214823.GD8399@iweiny-DESK2.sc.intel.com> References: <20190626122724.13313-1-hch@lst.de> <20190626122724.13313-17-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190626122724.13313-17-hch@lst.de> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 02:27:15PM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > device-dax. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/dax/dax-private.h | 4 ---- > drivers/dax/device.c | 43 --------------------------------------- > 2 files changed, 47 deletions(-) > > diff --git a/drivers/dax/dax-private.h b/drivers/dax/dax-private.h > index b4177aafbbd1..c915889d1769 100644 > --- a/drivers/dax/dax-private.h > +++ b/drivers/dax/dax-private.h > @@ -43,8 +43,6 @@ struct dax_region { > * @target_node: effective numa node if dev_dax memory range is onlined > * @dev - device core > * @pgmap - pgmap for memmap setup / lifetime (driver owned) > - * @ref: pgmap reference count (driver owned) > - * @cmp: @ref final put completion (driver owned) > */ > struct dev_dax { > struct dax_region *region; > @@ -52,8 +50,6 @@ struct dev_dax { > int target_node; > struct device dev; > struct dev_pagemap pgmap; > - struct percpu_ref ref; > - struct completion cmp; > }; > > static inline struct dev_dax *to_dev_dax(struct device *dev) > diff --git a/drivers/dax/device.c b/drivers/dax/device.c > index b5257038c188..1af823b2fe6b 100644 > --- a/drivers/dax/device.c > +++ b/drivers/dax/device.c > @@ -14,36 +14,6 @@ > #include "dax-private.h" > #include "bus.h" > > -static struct dev_dax *ref_to_dev_dax(struct percpu_ref *ref) > -{ > - return container_of(ref, struct dev_dax, ref); > -} > - > -static void dev_dax_percpu_release(struct percpu_ref *ref) > -{ > - struct dev_dax *dev_dax = ref_to_dev_dax(ref); > - > - dev_dbg(&dev_dax->dev, "%s\n", __func__); > - complete(&dev_dax->cmp); > -} > - > -static void dev_dax_percpu_exit(struct dev_pagemap *pgmap) > -{ > - struct dev_dax *dev_dax = container_of(pgmap, struct dev_dax, pgmap); > - > - dev_dbg(&dev_dax->dev, "%s\n", __func__); > - wait_for_completion(&dev_dax->cmp); > - percpu_ref_exit(pgmap->ref); > -} > - > -static void dev_dax_percpu_kill(struct dev_pagemap *pgmap) > -{ > - struct dev_dax *dev_dax = container_of(pgmap, struct dev_dax, pgmap); > - > - dev_dbg(&dev_dax->dev, "%s\n", __func__); > - percpu_ref_kill(pgmap->ref); > -} > - > static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma, > const char *func) > { > @@ -441,11 +411,6 @@ static void dev_dax_kill(void *dev_dax) > kill_dev_dax(dev_dax); > } > > -static const struct dev_pagemap_ops dev_dax_pagemap_ops = { > - .kill = dev_dax_percpu_kill, > - .cleanup = dev_dax_percpu_exit, > -}; > - > int dev_dax_probe(struct device *dev) > { > struct dev_dax *dev_dax = to_dev_dax(dev); > @@ -463,15 +428,7 @@ int dev_dax_probe(struct device *dev) > return -EBUSY; > } > > - init_completion(&dev_dax->cmp); > - rc = percpu_ref_init(&dev_dax->ref, dev_dax_percpu_release, 0, > - GFP_KERNEL); > - if (rc) > - return rc; > - > - dev_dax->pgmap.ref = &dev_dax->ref; > dev_dax->pgmap.type = MEMORY_DEVICE_DEVDAX; > - dev_dax->pgmap.ops = &dev_dax_pagemap_ops; > addr = devm_memremap_pages(dev, &dev_dax->pgmap); > if (IS_ERR(addr)) > return PTR_ERR(addr); > -- > 2.20.1 > > _______________________________________________ > Linux-nvdimm mailing list > Linux-nvdimm@lists.01.org > https://lists.01.org/mailman/listinfo/linux-nvdimm