12 Jan, 2012

1 commit


06 Jan, 2012

1 commit

  • Reduce object size by deduplicating formats.

    Use vsprintf extension %pV.
    Rename P9_DPRINTK uses to p9_debug, align arguments.
    Add function for _p9_debug and macro to add __func__.
    Add missing "\n"s to p9_debug uses.
    Remove embedded function names as p9_debug adds it.
    Remove P9_EPRINTK macro and convert use to pr_.
    Add and use pr_fmt and pr_.

    $ size fs/9p/built-in.o*
    text data bss dec hex filename
    62133 984 16000 79117 1350d fs/9p/built-in.o.new
    67342 984 16928 85254 14d06 fs/9p/built-in.o.old
    $ size net/9p/built-in.o*
    text data bss dec hex filename
    88792 4148 22024 114964 1c114 net/9p/built-in.o.new
    94072 4148 23232 121452 1da6c net/9p/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Eric Van Hensbergen

    Joe Perches
     

25 Oct, 2011

1 commit

  • * remove lot of update to different data structure
    * add a seperate callback for zero copy request.
    * above makes non zero copy code path simpler
    * remove conditionalizing TREAD/TREADDIR/TWRITE in the zero copy path
    * Fix the dotu p9_check_errors with zero copy. Add sufficient doc around
    * Add support for both in and output buffers in zero copy callback
    * pin and unpin pages in the same context
    * use helpers instead of defining page offset and rest of page ourself
    * Fix mem leak in p9_check_errors
    * Remove 'E' and 'F' in p9pdu_vwritef

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

06 Sep, 2011

1 commit


23 Jul, 2011

2 commits


16 Apr, 2011

1 commit


23 Mar, 2011

4 commits

  • Recent zerocopy work in the 9P VirtIO transport maps and pins
    user buffers into kernel memory for the server to work on them.
    Since the user process can initiate this kind of pinning with a simple
    read/write call, thousands of IO threads initiated by the user process can
    hog the system resources and could result into denial of service.

    This patch introduces flow control to avoid that extreme scenario.

    The ceiling limit to avoid denial of service attacks is set to relatively
    high (nr_free_pagecache_pages()/4) so that it won't interfere with
    regular usage, but can step in extreme cases to limit the total system
    hang. Since we don't have a global structure to accommodate this variable,
    I choose the virtio_chan as the home for this.

    Signed-off-by: Venkateswararao Jujjuri
    Reviewed-by: Badari Pulavarty
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • Given that the sprious wake-ups are common, we need to move the
    condition setting right next to the wake_up(). After setting the condition
    to req->status = REQ_STATUS_RCVD, sprious wakeups may cause the
    virtqueue back on the free list for someone else to use.
    This may result in kernel panic while relasing the pinned pages
    in p9_release_req_pages().

    Also rearranged the while loop in req_done() for better redability.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • Process may wait to get space on VirtIO ring to send a transaction to
    VirtFS server. Current code just does a conditional wake_up() which
    means only one process will be woken up even if multiple processes
    are waiting.

    This fix makes the wake_up unconditional. Hence we won't have any
    processes waiting for-ever.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     

15 Mar, 2011

2 commits


28 Oct, 2010

2 commits


28 Sep, 2010

1 commit

  • p9_virtio_create will only compare the the channel's tag characters
    against the device name till the end of the channel's tag but not till
    the end of the device name. This means that if a user defines channels
    with the tags foo and foobar then he would mount foo when he requested
    foonot and may mount foo when he requested foobar.

    Thus it is necessary to check both string lengths against each other in
    case of a successful partial string match.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: David S. Miller

    Sven Eckelmann
     

19 May, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

13 Mar, 2010

2 commits


06 Mar, 2010

3 commits

  • With this patch we have

    # mount -t 9p -o trans=virtio virtio2 /mnt/
    # mount -t 9p -o trans=virtio virtio2 /mnt/
    mount: virtio2 already mounted or /mnt/ busy
    mount: according to mtab, virtio2 is already mounted on /mnt
    # mount -t 9p -o trans=virtio virtio3 /mnt/ -o debug=0xfff
    mount: special device virtio3 does not exist

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Use a list to track the channel instead of statically
    allocated array

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • This is needed for supporting multiple mount points.

    We can find out the device names to be used with mount by checking

    /sys/devices/virtio-pci/virtio*/device file

    if the device file have value 9 then the specific virtio device can
    be used for mounting.

    ex:
    #cat /sys/devices/virtio-pci/virtio1/device
    9

    now we can mount using
    # mount -t 9p -o trans=virtio virtio1 /mnt/

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

