18 Jul, 2007

1 commit


17 Jul, 2007

9 commits

  • COWed devices can't handle more than 32 (64 on x86_64) sectors in one request
    due to the size of the bitmap being carried around in the io_thread_req.

    Enforce that by telling the block layer not to put too many sectors in
    requests to COWed devices.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • UML had two wrapper procedures for kmalloc, um_kmalloc and um_kmalloc_atomic
    because the flag constants weren't available in userspace code.
    kern_constants.h had made kernel constants available for a long time, so there
    is no need for these wrappers any more. Rather, userspace code calls kmalloc
    directly with the userspace versions of the gfp flags.

    kmalloc isn't a real procedure, so I had to essentially copy the inline
    wrapper around __kmalloc.

    vmalloc also had its own wrapper for no good reason. This is now gone.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • run_helper and run_helper_thread had arguments which were the same in all
    callers. run_helper's stack_out was always NULL and run_helper_thread's
    stack_order was always 0. These are now gone, and the constants folded
    into the code.

    Also fixed leaks of the helper stack in the AIO and SIGIO code.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Cleanup of the SIGWINCH support.

    Some code and comment reformatting.

    The stack used for SIGWINCH threads was leaked. This is now fixed by storing
    it with the pid and other information, and freeing it when the thread is
    killed.

    If something goes wrong with a WIGWINCH thread, and this is discovered in the
    interrupt handler, the winch record would leak. It is now freed, except that
    the IRQ isn't freed. This is hard to do from interrupt context. This has the
    side-effect that the IRQ system maintains a reference to the freed structure,
    but that shouldn't cause a problem since the descriptor is disabled.

    register_winch_irq is now much better about cleaning up after an
    initialization failure.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • If the host side of a console can't be opened, this will now produce visible
    error messages.

    enable_chan now returns a status and this is passed up to con_open and
    ssl_open, which will complain if anything went wrong.

    The default host device for the serial line driver is now a pts device rather
    than a pty device since lots of hosts have LEGACY_PTYS disabled. This had
    always been failing on such hosts, but silently.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Cleanup, mostly style violations.

    Tidied the includes.

    getmaster returns a real errno, which pty_open returns if there's a
    problem.

    The printks now have severity.

    Changed os_* calls to call libc directly.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Major tidying of the xterm console driver:
    got rid of the tt-mode gdb support
    tidied up the includes
    fixed lots of style violations
    replaced os_* calls with glibc calls in xterm.c
    all printk calls now have a severity indicator
    the error paths of xterm_open are closer to being right

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • DEBUG_SHIRQ generates spurious interrupts, triggering handlers such as
    mconsole_interrupt() or line_interrupt(). They expect data to be available to
    be read from their sockets/pipes, but in the case of spurious interrupts, the
    host didn't actually send anything, so UML hangs in read() and friends.
    Setting those fd's as O_NONBLOCK makes DEBUG_SHIRQ-enabled UML kernels boot
    and run correctly.

    Signed-off-by: Eduard-Gabriel Munteanu
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eduard-Gabriel Munteanu
     
  • It is theoretically possible for a request to finish and be freed between
    writing it to the I/O thread and updating the sector count. In this case, the
    update will dereference a freed pointer.

    To avoid this, I delay the update until processing the next sg segment, when
    the request pointer is known to be good.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

09 Jun, 2007

1 commit

  • Include linux/kernel.h wherever simple_strtoul is used. This kills a
    compile warning in stderr_console.c and potential ones in the other files.

    This also fixes a bunch of style violations in exitcode.c.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

09 May, 2007

2 commits

  • Allow a pcap device to be assigned a MAC on the command line. They don't
    really need one, but it is handy to be able to do when your distro assigns a
    new ethernet device whenever it sees a new MAC.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Some network device cleanup.

    When setup_etheraddr found a globally valid MAC being assigned to an
    interface, it went ahead and used it rather than assigning a random MAC like
    the other cases do. This isn't really an error like the others, but it seems
    consistent to make it behave the same.

    We were getting some duplicate kfree() in the error case in eth_configure
    because platform_device_unregister frees buffers that the error cases
    following tried to free again.

    The pcap initialization routine wasn't doing the proper printk of its
    information, causing a printk of the first part of that line to be
    unterminated by a newline.

    The pcap code had a bunch of style violations, which are now fixed.

    pcap_setup wasn't returning false when it detected an unrecognized
    option.

    The printks in pcap_user all got UM_KERN_BLAH prepended to their
    format strings.

    pcap_remove now checks for a non-NULL pcap structure before it calls
    pcap_close.

    Signed-off-by: Jeff Dike
    Acked-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

