Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbdHNC3O (ORCPT ); Sun, 13 Aug 2017 22:29:14 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:37797 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbdHNC3M (ORCPT ); Sun, 13 Aug 2017 22:29:12 -0400 Date: Sun, 13 Aug 2017 22:29:09 -0400 (EDT) From: Nicolas Pitre To: Christoph Hellwig cc: Alexander Viro , linux-fsdevel@vger.kernel.org, linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Brandt Subject: Re: [PATCH 1/5] cramfs: direct memory access support In-Reply-To: <20170812074927.GA8703@infradead.org> Message-ID: References: <20170811192252.19062-1-nicolas.pitre@linaro.org> <20170811192252.19062-2-nicolas.pitre@linaro.org> <20170812074927.GA8703@infradead.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1422 Lines: 33 On Sat, 12 Aug 2017, Christoph Hellwig wrote: > Direct physical memory access in a file system is never safe. > Please make sure this goes through struct dax_operations. Well, after having a closer look, I don't think dax might be relevant here for a couple reasons: - cramfs is read-only. No concurrent writes to worry about. Please elaborate if you have other safety concerns in mind. - This series targets small no-MMU systems. There is no paging involved given the lack of a MMU. The whole of the filesystem is always directly accessible in the address space from ROM alongside with the actual kernel code being executed. I don't see how dax would ever be pertinent here. - Even with MMU systems, the maximum size of a cramfs image can't exceed 272MB. In practice it is likely to be much much less. Given this targets small memory systems, there is always plenty of vmalloc space left to map it all and even a 272MB memremap() wouldn't be a problem. If it is a problem then maybe your system has large resources to manage already and you're pretty unlikely to be using cramfs in the first place, otherwise accessing it through a block device would be just fine, at which point you'd better consider squashfs instead of this. All this to say that I think that dax is _way_ overkill and inappropriate for the intended cramfs use case this series is addressing. Nicolas