14 Oct, 2014

1 commit

  • Starting with Linux 3.12 processes get stuck in D state forever in
    UserModeLinux under sync heavy workloads. This bug was introduced by
    commit 805f11a0d5 (um: ubd: Add REQ_FLUSH suppport).
    Fix bug by adding a check if FLUSH request was successfully submitted to
    the I/O thread and keeping the FLUSH request on the request queue on
    submission failures.

    Fixes: 805f11a0d5 (um: ubd: Add REQ_FLUSH suppport)
    Signed-off-by: Thorsten Knabe
    Cc: stable@kernel.org # >= 3.12
    Signed-off-by: Richard Weinberger

    Thorsten Knabe
     

07 Sep, 2013

3 commits

  • Richard reported that some UML processes survive if the UML
    main process receives a SIGTERM.
    This issue was caused by a wrongly placed signal(SIGTERM, SIG_DFL)
    in init_new_thread_signals().
    It disabled the UML exit handler accidently for some processes.
    The correct solution is to disable the fatal handler for all
    UML helper threads/processes.
    Such that last_ditch_exit() does not get called multiple times
    and all processes can exit due to SIGTERM.

    Reported-and-tested-by: Richard W.M. Jones
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • Just a clean-up patch to remove the open coded
    variants and to ensure that all requests are submitted the
    same way.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • UML's block device driver does not support write barriers,
    to support this this patch adds REQ_FLUSH suppport.
    Every time the block layer sends a REQ_FLUSH we fsync() now
    our backing file to guarantee data consistency.

    Reported-and-tested-by: Richard W.M. Jones
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     

07 May, 2013

1 commit


10 Oct, 2012

1 commit


02 Aug, 2012

1 commit


25 Mar, 2012

2 commits

  • Signed-off-by: Al Viro
    Signed-off-by: Richard Weinberger

    Al Viro
     
  • Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
    We run all interrupt handlers with interrupts disabled
    and we even check and yell when an interrupt handler
    returns with interrupts enabled (see commit [b738a50a:
    genirq: Warn when handler enables interrupts]).

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Signed-off-by: Richard Weinberger

    Yong Zhang
     

02 Nov, 2011

3 commits


27 Jan, 2011

1 commit


23 Oct, 2010

1 commit

  • * 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    BKL: introduce CONFIG_BKL.
    dabusb: remove the BKL
    sunrpc: remove the big kernel lock
    init/main.c: remove BKL notations
    blktrace: remove the big kernel lock
    rtmutex-tester: make it build without BKL
    dvb-core: kill the big kernel lock
    dvb/bt8xx: kill the big kernel lock
    tlclk: remove big kernel lock
    fix rawctl compat ioctls breakage on amd64 and itanic
    uml: kill big kernel lock
    parisc: remove big kernel lock
    cris: autoconvert trivial BKL users
    alpha: kill big kernel lock
    isapnp: BKL removal
    s390/block: kill the big kernel lock
    hpet: kill BKL, add compat_ioctl

    Linus Torvalds
     

19 Oct, 2010

1 commit

  • Three uml device drivers still use the big kernel lock,
    but all of them can be safely converted to using
    a per-driver mutex instead. Most likely this is not
    even necessary, so after further review these can
    and should be removed as well.

    The exec system call no longer requires the BKL either,
    so remove it from there, too.

    Signed-off-by: Arnd Bergmann
    Cc: Jeff Dike
    Cc: user-mode-linux-devel@lists.sourceforge.net

    Arnd Bergmann
     

15 Oct, 2010

1 commit

  • Commit f81f2f7c (ubd: drop unnecessary rq->sector manipulation)
    dropped request->sector manipulation in preparation for global request
    handling cleanup; unfortunately, it incorrectly assumed that the
    updated sector wasn't being used.

    ubd tries to issue as many requests as possible to io_thread. When
    issuing fails due to memory pressure or other reasons, the device is
    put on the restart list and issuing stops. On IO completion, devices
    on the restart list are scanned and IO issuing is restarted.

    ubd issues IOs sg-by-sg and issuing can be stopped in the middle of a
    request, so each device on the restart queue needs to remember where
    to restart in its current request. ubd needs to keep track of the
    issue position itself because,

    * blk_rq_pos(req) is now updated by the block layer to keep track of
    _completion_ position.

    * Multiple io_req's for the current request may be in flight, so it's
    difficult to tell where blk_rq_pos(req) currently is.

    Add ubd->rq_pos to keep track of the issue position and use it to
    correctly restart io_req issue.

    Signed-off-by: Tejun Heo
    Reported-by: Richard Weinberger
    Tested-by: Richard Weinberger
    Tested-by: Chris Frey
    Cc: stable@kernel.org
    Signed-off-by: Jens Axboe

    Tejun Heo
     

