Coder Social home page Coder Social logo

davidbutterfield / scst-usermode-adaptation Goto Github PK

View Code? Open in Web Editor NEW
24.0 11.0 10.0 50.15 MB

Adaptation of iSCSI-SCST and DRBD software to run entirely in usermode

Makefile 1.08% C 92.80% Roff 0.30% C++ 0.28% Shell 0.98% Perl 2.97% HTML 1.26% Awk 0.21% CSS 0.05% JavaScript 0.01% Objective-C 0.04%
scst storage server iscsi scsi linux c usermode performance kernel

scst-usermode-adaptation's Introduction

SCST-Usermode-Adaptation

SCST iSCSI Storage Server Usermode Adaptation
An adaptation of the iSCSI-SCST storage server software to run entirely in usermode on an unmodified Linux kernel
David A. Butterfield

This project adapts the SCST iSCSI storage server software, which normally resides in the Linux kernel, to run entirely in usermode on an unmodified kernel. The resulting executable can run as a regular (non-super) user, as long as it has permission to access the backing storage. A paper describing the work and performance study is here.

The left side of the diagram below shows the original "in-kernel" configuration alongside the adapted "usermode" configuration.

Additional work done since that report implements an "scst_tcmur" interface module allowing SCST_Usermode to access backing storage using the same interface used by the LIO tcmu-runner facility. Through this backstore handler interface, SCST_Usermode can utilize backing storage implemented by any of Ceph/RBD, QEMU/qcow, Gluster/glfs, or Intel/SPDK.

The right side of the diagram below shows the Linux kernel-resident LIO implementation alongside the SCST_Usermode implemention, both sharing a common set of tcmu-runner backstore handlers.


SCST Usermode Adaptation and tcmu-runner backend driver


Branches:

  • scst_base - unmodified source from SCST repository that the two branches below are based on
  • SCST_fixes - generic changes to SCST source (for both usermode and kernel-resident builds) [included in usermode]
  • usermode - SCST Usermode supports tcmu-runner backstore handlers as well as local files and block devices

Old Branch:

  • master - the original work described by the paper, supporting local files and block devices for backstore

The adaptation uses about 80,000 lines of the SCST source code, a subset supporting the iSCSI transport type (via socket calls), and SCSI Block Commands (vdisk_fileio) backed by either a file or a block device.

The SCST iSCSI Usermode Adaptation depends on

  • Usermode Compatibility (UMC) โ€” a shim for running some Linux kernel code in usermode
  • Multithreaded Engine (MTE) โ€” a high-performance multi-threaded event dispatching engine for usermode
  • SCST files in the master branch of this repo began as a snapshot of https://sourceforge.net/projects/scst /scst and /iscsi-scst svn -r7105.
  • To support usermode, about 300 lines of changes were made to the SCST snapshot files (mostly under #ifdef)
  • Additional changes: AIO, optimizations for usermode (under #ifdef), and some fixes and XXX comments for SCST
  • A little more work would be required to run on architectures other than x86
  • Possibly less work would be needed to run on non-Linux POSIX systems having gcc and the libraries
  • It shouldn't matter much, but I have only tested with these:
    • Linux 3.13.0-101-generic #148-Ubuntu SMP x86_64
    • Linux 4.4.0-70-generic #91-Ubuntu SMP x86_64 GNU/Linux
    • Linux 4.8.0-46-generic #49-Ubuntu SMP x86_64 GNU/Linux

Hints to help get started running iSCSI-SCST in usermode
(This is rather terse; some existing familiarity with SCST will be helpful)

  # apt install libaio-dev              # required
  # apt install libfuse-dev             # required
  # apt install subversion              # or github accessor of your choice
  # apt install cscope                  # (optional with makefile edit)
  # apt install exuberant-ctags         # (optional with makefile edit)
  # apt install valgrind                # (optional)

  $ mkdir Usermode_SCST ; cd Usermode_SCST   # or use whatever name you want for this one
  $ svn co https://github.com/DavidButterfield/MTE.git MTE   # Makefile expects these names
  $ svn co https://github.com/DavidButterfield/usermode_compat.git UMC
  $ svn co https://github.com/DavidButterfield/SCST-Usermode-Adaptation.git SCST

  $ more SCST/trunk/usermode/BUGS.txt   # ** MORE HINTS **

  $ pushd MTE/trunk/src                 # build the Multithreaded Engine library
  $ make
  $ sudo make install                   # needs permission for /lib, /usr/include
  $ popd

  $ cd SCST/trunk
  $ sudo make scstadm_install           # patched to know where /fuse/scst/proc is
  $ make enable_proc                    # configure so it can compile for usermode

  $ cd usermode
  $ make                                # build the SCST iSCSI server binary
  $ ls -l scst.out                      # in SCST/trunk/usermode/

  ### Manually create /etc/{iscsi-scst,scst_usermode}.conf in SCST /proc format (See *.sample)

  # mkdir -p  /var/lib/scst/vdev_mode_pages /var/lib/scst/pr
  # chmod 777 /var/lib/scst/vdev_mode_pages /var/lib/scst/pr   # or writable by SCST's UID

  # mkdir -p /fuse/scst/proc ; chmod 777 /fuse/scst/proc       # mount point for SCST's /proc
  ### Edit /etc/fuse.conf and uncomment the line with "user_allow_other"

  $ [ gdb | valgrind ] ./scst.out -f    # run as normal user, with or without accessories

In another terminal window

  # scstadmin -config /etc/scst_usermode.conf
  # ls -l `find /fuse -type f`

Diagrams showing the relationship between UMC, MTE, and Usermode SCST


SCST usermode service map


SCST usermode header and library inclusions


Diagram showing the datapath of SCST configured with iSCSI and vdisk_fileio (either usermode or kernel-resident)


SCST datapath


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.