Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754758Ab0KSPG7 (ORCPT ); Fri, 19 Nov 2010 10:06:59 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:52241 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754481Ab0KSPG6 (ORCPT ); Fri, 19 Nov 2010 10:06:58 -0500 Date: Fri, 19 Nov 2010 10:06:41 -0500 From: Christoph Hellwig To: Theodore Tso Cc: Michel Lespinasse , Hugh Dickins , Christoph Hellwig , Dave Chinner , Peter Zijlstra , Nick Piggin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Rik van Riel , Kosaki Motohiro , Michael Rubin , Suleiman Souhlal Subject: Re: [PATCH 3/3] mlock: avoid dirtying pages and triggering writeback Message-ID: <20101119150641.GA5302@infradead.org> References: <1289996638-21439-1-git-send-email-walken@google.com> <1289996638-21439-4-git-send-email-walken@google.com> <20101117125756.GA5576@amd> <1290007734.2109.941.camel@laptop> <20101117231143.GQ22876@dastard> <20101118133702.GA18834@infradead.org> <20101119072316.GA14388@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1195 Lines: 25 On Fri, Nov 19, 2010 at 08:42:05AM -0500, Theodore Tso wrote: > My vote would be against. ? If you if you mmap a sparse file and then > try writing to it willy-nilly, bad things will happen. ?This is true without > a mlock(). ? Where is it written that mlock() has anything to do with > improving this situation? Exactly. Allocating space has been a side-effect on a handfull filesystem for about 20 kernel releases. > If userspace wants to call fallocate() before it calls mlock(), it should > do that. ?And in fact, in most cases, userspace should probably be > encouraged to do that. ? But having mlock() call fallocate() and > then return ENOSPC if there's no room? Isn't it confusing that mlock() > call ENOSPC? Doesn't that give you cognitive dissonance? It should > because fundamentally mlock() has nothing to do with block allocation!! > Read the API spec! Indeed. There is no need to make mlock + flag a parallel-API to fallocate. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/