Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S975449AbdDXRHX (ORCPT ); Mon, 24 Apr 2017 13:07:23 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:33970 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S975393AbdDXRHN (ORCPT ); Mon, 24 Apr 2017 13:07:13 -0400 MIME-Version: 1.0 In-Reply-To: <58FE2FCA.5050702@hpe.com> References: <149281853758.22910.2919981036906495309.stgit@dwillia2-desk3.amr.corp.intel.com> <58FE2FCA.5050702@hpe.com> From: Dan Williams Date: Mon, 24 Apr 2017 10:07:12 -0700 Message-ID: Subject: Re: [PATCH] libnvdimm, region: sysfs trigger for nvdimm_flush() To: Linda Knippers Cc: "linux-nvdimm@lists.01.org" , Linux ACPI , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1596 Lines: 31 On Mon, Apr 24, 2017 at 10:03 AM, Linda Knippers wrote: > On 04/21/2017 07:48 PM, Dan Williams wrote: >> The nvdimm_flush() mechanism helps to reduce the impact of an ADR >> (asynchronous-dimm-refresh) failure. The ADR mechanism handles flushing >> platform WPQ (write-pending-queue) buffers when power is removed. The >> nvdimm_flush() mechanism performs that same function on-demand. >> >> When a pmem namespace is associated with a block device, an >> nvdimm_flush() is triggered with every block-layer REQ_FUA, or REQ_FLUSH >> request. However, when a namespace is in device-dax mode, or namespaces >> are disabled, userspace needs another path. > > Why would a user need to flush a disabled namespace? For an application that wants to shutdown and sync. Basically I wanted to make it clear that with this interface the buffers can be synced regardless of any downstream namespace configuration or state. > >> The new 'flush' attribute is visible when it can be determined that the >> interleave-set either does, or does not have DIMMs that expose WPQ-flush >> addresses, "flush-hints" in ACPI NFIT terminology. It returns "1" and >> flushes DIMMs, or returns "0" the flush operation is a platform nop. > > It seems a little odd to me that reading a read-only attribute both > tells you that the device has flush hints and also triggers a flush. > This means that anyone at any time can cause a flush. Do we want that? No, I'm making the change that Masayoshi-san suggested to move the flush to a write operation... assuming we move forward given Jeff's concern.