Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbdFNKqa (ORCPT ); Wed, 14 Jun 2017 06:46:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:53123 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751727AbdFNKq3 (ORCPT ); Wed, 14 Jun 2017 06:46:29 -0400 Date: Wed, 14 Jun 2017 12:46:26 +0200 From: Jan Kara To: Dan Williams Cc: linux-nvdimm@lists.01.org, Jan Kara , dm-devel@redhat.com, Matthew Wilcox , x86@kernel.org, linux-kernel@vger.kernel.org, Jeff Moyer , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Ross Zwisler , hch@lst.de Subject: Re: [PATCH v3 13/14] filesystem-dax: gate calls to dax_flush() on QUEUE_FLAG_WC Message-ID: <20170614104626.GA21506@quack2.suse.cz> References: <149703982465.20620.14881139332926778446.stgit@dwillia2-desk3.amr.corp.intel.com> <149703989611.20620.6907872165215640212.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <149703989611.20620.6907872165215640212.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1108 Lines: 31 On Fri 09-06-17 13:24:56, Dan Williams wrote: > Some platforms arrange for cpu caches to be flushed on power-fail. On > those platforms there is no requirement that the kernel track and flush > potentially dirty cache lines. Given that we still insert entries into > the radix for locking purposes this patch only disables the cache flush > loop, not the dirty tracking. > > Userspace can override the default cache setting via the block device > queue "write_cache" attribute in sysfs. > > Cc: Jan Kara > Cc: Jeff Moyer > Cc: Christoph Hellwig > Cc: Matthew Wilcox > Cc: Ross Zwisler > Signed-off-by: Dan Williams ... > - dax_flush(dax_dev, pgoff, kaddr, size); > + if (test_bit(QUEUE_FLAG_WC, &bdev->bd_queue->queue_flags)) > + dax_flush(dax_dev, pgoff, kaddr, size); IMHO the check belongs into dax_flush() similarly as blkdev_issue_flush() takes silently handles whether the flush is actually needed or not. Honza -- Jan Kara SUSE Labs, CR