From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: Unexpected splice "always copy" behavior observed Date: Thu, 20 May 2010 07:18:21 -0700 (PDT) Message-ID: References: <1274280968.26328.774.camel@gandalf.stny.rr.com> <1274283942.26328.783.camel@gandalf.stny.rr.com> <20100519155732.GB2039@Krystal> <20100519162729.GE2516@laptop> <20100519191439.GA2845@Krystal> <20100519214905.GA22486@Krystal> <20100520015605.GA28411@Krystal> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: <20100520015605.GA28411@Krystal> Sender: linux-man-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mathieu Desnoyers Cc: Nick Piggin , Steven Rostedt , Miklos Szeredi , peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, tardyp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, mingo-X9Un+BFzKDI@public.gmane.org, acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tzanussi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, arjan-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, ziga.mahkovec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org, cl-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, Michael Kerrisk , linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-man@vger.kernel.org On Wed, 19 May 2010, Mathieu Desnoyers wrote: > > Programs can use posix_fadvise() to announce an intention to access > file data in a specific pattern in the future, thus allowing the kernel > to perform appropriate optimizations. It's true for some of them. The random-vs-linear behavior is a flag for the future, for example (relevant for prefetching). In fact, it's technically true even for DONTNEED. It's true that we won't need the pages in the future! So we throw the pages away. But that means that we throw the _current_ pages away. If we actually touch pages later, than that obviously invalidates the fact that we said 'DONTNEED' - we clearly needed them. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754874Ab0ETOWP (ORCPT ); Thu, 20 May 2010 10:22:15 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:56278 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751934Ab0ETOWN (ORCPT ); Thu, 20 May 2010 10:22:13 -0400 Date: Thu, 20 May 2010 07:18:21 -0700 (PDT) From: Linus Torvalds To: Mathieu Desnoyers cc: Nick Piggin , Steven Rostedt , Miklos Szeredi , peterz@infradead.org, fweisbec@gmail.com, tardyp@gmail.com, mingo@elte.hu, acme@redhat.com, tzanussi@gmail.com, paulus@samba.org, linux-kernel@vger.kernel.org, arjan@infradead.org, ziga.mahkovec@gmail.com, davem@davemloft.net, linux-mm@kvack.org, akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com, cl@linux-foundation.org, tj@kernel.org, jens.axboe@oracle.com, Michael Kerrisk , linux-man@vger.kernel.org Subject: Re: Unexpected splice "always copy" behavior observed In-Reply-To: <20100520015605.GA28411@Krystal> Message-ID: References: <1274280968.26328.774.camel@gandalf.stny.rr.com> <1274283942.26328.783.camel@gandalf.stny.rr.com> <20100519155732.GB2039@Krystal> <20100519162729.GE2516@laptop> <20100519191439.GA2845@Krystal> <20100519214905.GA22486@Krystal> <20100520015605.GA28411@Krystal> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) 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 On Wed, 19 May 2010, Mathieu Desnoyers wrote: > > Programs can use posix_fadvise() to announce an intention to access > file data in a specific pattern in the future, thus allowing the kernel > to perform appropriate optimizations. It's true for some of them. The random-vs-linear behavior is a flag for the future, for example (relevant for prefetching). In fact, it's technically true even for DONTNEED. It's true that we won't need the pages in the future! So we throw the pages away. But that means that we throw the _current_ pages away. If we actually touch pages later, than that obviously invalidates the fact that we said 'DONTNEED' - we clearly needed them. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with ESMTP id 09C6660032A for ; Thu, 20 May 2010 10:22:12 -0400 (EDT) Date: Thu, 20 May 2010 07:18:21 -0700 (PDT) From: Linus Torvalds Subject: Re: Unexpected splice "always copy" behavior observed In-Reply-To: <20100520015605.GA28411@Krystal> Message-ID: References: <1274280968.26328.774.camel@gandalf.stny.rr.com> <1274283942.26328.783.camel@gandalf.stny.rr.com> <20100519155732.GB2039@Krystal> <20100519162729.GE2516@laptop> <20100519191439.GA2845@Krystal> <20100519214905.GA22486@Krystal> <20100520015605.GA28411@Krystal> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Mathieu Desnoyers Cc: Nick Piggin , Steven Rostedt , Miklos Szeredi , peterz@infradead.org, fweisbec@gmail.com, tardyp@gmail.com, mingo@elte.hu, acme@redhat.com, tzanussi@gmail.com, paulus@samba.org, linux-kernel@vger.kernel.org, arjan@infradead.org, ziga.mahkovec@gmail.com, davem@davemloft.net, linux-mm@kvack.org, akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com, cl@linux-foundation.org, tj@kernel.org, jens.axboe@oracle.com, Michael Kerrisk , linux-man@vger.kernel.org List-ID: On Wed, 19 May 2010, Mathieu Desnoyers wrote: > > Programs can use posix_fadvise() to announce an intention to access > file data in a specific pattern in the future, thus allowing the kernel > to perform appropriate optimizations. It's true for some of them. The random-vs-linear behavior is a flag for the future, for example (relevant for prefetching). In fact, it's technically true even for DONTNEED. It's true that we won't need the pages in the future! So we throw the pages away. But that means that we throw the _current_ pages away. If we actually touch pages later, than that obviously invalidates the fact that we said 'DONTNEED' - we clearly needed them. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org