09 Feb, 2010

2 commits

  • The patch fix the crash repoted below

    [ 15.149907] BUG: unable to handle kernel NULL pointer dereference at 00000001
    [ 15.150806] IP: [] p9_virtio_close+0x18/0x24
    .....
    ....
    [ 15.150806] Call Trace:
    [ 15.150806] [] ? p9_client_destroy+0x3f/0x163
    [ 15.150806] [] ? p9_client_create+0x25f/0x270
    [ 15.150806] [] ? trace_hardirqs_on+0xb/0xd
    [ 15.150806] [] ? match_token+0x64/0x164
    [ 15.150806] [] ? v9fs_session_init+0x2f1/0x3c8
    [ 15.150806] [] ? kmem_cache_alloc+0x98/0xb8
    [ 15.150806] [] ? trace_hardirqs_on+0xb/0xd
    [ 15.150806] [] ? v9fs_get_sb+0x47/0x1e8
    [ 15.150806] [] ? v9fs_get_sb+0x60/0x1e8
    [ 15.150806] [] ? vfs_kern_mount+0x81/0x11a
    [ 15.150806] [] ? do_kern_mount+0x33/0xbe
    [ 15.150806] [] ? do_mount+0x654/0x6b3
    [ 15.150806] [] ? do_page_fault+0x0/0x284
    [ 15.150806] [] ? copy_mount_options+0x73/0xd2
    [ 15.150806] [] ? sys_mount+0x61/0x94
    [ 15.150806] [] ? syscall_call+0x7/0xb
    ....
    [ 15.203562] ---[ end trace 1dd159357709eb4b ]---
    [

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • The 9p virtio transport was not updating its connection status correctly
    preventing it from being able to mount the server.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     

22 Oct, 2009

1 commit

  • Rusty,

    commit 3ca4f5ca73057a617f9444a91022d7127041970a
    virtio: add virtio IDs file
    moved all device IDs into a single file. While the change itself is
    a very good one, it can break userspace applications. For example
    if a userspace tool wanted to get the ID of virtio_net it used to
    include virtio_net.h. This does no longer work, since virtio_net.h
    does not include virtio_ids.h.
    This patch moves all "#include " from the C
    files into the header files, making the header files compatible with
    the old ones.

    In addition, this patch exports virtio_ids.h to userspace.

    CC: Fernando Luis Vazquez Cao
    Signed-off-by: Christian Borntraeger
    Signed-off-by: Rusty Russell

    Christian Borntraeger
     

23 Sep, 2009

3 commits


18 Aug, 2009

1 commit


12 Jun, 2009

2 commits


06 Apr, 2009

1 commit


18 Oct, 2008

4 commits

  • This code moves the rpc function to the common client base,
    reorganizes the flush code to be more simple and stable, and
    makes the necessary adjustments to the underlying transports
    to adapt to the new structure.

    This reduces the overall amount of code duplication between the
    transports and should make adding new transports more straightforward.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • Apply the now common p9_req_t structure to the fd transport.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • The virtio transport uses a simplified request management system
    that I want to use for all transports. This patch adapts and moves the
    exisiting code for managing requests to the client common code.
    Later patches will apply these mechanisms to the other transports.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • Right now there is a transport module structure which provides per-transport
    type functions and data and a transport structure which contains per-instance
    public data as well as function pointers to instance specific functions.

    This patch moves public transport visible instance data to the client
    structure (which in some cases had duplicate data) and consolidates the
    functions into the transport module structure.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     

25 Sep, 2008

1 commit

  • 9p trans modules aren't refcounted nor were they unregistered
    properly. Fix it.

    * Add 9p_trans_module->owner and reference the module on each trans
    instance creation and put it on destruction.

    * Protect v9fs_trans_list with a spinlock. This isn't strictly
    necessary as the list is manipulated only during module loading /
    unloading but it's a good idea to make the API safe.

    * Unregister trans modules when the corresponding module is being
    unloaded.

    * While at it, kill unnecessary EXPORT_SYMBOL on p9_trans_fd_init().

    Signed-off-by: Tejun Heo
    Signed-off-by: Eric Van Hensbergen

    Tejun Heo
     

15 May, 2008

2 commits