Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbaBQW5Z (ORCPT ); Mon, 17 Feb 2014 17:57:25 -0500 Received: from mail-ve0-f172.google.com ([209.85.128.172]:54479 "EHLO mail-ve0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbaBQW5Y (ORCPT ); Mon, 17 Feb 2014 17:57:24 -0500 MIME-Version: 1.0 In-Reply-To: <20140214074305.GF5160@quack.suse.cz> References: <52F88C16.70204@linux.vnet.ibm.com> <52F8C556.6090006@linux.vnet.ibm.com> <52FC6F2A.30905@linux.vnet.ibm.com> <52FC98A6.1000701@linux.vnet.ibm.com> <20140214001438.GB1651@linux.vnet.ibm.com> <20140214074305.GF5160@quack.suse.cz> Date: Mon, 17 Feb 2014 14:57:23 -0800 X-Google-Sender-Auth: MvKY-qQIFJJHsnDHuUkV2xvRYU8 Message-ID: Subject: Re: [RFC PATCH V5] mm readahead: Fix readahead fail for no local memory and limit readahead pages From: Linus Torvalds To: Jan Kara Cc: Nishanth Aravamudan , David Rientjes , Raghavendra K T , Andrew Morton , Fengguang Wu , David Cohen , Al Viro , Damien Ramonda , linux-mm , Linux Kernel Mailing List 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 Thu, Feb 13, 2014 at 11:43 PM, Jan Kara wrote: > > max_sane_readahead() is also used for limiting amount of readahead for > [fm]advice(2) WILLNEED and that is used e.g. by a dynamic linker to preload > shared libraries into memory. So I'm convinced this usecase *will* notice > the change - effectively we limit preloading of shared libraries to the > first 512KB in the file but libraries get accessed in a rather random manner. > > Maybe limits for WILLNEED and for standard readahead should be different. > It makes sence to me and people seem to keep forgetting that > max_sane_readahead() limits also WILLNEED preloading. Good point. But it's probably overly complex to have two different limits. The "512kB" thing was entirely random - the only real issue is that it should be small enough that it won't be a problem on any reasonable current machines, and big enough to get perfectly fine IO patterns unless your IO subsystem sucks so bad that it's not even worth worrying about. If we just add a third requirement that it be "big enough that reasonable uses of [fm]advice() will work well enough", then your shared library example might well be grounds for saying "let's just do 2MB instead". That's still small enough that it won't really hurt any modern machines. And if it means that WILLNEED won't necessarily always read the whole file for big files - well, we never guaranteed that to begin with. Linus -- 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/