08 May, 2007

19 commits

  • Rename os_{read_write}_file_k back to os_{read_write}_file, delete
    the originals and their bogus infrastructure, and fix all the callers.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Formatting fixes ahead of renaming os_{read_write}_file_k to
    os_{read_write}_file and fixing all the callers.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Convert all remaining os_{read_write}_file users to use the simple
    {read,write} wrappers, os_{read_write}_file_k.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Sanitise gfp flags; it actually is an atomic context, so drop the
    GFP_KERNEL part.

    Signed-off-by: Peter Zijlstra
    Acked-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • Instead of writing entire structures between UML and the I/O thread, we send
    pointers. This cuts down on the amount of data being copied and possibly
    allows more requests to be pending between the two.

    This requires that the requests be kmalloced and freed instead of living on
    the stack.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Send as many I/O requests to the I/O thread as possible, even though it will
    still only handle one at a time. This provides an opportunity to reduce
    latency by starting one request before the previous one has been finished in
    the driver.

    Request handling is somewhat modernized by requesting sg pieces of a request
    and handling them separately, finishing off the entire request after all the
    pieces are done.

    When a request queue stalls, normally because its pipe to the I/O thread is
    full, it is put on the restart list. This list is processed by starting up
    the queues on it whenever there is some indication that progress might be
    possible again. Currently, this happens in the driver interrupt routine.
    Some requests have been finished, so there is likely to be room in the pipe
    again.

    This almost doubles throughput when copying data between devices, but made no
    noticable difference on anything else I tried.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch starts the removal of a very old, very broken piece of code. This
    stems from the problem of passing a userspace buffer into read() or write() on
    the host. If that buffer had not yet been faulted in, read and write will
    return -EFAULT.

    To avoid this problem, the solution was to fault the buffer in before the
    system call by touching the pages that hold the buffer by doing a copy-user of
    a byte to each page. This is obviously bogus, but it does usually work, in tt
    mode, since the kernel and process are in the same address space and userspace
    addresses can be accessed directly in the kernel.

    In skas mode, where the kernel and process are in separate address spaces, it
    is completely bogus because the userspace address, which is invalid in the
    kernel, is passed into the system call instead of the corresponding physical
    address, which would be valid. Here, it appears that this code, on every host
    read() or write(), tries to fault in a random process page. This doesn't seem
    to cause any correctness problems, but there is a performance impact. This
    patch, and the ones following, result in a 10-15% performance gain on a kernel
    build.

    This code can't be immediately tossed out because when it is, you can't log
    in. Apparently, there is some code in the console driver which depends on
    this somehow.

    However, we can start removing it by switching the code which does I/O using
    kernel addresses to using plain read() and write(). This patch introduces
    os_read_file_k and os_write_file_k for use with kernel buffers and converts
    all call locations which use obvious kernel buffers to use them. These
    include I/O using buffers which are local variables which are on the stack or
    kmalloc-ed. Later patches will handle the less obvious cases, followed by a
    mass conversion back to the original interface.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Define release methods for the ubd and net drivers. They contain as much of
    the remove methods as make sense. All error checking must have already been
    done as well as anything else that might be holding a reference on the device
    kobject.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • userspace code used to have to call the kernelspace function page_size() in
    order to determine the value of the kernel's PAGE_SIZE. Since this is now
    available directly from kern_constants.h as UM_KERN_PAGE_SIZE, page_size() can
    be deleted and calls changed to use the constant.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Calls lines_init() *after* xterm_title is modified to include umid.

    Signed-off-by: Davide Brini
    Signed-off-by: Jeff Dike
    Acked-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Brini
     
  • To look at users I did:
    $ find arch/um/ include/asm-um -name '*.[ch]'|xargs grep -r 'net_kern\.h'
    +-l|xargs grep '\'

    Most users just cast user to the appropriate pointer, the remaining ones are
    fixed here. In net_kern.c, I'm almost sure that save trick is not needed
    anymore, but I've not verified it.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • Avoid using the temporary buffer introduced by previous patch to hold the
    device name.

    Btw, avoid leaking device on an error path. Other error paths may need
    cleanup.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • Improve checking and diagnostics for broadcast and multicast Ethernet MAC
    addresses, and distinguish between those cases in output; also make sure the
    device is assigned a MAC address valid only locally to avoid collisions.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • user_util.h isn't needed any more, so delete it and remove all includes of it.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Rescue the useful contents of the soon-to-be-gone user-util.h.

    pty.c now gets ptsname from stdlib.h like it should have always done.

    CATCH_EINTR is now in os.h, although perhaps all usage should be under
    os-Linux at some point.

    get_pty is also in os.h.

    This patch restores the old definition of ARRAY_SIZE in user.h. This file is
    included only in userspace files, so there will be no conflict with the
    kernel's new ARRAY_SIZE. The copy of the kernel's ARRAY_SIZE and associated
    infrastructure is now gone.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This fixes a number of problems associated with network interface hotplug.

    The userspace initialization function can fail in some cases, but the
    failure was never passed back to eth_configure, which proceeded with the
    configuration. This results in a zombie device that is present, but can't
    work. This is fixed by allowing the initialization routines to return an
    error, which is checked, and the configuration aborted on failure.

    eth_configure failed to check for many failures. Even when it did check,
    it didn't undo whatever initializations has already happened, so a present,
    but partially initialized and non-working device could result. It now
    checks everything that can fail, and bails out, undoing whatever had been
    done.

    The return value of eth_configure was always ignored, so it is now just
    void.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Fix a bunch of formatting violations in the drivers:
    return(n) -> return n
    whitespace fixes
    emacs formatting comment removal
    breaking if(foo) return(n) into two lines

    There are also a couple of errno use bugs:
    using errno in a printk when the failure put errno into a local variable
    saving errno after a printk, which can change it

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • If a disk fails to open, i.e. its host file doesn't exist, it won't be
    removable because the hot-unplug code checks the existence of its gendisk.
    This won't exist because it is only allocated for successfully opened disks.
    Thus, a typo on the command line can result in a unusable and unfixable disk.

    This is fixed by freeing the gendisk if it's there, but not letting that
    affect the removal.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

