Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp227227imm; Mon, 4 Jun 2018 16:24:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKeAGB7lFT3RiI3nVrHmawzZuQ4N5gMeC6gtR2KiVdBgYZp9yhalZrbU4b4+7icpCm1Ypob X-Received: by 2002:a65:4aca:: with SMTP id c10-v6mr10225263pgu.244.1528154698307; Mon, 04 Jun 2018 16:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528154698; cv=none; d=google.com; s=arc-20160816; b=Nl90gGNWSiWoVY5ZxqQbTb3VXc06OfMW4QRcpIiLJglEdABsC9BRTXfqOpjPucaccC P2X7gw1XSf1JhcqXN1mITOSHEM8WUq63J2MZf/lWX9mVnvbgc5cZTKhi8y8KYPjfLIMH 9s5Y1IFegWXStBSlHwqNMCCDJSBaMttEGLSyxbndPwpbnBuGxb0wxpcvQpxjqYoeOg3x 0Q09fgwHQdyRfp65P//LDjcValh9jhfiCdz2vqCWQEbfhDL2fSkCkhhHlysaz18kZPXP oOnaLk5JW6pmnqzoH8lZyz9hJCc5r9F1LtFkqi2Y1wvvlDzp66s6WGRsf7JhDXxSj6Ak hzmQ== 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:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=svCvC5NFk9ORdqmZWv6NQtdGELBlc7SIqc/nASSJ7KE=; b=hMMZDb2IfCh95vwfcBF2MOshYmnJ6VNuP1ywKv9CppumlBsNNKuYKQ+ucNtLHyZP0Z 1znBUg1HIMhJTsKwIif+8dnOGIcov6DnNP5sZLJjU2bO1dHHaPHMrEA8JJpQ+ov1f8+c lxs+dolvAAglKISGWmefW3Tec2d6aoe3aX2uc4G557D9za1WVUoKU1I6epKUhAqux7Oe 9I6huHtG9d/UUZaLJLmcSx82cPD2KYeR/6MX8Y19dSIeEHIcPstESOuP6b4MKkAUFMu5 tUaNK4QWvk0Jh56eOp9xyQjlCvOKCdceiBSvmjWsV4DvsQVygS3f48W3ro8Ss+On8PwN f8yA== 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 v3-v6si18057468pgr.44.2018.06.04.16.24.43; Mon, 04 Jun 2018 16:24:58 -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 S1752116AbeFDXYT (ORCPT + 99 others); Mon, 4 Jun 2018 19:24:19 -0400 Received: from mga05.intel.com ([192.55.52.43]:50318 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbeFDXYR (ORCPT ); Mon, 4 Jun 2018 19:24:17 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 16:24:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,477,1520924400"; d="scan'208";a="45261480" Received: from theros.lm.intel.com (HELO linux.intel.com) ([10.232.112.164]) by fmsmga008.fm.intel.com with ESMTP; 04 Jun 2018 16:24:17 -0700 Date: Mon, 4 Jun 2018 17:24:16 -0600 From: Ross Zwisler To: Mike Snitzer , Toshi Kani Cc: Ross Zwisler , dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-xfs@vger.kernel.orgw Subject: Re: [PATCH v2 5/7] dm: remove DM_TYPE_DAX_BIO_BASED dm_queue_mode Message-ID: <20180604232416.GB10666@linux.intel.com> Mail-Followup-To: Ross Zwisler , Mike Snitzer , Toshi Kani , dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-xfs@vger.kernel.orgw References: <20180529195106.14268-1-ross.zwisler@linux.intel.com> <20180529195106.14268-6-ross.zwisler@linux.intel.com> <20180601220443.GB18712@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601220443.GB18712@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 06:04:43PM -0400, Mike Snitzer wrote: > On Tue, May 29 2018 at 3:51pm -0400, > Ross Zwisler wrote: > > > The DM_TYPE_DAX_BIO_BASED dm_queue_mode was introduced to prevent DM > > devices that could possibly support DAX from transitioning into DM devices > > that cannot support DAX. > > > > For example, the following transition will currently fail: > > > > dm-linear: [fsdax pmem][fsdax pmem] => [fsdax pmem][fsdax raw] > > DM_TYPE_DAX_BIO_BASED DM_TYPE_BIO_BASED > > > > but these will both succeed: > > > > dm-linear: [fsdax pmem][brd ramdisk] => [fsdax pmem][fsdax raw] > > DM_TYPE_DAX_BIO_BASED DM_TYPE_BIO_BASED > > > > I fail to see how this succeeds given > drivers/md/dm-ioctl.c:is_valid_type() only allows transitions from: > > DM_TYPE_BIO_BASED => DM_TYPE_DAX_BIO_BASED Right, sorry, that was a typo. What I meant was: > For example, the following transition will currently fail: > > dm-linear: [fsdax pmem][fsdax pmem] => [fsdax pmem][fsdax raw] > DM_TYPE_DAX_BIO_BASED DM_TYPE_BIO_BASED > > but these will both succeed: > > dm-linear: [fsdax pmem][brd ramdisk] => [fsdax pmem][fsdax raw] > DM_TYPE_BIO_BASED DM_TYPE_BIO_BASED > > dm-linear: [fsdax pmem][fsdax raw] => [fsdax pmem][fsdax pmem] > DM_TYPE_BIO_BASED DM_TYPE_DAX_BIO_BASED So we allow 2 of the 3 transitions, but the reason that we disallow the third isn't fully clear to me. > > dm-linear: [fsdax pmem][fsdax raw] => [fsdax pmem][fsdax pmem] > > DM_TYPE_BIO_BASED DM_TYPE_DAX_BIO_BASED > > > > This seems arbitrary, as really the choice on whether to use DAX happens at > > filesystem mount time. There's no guarantee that the in the first case > > (double fsdax pmem) we were using the dax mount option with our file > > system. > > > > Instead, get rid of DM_TYPE_DAX_BIO_BASED and all the special casing around > > it, and instead make the request queue's QUEUE_FLAG_DAX be our one source > > of truth. If this is set, we can use DAX, and if not, not. We keep this > > up to date in table_load() as the table changes. As with regular block > > devices the filesystem will then know at mount time whether DAX is a > > supported mount option or not. > > If you don't think you need this specialization that is fine.. but DM > devices supporting suspending (as part of table reloads) so is there any > risk that there will be inflight IO (say if someone did 'dmsetup suspend > --noflush').. and then upon reload the device type changed out from > under us.. anyway, I don't have all the PMEM DAX stuff paged back into > my head yet. > > But this just seems like we really shouldn't be allowing the > transition from what was DM_TYPE_DAX_BIO_BASED back to DM_TYPE_BIO_BASED I admit I don't fully understand all the ways that DM supports suspending and resuming devices. Is there actually a case where we can change out the DM devices while I/O is running, and somehow end up trying to issue a DAX I/O to a device that doesn't support DAX? Toshi, do you have a test case that shows this somehow?