From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 6 22:23:28 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1336116A41F for ; Tue, 6 Dec 2005 22:23:28 +0000 (GMT) (envelope-from nate@root.org) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 856AC43D5F for ; Tue, 6 Dec 2005 22:23:27 +0000 (GMT) (envelope-from nate@root.org) Received: from [172.16.0.224] (fi01-84CBdd.tokyo.flets.isao.net [211.132.203.221]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id jB6MNSdu003007 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 6 Dec 2005 14:23:29 -0800 Message-ID: <43960F55.3010508@root.org> Date: Wed, 07 Dec 2005 07:23:17 +0900 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eric Anderson References: <4395BF04.50101@centtech.com> In-Reply-To: <4395BF04.50101@centtech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 06 Dec 2005 22:25:51 +0000 Cc: hackers@freebsd.org Subject: Re: scsi-target and the buffer cache X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2005 22:23:28 -0000 Eric Anderson wrote: > I'm curious about whether a target mode device would use the buffer > cache or not. Here's a scenario: > > Host A: has fibre channel host adapter, in target mode, large memory > pool, and another fiber channel host adapter connecting to fibre channel > block device. > Host B: Fibre channel host adapter, connecting to Host A. 'sees' the > target mode block device created by Host A. > > Will Host A use the buffer cache to cache blocks between the real block > device, and the shared target mode device? > What about if Host A put a filesystem on the block device, created a > single file the size of the filesystem, and shared that filesystem via a > target mode device to Host B? > What I'm wanting is a box (FreeBSD?) that can be placed between a fibre > channel block device (like a RAID array), and a fibre channel host using > that block device, and act as a block cache for that device, using the > FreeBSD's memory. If it had a significant amount of memory, this could > be very useful. If you use the example scsi_target usermode (usr/share/examples/scsi_target), then the buffer cache will be used since its reads/writes are from usermode like normal. If you don't want that behavior, you can set O_DIRECT in the open() call of the backing store file. If you chose to modify the kernel side, you'd have to make sure your accesses were through the VOP layer and then it would be cached. You should check to be sure the target mode performance meets your expectations also. -- Nate