From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753134AbbHOPob (ORCPT ); Sat, 15 Aug 2015 11:44:31 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:36353 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751578AbbHOPo2 (ORCPT ); Sat, 15 Aug 2015 11:44:28 -0400 MIME-Version: 1.0 In-Reply-To: <20150815091950.GA21487@lst.de> References: <1439484671-15718-1-git-send-email-ross.zwisler@linux.intel.com> <1439484671-15718-8-git-send-email-ross.zwisler@linux.intel.com> <20150815091950.GA21487@lst.de> Date: Sat, 15 Aug 2015 08:44:27 -0700 Message-ID: Subject: Re: [PATCH v2 7/7] pmem, dax: have direct_access use __pmem annotation From: Dan Williams To: Christoph Hellwig Cc: Ross Zwisler , "linux-kernel@vger.kernel.org" , "linux-nvdimm@lists.01.org" , Jonathan Corbet , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Jens Axboe , Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, Alexander Viro , Matthew Wilcox , Jeff Layton , Andrew Morton , Omar Sandoval , Boaz Harrosh , Miklos Szeredi , Jan Kara , Wolfram Sang , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Gerald Schaefer , Ameen Ali , "Martin K. Petersen" , Sagi Grimberg , Mike Snitzer , Tejun Heo , Shaohua Li , Ming Lei , linux-doc@vger.kernel.org, linuxppc-dev , linux-s390@vger.kernel.org, linux-fsdevel , Dave Chinner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 15, 2015 at 2:19 AM, Christoph Hellwig wrote: > On Thu, Aug 13, 2015 at 10:51:11AM -0600, Ross Zwisler wrote: >> Update the annotation for the kaddr pointer returned by direct_access() >> so that it is a __pmem pointer. This is consistent with the PMEM driver >> and with how this direct_access() pointer is used in the DAX code. > > IFF we stick to the __pmem annotations this looks good. > > That beeing said I start to really dislike them. We don't special > accesors to read/write from pmem, we just need to explicitly commit > it if we want to make it persistent. So I really don't see the need > to treat it special and require all the force casts to and from the > attribute. I'm not going to put up much of a fight if it's really getting in the way.... That said, while we don't need special accessors we do need guarantees that anything that has written to a persistent memory address has done so in a way that wmb_pmem() is able to flush it. It's more of a "I've audited this code path for wmb_pmem() compatibility so use this api to write to pmem." Perhaps a better way to statically check for missed flushes might be to have acquire_pmem_for_write() + release() annotations and the final release does a wmb_pmem(), but as far as I can tell the sparse acquire/release annotations don't stack.