From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753855AbbHMSvy (ORCPT ); Thu, 13 Aug 2015 14:51:54 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34654 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbbHMSvw (ORCPT ); Thu, 13 Aug 2015 14:51:52 -0400 MIME-Version: 1.0 In-Reply-To: <55CCC6FB.1020901@plexistor.com> References: <20150813025112.36703.21333.stgit@otcpl-skl-sds-2.jf.intel.com> <20150813030119.36703.48416.stgit@otcpl-skl-sds-2.jf.intel.com> <55CC38B0.70502@plexistor.com> <55CCC6FB.1020901@plexistor.com> Date: Thu, 13 Aug 2015 11:51:51 -0700 Message-ID: Subject: Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to __pfn_t + kmap_atomic_pfn_t() From: Dan Williams To: Boaz Harrosh Cc: "linux-kernel@vger.kernel.org" , Jens Axboe , Rik van Riel , "linux-nvdimm@lists.01.org" , Linux MM , Mel Gorman , "torvalds@linux-foundation.org" , Christoph Hellwig Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2015 at 9:34 AM, Boaz Harrosh wrote: > On 08/13/2015 06:21 PM, Dan Williams wrote: >> On Wed, Aug 12, 2015 at 11:26 PM, Boaz Harrosh wrote: > <> >> >> Hmm, that's not the same block layer I've been working with for the >> past several years: >> >> $ mount /dev/pmem0 /mnt >> $ echo namespace0.0 > ../drivers/nd_pmem/unbind # succeeds >> >> Unbind always proceeds unconditionally. See the recent kernel summit >> topic discussion around devm vs unbind [1]. While kmap_atomic_pfn_t() >> does not implement revoke semantics it at least forces re-validation >> and time bounded references. For the unplug case we'll need to go >> shootdown those DAX mappings in userspace so that they return SIGBUS >> on access, or something along those lines. >> > > Then fix unbind to refuse. What is the point of unbind when it trashes > the hot path so badly and makes the code so fat. What? The DAX hot path avoids the kernel entirely. > Who uses it and what for? The device driver core. We simply can't hold off remove indefinitely. If the administrator wants the device disabled we need to tear down and revoke active mappings, or at very least guarantee time bounded removal. > First I ever heard of it and I do use Linux a little bit. > >> [1]: http://www.spinics.net/lists/kernel/msg2032864.html >> > Hm... > > OK I hate it. I would just make sure to override and refuse unbinding with an > elevated ref count. Is not a good reason for me to trash the hotpath. Again, the current usages are not in hot paths. If it becomes part of a hot path *and* shows up in a profile we can look to implement something with less overhead. Until then we should plan to honor the lifetime as defined by ->probe() and ->remove(). In fact I proposed the same as you, but then changed my mind based on Tejun's response [1]. So please reconsider this idea to solve the problem by blocking ->remove(). PMEM is new and special, but not *that* special as to justify breaking basic guarantees. [1]: https://lkml.org/lkml/2015/7/15/731