From owner-freebsd-hackers Wed Oct 2 07:58:29 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA13330 for hackers-outgoing; Wed, 2 Oct 1996 07:58:29 -0700 (PDT) Received: from critter.tfs.com ([140.145.230.252]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA13297; Wed, 2 Oct 1996 07:58:20 -0700 (PDT) Received: from critter.tfs.com (localhost.tfs.com [127.0.0.1]) by critter.tfs.com (8.7.5/8.7.3) with ESMTP id QAA03533; Wed, 2 Oct 1996 16:57:24 +0200 (MET DST) To: dyson@freebsd.org cc: heo@cslsun10.sogang.ac.kr (Heo Sung-Gwan), freebsd-hackers@freebsd.org, freebsd-fs@freebsd.org Subject: Re: vnode and cluster read-ahead In-reply-to: Your message of "Wed, 02 Oct 1996 09:39:42 CDT." <199610021439.JAA00980@dyson.iquest.net> Date: Wed, 02 Oct 1996 16:57:24 +0200 Message-ID: <3531.844268244@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199610021439.JAA00980@dyson.iquest.net>, John Dyson writes: >> As a process A reads a file F *sequentially* the fields(v_maxra, v_ralen, et >c) of the vnode of F increases. As a result read-ahead of next cluster happens >. >> But when a process B opens F and reads it the values of the fields are >> changed. So the process A's read-ahead is disturbed whenever process B is >> rescheduled. >> >> I think the fields for read-ahead must be in struct file rather than vnode. >> There exists one vnode for a file but a file may be open serveral times. >> >That is closer to correct. I am not sure that the struct file is correct >either, but I think that you are on the right track. No, I don't agree. Process B will most likely find all it needs in the buffercache, and thus will not need read-ahead at all. How to implement this is not clear to me, but I think the best way would be to calculate the parameters and only if the extend the current read-ahead (v_maxra...) will they be employed. This would gracefully handle the case where process B overtakes process A in reading the file. -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.