08 Aug, 2010

1 commit

  • The open and release block_device_operations are currently
    called with the BKL held. In order to change that, we must
    first make sure that all drivers that currently rely
    on this have no regressions.

    This blindly pushes the BKL into all .open and .release
    operations for all block drivers to prepare for the
    next step. The drivers can subsequently replace the BKL
    with their own locks or remove it completely when it can
    be shown that it is not needed.

    The functions blkdev_get and blkdev_put are the only
    remaining users of the big kernel lock in the block
    layer, besides a few uses in the ioctl code, none
    of which need to serialize with blkdev_{get,put}.

    Most of these two functions is also under the protection
    of bdev->bd_mutex, including the actual calls to
    ->open and ->release, and the common code does not
    access any global data structures that need the BKL.

    Signed-off-by: Arnd Bergmann
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     

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
     

26 Feb, 2010

2 commits


16 Dec, 2009

1 commit

  • Convert code away from ->read_proc/->write_proc interfaces. Switch to
    proc_create()/proc_create_data() which make addition of proc entries
    reliable wrt NULL ->proc_fops, NULL ->data and so on.

    Problem with ->read_proc et al is described here commit
    786d7e1612f0b0adb6046f19b906609e4fe8b1ba "Fix rmmod/read/write races in
    /proc entries"

    Signed-off-by: Alexey Dobriyan
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

22 Sep, 2009

1 commit


16 Jun, 2009

1 commit

  • In the near future, the driver core is going to not allow direct access
    to the driver_data pointer in struct device. Instead, the functions
    dev_get_drvdata() and dev_set_drvdata() should be used. These functions
    have been around since the beginning, so are backwards compatible with
    all older kernel versions.

    Cc: user-mode-linux-devel@lists.sourceforge.net
    Cc: Jeff Dike
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

11 May, 2009

2 commits

  • Till now block layer allowed two separate modes of request execution.
    A request is always acquired from the request queue via
    elv_next_request(). After that, drivers are free to either dequeue it
    or process it without dequeueing. Dequeue allows elv_next_request()
    to return the next request so that multiple requests can be in flight.

    Executing requests without dequeueing has its merits mostly in
    allowing drivers for simpler devices which can't do sg to deal with
    segments only without considering request boundary. However, the
    benefit this brings is dubious and declining while the cost of the API
    ambiguity is increasing. Segment based drivers are usually for very
    old or limited devices and as converting to dequeueing model isn't
    difficult, it doesn't justify the API overhead it puts on block layer
    and its more modern users.

    Previous patches converted all block low level drivers to dequeueing
    model. This patch completes the API transition by...

    * renaming elv_next_request() to blk_peek_request()

    * renaming blkdev_dequeue_request() to blk_start_request()

    * adding blk_fetch_request() which is combination of peek and start

    * disallowing completion of queued (not started) requests

    * applying new API to all LLDs

    Renamings are for consistency and to break out of tree code so that
    it's apparent that out of tree drivers need updating.

    [ Impact: block request issue API cleanup, no functional change ]

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: James Bottomley
    Cc: Mike Miller
    Cc: unsik Kim
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: Laurent Vivier
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Grant Likely
    Cc: Adrian McMenamin
    Cc: Stephen Rothwell
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Alex Dubov
    Cc: Pierre Ossman
    Cc: David Woodhouse
    Cc: Markus Lidel
    Cc: Stefan Weinhuber
    Cc: Martin Schwidefsky
    Cc: Pete Zaitcev
    Cc: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • With recent cleanups, there is no place where low level driver
    directly manipulates request fields. This means that the 'hard'
    request fields always equal the !hard fields. Convert all
    rq->sectors, nr_sectors and current_nr_sectors references to
    accessors.

    While at it, drop superflous blk_rq_pos() < 0 test in swim.c.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Geert Uytterhoeven
    Tested-by: Grant Likely
    Acked-by: Grant Likely
    Tested-by: Adrian McMenamin
    Acked-by: Adrian McMenamin
    Acked-by: Mike Miller
    Cc: James Bottomley
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Eric Moore
    Cc: Alan Stern
    Cc: FUJITA Tomonori
    Cc: Pete Zaitcev
    Cc: Stephen Rothwell
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Alex Dubov
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: Dario Ballabio
    Cc: David S. Miller
    Cc: Rusty Russell
    Cc: unsik Kim
    Cc: Laurent Vivier
    Signed-off-by: Jens Axboe

    Tejun Heo
     

