From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753263AbbHTVPq (ORCPT ); Thu, 20 Aug 2015 17:15:46 -0400 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,716,1432623600"; d="scan'208";a="629304979" Message-ID: <1440105339.30197.11.camel@linux.intel.com> Subject: Re: [PATCH v2] nd_blk: add support for "read flush" DSM flag From: Ross Zwisler 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 Date: Thu, 20 Aug 2015 15:15:39 -0600 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 (3.12.11-1.fc21) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.