From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbbCZVhr (ORCPT ); Thu, 26 Mar 2015 17:37:47 -0400 Received: from mga03.intel.com ([134.134.136.65]:38816 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753308AbbCZVhm (ORCPT ); Thu, 26 Mar 2015 17:37:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,475,1422950400"; d="scan'208";a="686254823" Message-ID: <1427405861.29730.5.camel@theros.lm.intel.com> Subject: Re: [Linux-nvdimm] [PATCH 1/3] pmem: Initial version of persistent memory driver From: Ross Zwisler To: Christoph Hellwig Cc: Dan Williams , Jens Axboe , linux-nvdimm , X86 ML , "linux-kernel@vger.kernel.org" , linux-fsdevel Date: Thu, 26 Mar 2015 15:37:41 -0600 In-Reply-To: <20150326143520.GB1557@lst.de> References: <1427358764-6126-1-git-send-email-hch@lst.de> <1427358764-6126-2-git-send-email-hch@lst.de> <20150326143520.GB1557@lst.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20.rez) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-03-26 at 15:35 +0100, Christoph Hellwig wrote: > On Thu, Mar 26, 2015 at 07:12:23AM -0700, Dan Williams wrote: > > > + struct resource *res_mem; > > > + int err; > > > + > > > + res_mem = request_mem_region_exclusive(pmem->phys_addr, pmem->size, > > > + "pmem"); > > > > Isn't request_mem_region() enough? i.e. it seems > > request_mem_region_exclusive() assumes no DAX, at least in theory? > > This is 1:1 from the patch Ross sent, but I've been wondering why > request_mem_region_exclusive is used here. All it does is setting the > IORESOURCE_EXCLUSIVE flag, which prevents /dev/mem and sysfs from accessing > the memory while the driver claims it. Besides pmem only a watchdog driver > and e1000 make use of this flag, and there's various function related to > it that are entirely unused. It's a weird beast. I don't have a compelling reason to use request_mem_region_exclusive() over request_mem_region(). If the latter is cleaner I'm fine with the change.