28 Apr, 2009

2 commits

  • ubd curiously updates rq->sector while issuing the request in multiple
    pieces. Don't do it and simply use local copy of sector.

    [ Impact: cleanup ]

    Signed-off-by: Tejun Heo
    Cc: Jeff Dike
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • ubd had its own block request partial completion mechanism, which is
    unnecessary as block layer already does it. Kill ubd_end_request()
    and ubd_finish() and replace them with direct call to
    blk_end_request().

    [ Impact: cleanup ]

    Signed-off-by: Tejun Heo
    Cc: Jeff Dike
    Signed-off-by: Jens Axboe

    Tejun Heo
     

02 Apr, 2009

1 commit


01 Apr, 2009

1 commit


21 Oct, 2008

2 commits

  • ubd_ioctl() doesn't need BKL, so unlocked_ioctl() it becomes...

    Signed-off-by: Al Viro

    Al Viro
     
  • To keep the size of changesets sane we split the switch by drivers;
    to keep the damn thing bisectable we do the following:
    1) rename the affected methods, add ones with correct
    prototypes, make (few) callers handle both. That's this changeset.
    2) for each driver convert to new methods. *ALL* drivers
    are converted in this series.
    3) kill the old (renamed) methods.

    Note that it _is_ a flagday; all in-tree drivers are converted and by the
    end of this series no trace of old methods remain. The only reason why
    we do that this way is to keep the damn thing bisectable and allow per-driver
    debugging if anything goes wrong.

    New methods:
    open(bdev, mode)
    release(disk, mode)
    ioctl(bdev, mode, cmd, arg) /* Called without BKL */
    compat_ioctl(bdev, mode, cmd, arg)
    locked_ioctl(bdev, mode, cmd, arg) /* Called with BKL, legacy */

    Signed-off-by: Al Viro

    Al Viro
     

07 Jun, 2008

1 commit


13 May, 2008

1 commit

  • I just saw similar patches in the janitor kernel's list, and spotted place it
    fits.

    Signed-off-by: Jiri Olsa
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Olsa
     

28 Apr, 2008

1 commit

  • Make some global functions and variables static.

    And remove some useless declarations for local functions, since we just need
    to move their definitions ahead.

    [jdike@addtoit.com: checkpatch cleanups]
    Signed-off-by: WANG Cong
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    WANG Cong
     

06 Feb, 2008

5 commits

  • The fakehd switch lost its implementation at some point. Since no one is
    screaming for it, we might as well remove it.

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

    Jeff Dike
     
  • The previous const-ing patch consted a string which shouldn't have
    been, and I didn't notice the gcc warning.

    ubd_setup can't take a const char * because its address is assigned to
    something which expects a char *arg. Many setups modify the string
    they are given, they can't be const.

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

    Jeff Dike
     
  • Tidy kern_util.h. It turns out that most of the function declarations
    aren't used, so they can go away. os.h no longer includes
    kern_util.h, so files which got it through os.h now need to include it
    directly. A number of other files never needed it, so these includes
    are deleted.

    The structure which was used to pass signal handlers from the kernel
    side to the userspace side is gone. Instead, the handlers are
    declared here, and used directly from libc code. This allows
    arch/um/os-Linux/trap.c to be deleted, with its remnants being moved
    to arch/um/os-Linux/skas/trap.c.

    arch/um/os-Linux/tty.c had its inclusions changed, and it needed some
    style attention, so it got tidied.

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

    Jeff Dike
     
  • This patch also does some improvements for uml code. Improvements include
    dropping unnecessary cast, killing some unnecessary code and still some
    constifying for pointers etc..

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

    WANG Cong
     
  • The ubd help message didn't document the 'c' flag.

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

    Jeff Dike
     

28 Jan, 2008

1 commit

  • This patch converts um to use blk_end_request interfaces.
    Related 'uptodate' arguments are converted to 'error'.

    As a result, the interface of internal function, ubd_end_request(),
    is changed.

    Cc: Jeff Dike
    Signed-off-by: Kiyoshi Ueda
    Signed-off-by: Jun'ichi Nomura
    Signed-off-by: Jens Axboe

    Kiyoshi Ueda