From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Zwisler Subject: Re: [PATCH v2] nd_blk: add support for "read flush" DSM flag Date: Thu, 20 Aug 2015 15:15:39 -0600 Message-ID: <1440105339.30197.11.camel@linux.intel.com> References: <1440024484-26152-1-git-send-email-ross.zwisler@linux.intel.com> <1440089067.30197.3.camel@linux.intel.com> <1440094654.30197.8.camel@linux.intel.com> <1440097210.30197.9.camel@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mga14.intel.com ([192.55.52.115]:13996 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752137AbbHTVPm (ORCPT ); Thu, 20 Aug 2015 17:15:42 -0400 In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Dan Williams Cc: "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , "Luis R. Rodriguez" , "Rafael J. Wysocki" , Andrew Morton , Borislav Petkov , Christoph Hellwig , Christoph Jaeger , Dan Streetman , Ingo Molnar , Juergen Gross , Len Brown , Rusty Russell , Stephen Rothwell , Thierry Reding , Thomas Gleixner , Toshi Kani , Vishal Verma , Will Deacon , Linux ACPI , "linux-nvdimm@lists.01.org" , X86 ML On Thu, 2015-08-20 at 13:27 -0700, Dan Williams wrote: [...] > With regards to the fencing, since we already take care to flush > writes we don't need to fence at all for the flush, right? All we > care about is that reads see valid data. We were careful to flush writes, but we could still have (now stale) data in the cache either due to a previous read or because of prefetching. So we need to flush, and we need to fence to make sure that our flushing stays correctly ordered with respect to our reads. So, to recap, I think are options are: a) loop through aperture segments, flushing each without any fencing mb() to order all the flushes loop through aperture segments, doing the reads b) loop through aperture segments flushing segment with mb() fencing read the new data for this segment from the DIMM Option b) is what is already implemented and is cleaner, but option a) has the benefit of having many fewer fences.