26 Apr, 2007

2 commits

  • For the places where we need a pointer to the mac header, it is still legal to
    touch skb->mac.raw directly if just adding to, subtracting from or setting it
    to another layer header.

    This one also converts some more cases to skb_reset_mac_header() that my
    regex missed as it had no spaces before nor after '=', ugh.

    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     
  • For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
    later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
    64bit land while possibly keeping it as a pointer on 32bit.

    This one touches just the most simple case, next will handle the slightly more
    "complex" cases.

    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     

29 Mar, 2007

3 commits

  • As the comment immediately preceding this points out, this list is changed in
    irq context, so it needs to be protected with spin_lock_irqsave in process
    context when it is processed.

    Sometimes, gcc should just compile the comments and forget the code.

    The IRQ side of this was better, in the sense that it blocked and unblocked
    interrupts, but it still should have saved and restored them.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Fix a NULL dereference when unplugging a device. The default value of
    err_msg wants to be "" in case the driver doesn't modify it.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Commit 62f96cb01e8de7a5daee472e540f726db2801499 introduced per-devices
    queues and locks, which was fine as far as it went, but left in place a
    global which controlled access to submitting requests to the host. This
    should have been made per-device as well, since it causes I/O hangs when
    multiple block devices are in use.

    This patch fixes that by replacing the global with an activity flag in the
    device structure in order to tell whether the queue is currently being run.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

08 Mar, 2007

3 commits

  • Avoid reusing userspace errno twice - it can be cleared by libc code
    everywhere (in particular printk() does clear it in my setup).

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Acked-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • Fix confusion about call context - comments and code are inconsistent and
    plain wrong, my fault.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Acked-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • Since both UML consoles do not use percpu variables, they may be called when
    the cpu is still offline, and they may be marked CON_ANYTIME (this is
    documented in kernel/printk.c, grep for CON_ANYTIME to find mentions of this).

    Works well in testing done with lock debug enabled, should be safe but is not
    needed for next release.

    This would probably help also stderr_console.c, but this is yet to test.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Acked-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso