From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 2/8] readahead: make default readahead size a kernel parameter Date: Mon, 21 Nov 2011 19:35:40 +0800 Message-ID: <20111121113540.GB8895@localhost> References: <20111121091819.394895091@intel.com> <20111121093846.251104145@intel.com> <20111121100137.GC5084@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Linux Memory Management List , "linux-fsdevel@vger.kernel.org" , Ankit Jain , Dave Chinner , Christian Ehrhardt , Rik van Riel , Nikanth Karthikesan , LKML , Andi Kleen To: Christoph Hellwig Return-path: Content-Disposition: inline In-Reply-To: <20111121100137.GC5084@infradead.org> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Nov 21, 2011 at 06:01:37PM +0800, Christoph Hellwig wrote: > On Mon, Nov 21, 2011 at 05:18:21PM +0800, Wu Fengguang wrote: > > From: Nikanth Karthikesan > > > > Add new kernel parameter "readahead=", which allows user to override > > the static VM_MAX_READAHEAD=128kb. > > Is a boot-time paramter really such a good idea? I would at least It's most convenient to set at boot time, because the default size will be used to initialize all the block devices. > make it a sysctl so that it's run-time controllable, including > beeing able to set it from initscripts. Once boot up, it's more natural to set the size one by one, for example blockdev --setra 1024 /dev/sda2 or echo 512 > /sys/block/sda/queue/read_ahead_kb And you still have the chance to modify the global default, but the change will only be inherited by newly created devices thereafter: echo 512 > /sys/devices/virtual/bdi/default/read_ahead_kb The above command is very suitable for use in initscripts. However there are no natural way to do sysctl as there is no such a global value. Thanks, Fengguang -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756078Ab1KULfs (ORCPT ); Mon, 21 Nov 2011 06:35:48 -0500 Received: from mga14.intel.com ([143.182.124.37]:55165 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755478Ab1KULfq (ORCPT ); Mon, 21 Nov 2011 06:35:46 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.69,546,1315206000"; d="scan'208";a="77510414" Date: Mon, 21 Nov 2011 19:35:40 +0800 From: Wu Fengguang To: Christoph Hellwig Cc: Andrew Morton , Linux Memory Management List , "linux-fsdevel@vger.kernel.org" , Ankit Jain , Dave Chinner , Christian Ehrhardt , Rik van Riel , Nikanth Karthikesan , LKML , Andi Kleen Subject: Re: [PATCH 2/8] readahead: make default readahead size a kernel parameter Message-ID: <20111121113540.GB8895@localhost> References: <20111121091819.394895091@intel.com> <20111121093846.251104145@intel.com> <20111121100137.GC5084@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111121100137.GC5084@infradead.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 21, 2011 at 06:01:37PM +0800, Christoph Hellwig wrote: > On Mon, Nov 21, 2011 at 05:18:21PM +0800, Wu Fengguang wrote: > > From: Nikanth Karthikesan > > > > Add new kernel parameter "readahead=", which allows user to override > > the static VM_MAX_READAHEAD=128kb. > > Is a boot-time paramter really such a good idea? I would at least It's most convenient to set at boot time, because the default size will be used to initialize all the block devices. > make it a sysctl so that it's run-time controllable, including > beeing able to set it from initscripts. Once boot up, it's more natural to set the size one by one, for example blockdev --setra 1024 /dev/sda2 or echo 512 > /sys/block/sda/queue/read_ahead_kb And you still have the chance to modify the global default, but the change will only be inherited by newly created devices thereafter: echo 512 > /sys/devices/virtual/bdi/default/read_ahead_kb The above command is very suitable for use in initscripts. However there are no natural way to do sysctl as there is no such a global value. Thanks, Fengguang