Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 2003 21:34:39 +0100
From:      phk@freebsd.org
To:        Alfred Perlstein <bright@mu.org>
Cc:        Matt Dillon <dillon@freebsd.org>, cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/vm vm_swap.c 
Message-ID:  <5379.1043094879@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 20 Jan 2003 12:24:38 PST." <20030120202438.GB33821@elvis.mu.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20030120202438.GB33821@elvis.mu.org>, Alfred Perlstein writes:
>* phk@freebsd.org <phk@freebsd.org> [030120 12:06] wrote:
>> In message <200301202000.h0KK0WbW016017@repoman.freebsd.org>, Matt Dillon write
>> s:
>> >dillon      2003/01/20 12:00:32 PST
>> >
>> >  Modified files:
>> >    sys/vm               vm_swap.c 
>> >  Log:
>> >  Fix swapping to a file, it was broken when SPECSTRATEGY was introduced.
>> 
>> Please don't spread FUD.
>> 
>> This is clearly not the same word "broken" as I have learned in
>> school because the only sideeffect would be a single kernel printf
>> message on the console.
>> 
>> But thanks for catching this.
>
>I probably should be paying more attention... but can you point me
>at a commit log or email explaining why the upper layers now have
>to query inside the vp to determine which VOP to call?

This is a long story, and you already know most of it I pressume.

The short version is that "struct buf" today has implied backing
by a vnode (except when it has been hacked not to). 

VOP_STRATEGY() should really have been BUF_STRATEGY(), but since
struct buf has no operations vector, somebody hacked to take the
indirection from the vnode, making the vnode mandatory in the
process.

We have, in other words, at least four kinds of VOP_STRATEGY calls:
those which work on a vnode which is always a VREG.  Those which
only work on a vnode to get to a disk device (VCHR).  Those which
operate on a vnode as the abstraction of a vnode, and those which
fudge it to get hold of an NFS node.

I'm trying to sort that out, and the first step in sorting it out
is detecting which is which.  VOP_SPECSTRATEGY is the first bit
of this:  It sorts out the calls that happen on VCHR, either
exclusively or as a true vnode operation.

The plan such as it is at this time, is to give struct buf (or
the datastructure known today as struct buf) a proper operations
vector, that will allow it to be backed by various media: devices
(without the detour through a vnode), NFS nodes (which don't look
like disks at all) and vnodes.

This will also allow us to put a vm object backed by anonymous
storage behind it, and that will remove the worst stumbling block
to running UFS/FFS on swap, without the detour over md(4).

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5379.1043094879>