public inbox for hail-devel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Project Hail <hail-devel@vger.kernel.org>
Subject: iSCSI back-end design
Date: Sat, 08 May 2010 18:16:21 -0400	[thread overview]
Message-ID: <4BE5E2B5.2020604@garzik.org> (raw)
In-Reply-To: <4BDCAB1A.6070109@garzik.org>


The iSCSI target daemon now serves data persistently stored in an mmap'd 
file, as an alternative to RAM storage that exists for the lifetime of 
the daemon.

It has been verified to work with Linux and Microsoft iSCSI initiators 
(== iSCSI clients), appearing as a regular SCSI disk on your system.  It 
answers all the standard SCSI commands, issued by the kernel's SCSI 
subsystem, or userspace SCSI utilities like sg3_utils.

Usage is quite trivial:

	$ dd if=/dev/zero of=/tmp/target0.data bs=1M count=2000
	$ ./itd -f /tmp/target0.data

Then direct your iSCSI initiator (via iscsiadm on Linux) to the portal 
(== IPv4 or IPv6 address) where itd is listening.

Now, on to thinking about a Hail back-end for itd:

One of the recent additions to SCSI (http://www.t10.org/) is "thin 
provisioning", which enables easy management of SCSI devices such as 
flash storage or large arrays, where LBAs (hardware sectors) exist in 
one of two states:

	- mapped: present and have valid user data
	- unmapped: does not contain valid user data

Previously, all LBAs on all SCSI disks were assumed to be mapped.

The ability to unmap sectors, and know which sectors are unmapped, have 
clear advantages to flash-based storage hardware, which may use this 
information to erase or re-use unmapped flash cels.

Similarly, large SCSI arrays -- or Project Hail software -- may make use 
of unmapped sectors by avoiding allocation of storage.  As it applies to 
itd, I was thinking that our SCSI device may be implemented internally 
as an array of 256kB pages, some of which are filled with data, and some 
of which are not:

[0] NULL
[1] NULL
[2] chunkd object 1
[3] chunkd object 12398
[4] NULL
[5] chunkd object 22
[6] ...

The array itself is replicated across multiple chunkd nodes.  The 
superblock, containing information on where to find the array, is stored 
in CLD, updated once every 30-60 seconds, or upon a SYNCHRONIZE CACHE 
command.

The downside to large hardware sectors, of sizes such as 256k, is that 
itd would need to perform a read-modify-write cycle for <256k writes. 
This is mitigated by a large cache, but is nonetheless a factor.  We 
could easily choose a page size of 4k or even 512 bytes, but that, in 
turn, increases the array management overhead.

New SCSI commands related to thin provisioning are already implemented 
in Linux, and are documented here: 
http://www.t10.org/cgi-bin/ac.pl?t=f&f=sbc3r22.pdf

	Jeff




      parent reply	other threads:[~2010-05-08 22:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-01 22:28 iSCSI front-end for Hail Jeff Garzik
2010-05-02  2:56 ` Pete Zaitcev
2010-05-02  6:32   ` Jeff Garzik
2010-05-06  3:02 ` Jeff Garzik
2010-05-07  3:15 ` Jeff Garzik
2010-05-08 22:16 ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BE5E2B5.2020604@garzik.org \
    --to=jeff@garzik.org \
    --cc=hail-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox