Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262270AbVAZK7e (ORCPT ); Wed, 26 Jan 2005 05:59:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262274AbVAZK7d (ORCPT ); Wed, 26 Jan 2005 05:59:33 -0500 Received: from mail.tv-sign.ru ([213.234.233.51]:52709 "EHLO several.ru") by vger.kernel.org with ESMTP id S262270AbVAZK7O (ORCPT ); Wed, 26 Jan 2005 05:59:14 -0500 Message-ID: <41F786EF.9FE19AEC@tv-sign.ru> Date: Wed, 26 Jan 2005 15:02:55 +0300 From: Oleg Nesterov X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Ram Cc: linux-kernel@vger.kernel.org, Steven Pratt , Andrew Morton Subject: Re: [PATCH 2/4] page_cache_readahead: remove duplicated code References: <41F63493.309B0ADB@tv-sign.ru> <1106698119.3298.57.camel@localhost> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1077 Lines: 29 Ram wrote: > > No. There is a reason why we had some duplication. With your patch, > we will end up reading-on-demand instead of reading ahead. > > When we notice a sequential reads have resumed, we first read in the > data that is requested. > However if the read request is for more pages than what are being held > in the current window, we make the ahead window as the current window > and read in more pages in the ahead window. Doing that gives the > opportunity of always having pages in the ahead window when the next > sequential read request comes in. Yes, sorry. I have not noticed that this 'goto out' is conditional in the 'no ahead window' case. Thank you for explanation. However, I still think it makes sense to factor out the common code in these two cases, just for readability. I'll redo these patches. Oleg. - 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/