1. 03 Apr, 2009 12 commits
    • David Howells's avatar
      FS-Cache: Add main configuration option, module entry points and debugging · 06b3db1b
      David Howells authored
      
      Add the main configuration option, allowing FS-Cache to be selected; the
      module entry and exit functions and the debugging stuff used by these patches.
      
      The two configuration options added are:
      
      	CONFIG_FSCACHE
      	CONFIG_FSCACHE_DEBUG
      
      The first enables the facility, and the second makes the debugging statements
      enableable through the "debug" module parameter.  The value of this parameter
      is a bitmask as described in:
      
      	Documentation/filesystems/caching/fscache.txt
      
      The module can be loaded at this point, but all it will do at this point in
      the patch series is to start up the slow work facility and shut it down again.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      06b3db1b
    • David Howells's avatar
      FS-Cache: Add the FS-Cache cache backend API and documentation · 0dfc41d1
      David Howells authored
      
      Add the API for a generic facility (FS-Cache) by which caches may declare them
      selves open for business, and may obtain work to be done from network
      filesystems.  The header file is included by:
      
      	#include <linux/fscache-cache.h>
      
      Documentation for the API is also added to:
      
      	Documentation/filesystems/caching/backend-api.txt
      
      This API is not usable without the implementation of the utility functions
      which will be added in further patches.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      0dfc41d1
    • David Howells's avatar
      FS-Cache: Add the FS-Cache netfs API and documentation · 2d6fff63
      David Howells authored
      
      Add the API for a generic facility (FS-Cache) by which filesystems (such as AFS
      or NFS) may call on local caching capabilities without having to know anything
      about how the cache works, or even if there is a cache:
      
      	+---------+
      	|         |                        +--------------+
      	|   NFS   |--+                     |              |
      	|         |  |                 +-->|   CacheFS    |
      	+---------+  |   +----------+  |   |  /dev/hda5   |
      	             |   |          |  |   +--------------+
      	+---------+  +-->|          |  |
      	|         |      |          |--+
      	|   AFS   |----->| FS-Cache |
      	|         |      |          |--+
      	+---------+  +-->|          |  |
      	             |   |          |  |   +--------------+
      	+---------+  |   +----------+  |   |              |
      	|         |  |                 +-->|  CacheFiles  |
      	|  ISOFS  |--+                     |  /var/cache  |
      	|         |                        +--------------+
      	+---------+
      
      General documentation and documentation of the netfs specific API are provided
      in addition to the header files.
      
      As this patch stands, it is possible to build a filesystem against the facility
      and attempt to use it.  All that will happen is that all requests will be
      immediately denied as if no cache is present.
      
      Further patches will implement the core of the facility.  The facility will
      transfer requests from networking filesystems to appropriate caches if
      possible, or else gracefully deny them.
      
      If this facility is disabled in the kernel configuration, then all its
      operations will trivially reduce to nothing during compilation.
      
      WHY NOT I_MAPPING?
      ==================
      
      I have added my own API to implement caching rather than using i_mapping to do
      this for a number of reasons.  These have been discussed a lot on the LKML and
      CacheFS mailing lists, but to summarise the basics:
      
       (1) Most filesystems don't do hole reportage.  Holes in files are treated as
           blocks of zeros and can't be distinguished otherwise, making it difficult
           to distinguish blocks that have been read from the network and cached from
           those that haven't.
      
       (2) The backing inode must be fully populated before being exposed to
           userspace through the main inode because the VM/VFS goes directly to the
           backing inode and does not interrogate the front inode's VM ops.
      
           Therefore:
      
           (a) The backing inode must fit entirely within the cache.
      
           (b) All backed files currently open must fit entirely within the cache at
           	 the same time.
      
           (c) A working set of files in total larger than the cache may not be
           	 cached.
      
           (d) A file may not grow larger than the available space in the cache.
      
           (e) A file that's open and cached, and remotely grows larger than the
           	 cache is potentially stuffed.
      
       (3) Writes go to the backing filesystem, and can only be transferred to the
           network when the file is closed.
      
       (4) There's no record of what changes have been made, so the whole file must
           be written back.
      
       (5) The pages belong to the backing filesystem, and all metadata associated
           with that page are relevant only to the backing filesystem, and not
           anything stacked atop it.
      
      OVERVIEW
      ========
      
      FS-Cache provides (or will provide) the following facilities:
      
       (1) Caches can be added / removed at any time, even whilst in use.
      
       (2) Adds a facility by which tags can be used to refer to caches, even if
           they're not available yet.
      
       (3) More than one cache can be used at once.  Caches can be selected
           explicitly by use of tags.
      
       (4) The netfs is provided with an interface that allows either party to
           withdraw caching facilities from a file (required for (1)).
      
       (5) A netfs may annotate cache objects that belongs to it.  This permits the
           storage of coherency maintenance data.
      
       (6) Cache objects will be pinnable and space reservations will be possible.
      
       (7) The interface to the netfs returns as few errors as possible, preferring
           rather to let the netfs remain oblivious.
      
       (8) Cookies are used to represent indices, files and other objects to the
           netfs.  The simplest cookie is just a NULL pointer - indicating nothing
           cached there.
      
       (9) The netfs is allowed to propose - dynamically - any index hierarchy it
           desires, though it must be aware that the index search function is
           recursive, stack space is limited, and indices can only be children of
           indices.
      
      (10) Indices can be used to group files together to reduce key size and to make
           group invalidation easier.  The use of indices may make lookup quicker,
           but that's cache dependent.
      
      (11) Data I/O is effectively done directly to and from the netfs's pages.  The
           netfs indicates that page A is at index B of the data-file represented by
           cookie C, and that it should be read or written.  The cache backend may or
           may not start I/O on that page, but if it does, a netfs callback will be
           invoked to indicate completion.  The I/O may be either synchronous or
           asynchronous.
      
      (12) Cookies can be "retired" upon release.  At this point FS-Cache will mark
           them as obsolete and the index hierarchy rooted at that point will get
           recycled.
      
      (13) The netfs provides a "match" function for index searches.  In addition to
           saying whether a match was made or not, this can also specify that an
           entry should be updated or deleted.
      
      FS-Cache maintains a virtual index tree in which all indices, files, objects
      and pages are kept.  Bits of this tree may actually reside in one or more
      caches.
      
                                                 FSDEF
                                                   |
                              +------------------------------------+
                              |                                    |
                             NFS                                  AFS
                              |                                    |
                 +--------------------------+                +-----------+
                 |                          |                |           |
              homedir                     mirror          afs.org   redhat.com
                 |                          |                            |
           +------------+           +---------------+              +----------+
           |            |           |               |              |          |
         00001        00002       00007           00125        vol00001   vol00002
           |            |           |               |                         |
       +---+---+     +-----+      +---+      +------+------+            +-----+----+
       |   |   |     |     |      |   |      |      |      |            |     |    |
      PG0 PG1 PG2   PG0  XATTR   PG0 PG1   DIRENT DIRENT DIRENT        R/W   R/O  Bak
                           |                                            |
                          PG0                                       +-------+
                                                                    |       |
                                                                  00001   00003
                                                                    |
                                                                +---+---+
                                                                |   |   |
                                                               PG0 PG1 PG2
      
      In the example above, two netfs's can be seen to be backed: NFS and AFS.  These
      have different index hierarchies:
      
       (*) The NFS primary index will probably contain per-server indices.  Each
           server index is indexed by NFS file handles to get data file objects.
           Each data file objects can have an array of pages, but may also have
           further child objects, such as extended attributes and directory entries.
           Extended attribute objects themselves have page-array contents.
      
       (*) The AFS primary index contains per-cell indices.  Each cell index contains
           per-logical-volume indices.  Each of volume index contains up to three
           indices for the read-write, read-only and backup mirrors of those volumes.
           Each of these contains vnode data file objects, each of which contains an
           array of pages.
      
      The very top index is the FS-Cache master index in which individual netfs's
      have entries.
      
      Any index object may reside in more than one cache, provided it only has index
      children.  Any index with non-index object children will be assumed to only
      reside in one cache.
      
      The FS-Cache overview can be found in:
      
      	Documentation/filesystems/caching/fscache.txt
      
      The netfs API to FS-Cache can be found in:
      
      	Documentation/filesystems/caching/netfs-api.txt
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      2d6fff63
    • David Howells's avatar
      FS-Cache: Recruit a page flags for cache management · 266cf658
      David Howells authored
      
      Recruit a page flag to aid in cache management.  The following extra flag is
      defined:
      
       (1) PG_fscache (PG_private_2)
      
           The marked page is backed by a local cache and is pinning resources in the
           cache driver.
      
      If PG_fscache is set, then things that checked for PG_private will now also
      check for that.  This includes things like truncation and page invalidation.
      The function page_has_private() had been added to make the checks for both
      PG_private and PG_private_2 at the same time.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      266cf658
    • David Howells's avatar
      FS-Cache: Release page->private after failed readahead · 03fb3d2a
      David Howells authored
      
      The attached patch causes read_cache_pages() to release page-private data on a
      page for which add_to_page_cache() fails.  If the filler function fails, then
      the problematic page is left attached to the pagecache (with appropriate flags
      set, one presumes) and the remaining to-be-attached pages are invalidated and
      discarded.  This permits pages with caching references associated with them to
      be cleaned up.
      
      The invalidatepage() address space op is called (indirectly) to do the honours.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      03fb3d2a
    • David Howells's avatar
      Document the slow work thread pool · 8f0aa2f2
      David Howells authored
      
      Document the slow work thread pool.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      8f0aa2f2
    • David Howells's avatar
      Make the slow work pool configurable · 12e22c5e
      David Howells authored
      
      Make the slow work pool configurable through /proc/sys/kernel/slow-work.
      
       (*) /proc/sys/kernel/slow-work/min-threads
      
           The minimum number of threads that should be in the pool as long as it is
           in use.  This may be anywhere between 2 and max-threads.
      
       (*) /proc/sys/kernel/slow-work/max-threads
      
           The maximum number of threads that should in the pool.  This may be
           anywhere between min-threads and 255 or NR_CPUS * 2, whichever is greater.
      
       (*) /proc/sys/kernel/slow-work/vslow-percentage
      
           The percentage of active threads in the pool that may be used to execute
           very slow work items.  This may be between 1 and 99.  The resultant number
           is bounded to between 1 and one fewer than the number of active threads.
           This ensures there is always at least one thread that can process very
           slow work items, and always at least one thread that won't.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      12e22c5e
    • David Howells's avatar
      Make slow-work thread pool actually dynamic · 109d9272
      David Howells authored
      
      Make the slow-work thread pool actually dynamic in the number of threads it
      contains.  With this patch, it will both create additional threads when it has
      extra work to do, and cull excess threads that aren't doing anything.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      109d9272
    • David Howells's avatar
      Create a dynamically sized pool of threads for doing very slow work items · 07fe7cb7
      David Howells authored
      
      Create a dynamically sized pool of threads for doing very slow work items, such
      as invoking mkdir() or rmdir() - things that may take a long time and may
      sleep, holding mutexes/semaphores and hogging a thread, and are thus unsuitable
      for workqueues.
      
      The number of threads is always at least a settable minimum, but more are
      started when there's more work to do, up to a limit.  Because of the nature of
      the load, it's not suitable for a 1-thread-per-CPU type pool.  A system with
      one CPU may well want several threads.
      
      This is used by FS-Cache to do slow caching operations in the background, such
      as looking up, creating or deleting cache objects.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
      Acked-by: default avatarSteve Dickson <steved@redhat.com>
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: default avatarDaire Byrne <Daire.Byrne@framestore.com>
      07fe7cb7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 · 8fe74cf0
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
        Remove two unneeded exports and make two symbols static in fs/mpage.c
        Cleanup after commit 585d3bc0
        Trim includes of fdtable.h
        Don't crap into descriptor table in binfmt_som
        Trim includes in binfmt_elf
        Don't mess with descriptor table in load_elf_binary()
        Get rid of indirect include of fs_struct.h
        New helper - current_umask()
        check_unsafe_exec() doesn't care about signal handlers sharing
        New locking/refcounting for fs_struct
        Take fs_struct handling to new file (fs/fs_struct.c)
        Get rid of bumping fs_struct refcount in pivot_root(2)
        Kill unsharing fs_struct in __set_personality()
      8fe74cf0
    • Linus Torvalds's avatar
      Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · c2eb2fa6
      Linus Torvalds authored
      * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (21 commits)
        drm/radeon: load the right microcode on rs780
        drm: remove unused "can_grow" parameter from drm_crtc_helper_initial_config
        drm: fix EDID backward compat check
        drm: sync the mode validation for INTERLACE/DBLSCAN
        drm: fix typo in edid vendor parsing.
        DRM: drm_crtc_helper.h doesn't actually need i2c.h
        drm: fix missing inline function on 32-bit powerpc.
        drm: Use pgprot_writecombine in GEM GTT mapping to get the right bits for !PAT.
        drm/i915: Add a spinlock to protect the active_list
        drm/i915: Fix SDVO TV support
        drm/i915: Fix SDVO CREATE_PREFERRED_INPUT_TIMING command
        drm/i915: Fix error in SDVO DTD and modeline convert
        drm/i915: Fix SDVO command debug function
        drm/i915: fix TV mode setting in property change
        drm/i915: only set TV mode when any property changed
        drm/i915: clean up udelay usage
        drm/i915: add VGA hotplug support for 945+
        drm/i915: correctly set IGD device's gtt size for KMS.
        drm/i915: avoid hanging on to a stale pointer to raw_edid.
        drm/i915: check for -EINVAL from vm_insert_pfn
        ...
      c2eb2fa6
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · ef8a97bb
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (54 commits)
        glge: remove unused #include <version.h>
        dnet: remove unused #include <version.h>
        tcp: miscounts due to tcp_fragment pcount reset
        tcp: add helper for counter tweaking due mid-wq change
        hso: fix for the 'invalid frame length' messages
        hso: fix for crash when unplugging the device
        fsl_pq_mdio: Fix compile failure
        fsl_pq_mdio: Revive UCC MDIO support
        ucc_geth: Pass proper device to DMA routines, otherwise oops happens
        i.MX31: Fixing cs89x0 network building to i.MX31ADS
        tc35815: Fix build error if NAPI enabled
        hso: add Vendor/Product ID's for new devices
        ucc_geth: Remove unused header
        gianfar: Remove unused header
        kaweth: Fix locking to be SMP-safe
        net: allow multiple dev per napi with GRO
        r8169: reset IntrStatus after chip reset
        ixgbe: Fix potential memory leak/driver panic issue while setting up Tx & Rx ring parameters
        ixgbe: fix ethtool -A|a behavior
        ixgbe: Patch to fix driver panic while freeing up tx & rx resources
        ...
      ef8a97bb
  2. 02 Apr, 2009 28 commits