12 Sep, 2011

1 commit

  • There is very little benefit in allowing to let a ->make_request
    instance update the bios device and sector and loop around it in
    __generic_make_request when we can archive the same through calling
    generic_make_request from the driver and letting the loop in
    generic_make_request handle it.

    Note that various drivers got the return value from ->make_request and
    returned non-zero values for errors.

    Signed-off-by: Christoph Hellwig
    Acked-by: NeilBrown
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

10 Mar, 2011

3 commits


08 Aug, 2010

1 commit

  • Remove the current bio flags and reuse the request flags for the bio, too.
    This allows to more easily trace the type of I/O from the filesystem
    down to the block driver. There were two flags in the bio that were
    missing in the requests: BIO_RW_UNPLUG and BIO_RW_AHEAD. Also I've
    renamed two request flags that had a superflous RW in them.

    Note that the flags are in bio.h despite having the REQ_ name - as
    blkdev.h includes bio.h that is the only way to go for now.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

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
     

22 Sep, 2009

1 commit


24 Apr, 2009

1 commit

  • The umem driver issues two warnings on boot, due to blk_plug_device() and
    blk_remove_plug() being called without q->queue_lock held. Starting with
    e48ec690 (block: extend queue_flag bitops), the queue_flag_* functions
    warn if q->queue_lock doesn't appear to be locked. In fact, q->queue_lock
    is NULL (though that apparently isn't otherwise a problem as the driver is
    using card->lock for everything).

    Although blk_init_queue() with take a request_fn_proc and spinlock_t*,
    there isn't a corresponding init helper that takes a make_request_fn.
    Setting queue_lock to &card->lock explicitly seems to work fine for me.
    The warning goes away and the device appears to behave.

    [ 1.531881] v2.3 : Micro Memory(tm) PCI memory board block driver
    [ 1.538136] umem 0000:02:01.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
    [ 1.545018] umem 0000:02:01.0: Micro Memory(tm) controller found (PCI Mem Module (Battery Backup))
    [ 1.554176] umem 0000:02:01.0: CSR 0xfc9ffc00 -> 0xffffc200013d0c00 (0x100)
    [ 1.561279] umem 0000:02:01.0: Size 1048576 KB, Battery 1 Disabled (FAILURE), Battery 2 Disabled (FAILURE)
    [ 1.571114] umem 0000:02:01.0: Window size 16777216 bytes, IRQ 20
    [ 1.577304] umem 0000:02:01.0: memory NOT initialized. Consider over-writing whole device.
    [ 1.585989] umema:------------[ cut here ]------------
    [ 1.591775] WARNING: at include/linux/blkdev.h:492 blk_plug_device+0x6d/0x106()
    [ 1.592025] Hardware name: H8SSL
    [ 1.592025] Modules linked in:
    [ 1.592025] Pid: 1, comm: swapper Not tainted 2.6.29 #8
    [ 1.592025] Call Trace:
    [ 1.592025] [] warn_slowpath+0xd3/0xf2
    [ 1.592025] [] ? save_trace+0x3f/0x9b
    [ 1.592025] [] ? add_lock_to_list+0x7a/0xba
    [ 1.592025] [] ? validate_chain+0xb3b/0xce8
    [ 1.592025] [] ? mm_make_request+0x27/0x59
    [ 1.592025] [] ? mm_make_request+0x27/0x59
    [ 1.592025] [] ? __lock_acquire+0x74e/0x7b9
    [ 1.592025] [] ? get_lock_stats+0x34/0x5e
    [ 1.592025] [] ? put_lock_stats+0xe/0x27
    [ 1.592025] [] ? mm_make_request+0x27/0x59
    [ 1.592025] [] blk_plug_device+0x6d/0x106
    [ 1.592025] [] mm_make_request+0x46/0x59
    [ 1.592025] [] generic_make_request+0x335/0x3cf
    [ 1.592025] [] ? mempool_alloc_slab+0x11/0x13
    [ 1.592025] [] ? mempool_alloc+0x45/0x101
    [ 1.592025] [] ? put_lock_stats+0xe/0x27
    [ 1.592025] [] submit_bio+0x10a/0x119
    [ 1.592025] [] submit_bh+0xe5/0x109
    [ 1.592025] [] block_read_full_page+0x2aa/0x2cb
    [ 1.592025] [] ? blkdev_get_block+0x0/0x4c
    [ 1.592025] [] ? _spin_unlock_irq+0x36/0x51
    [ 1.592025] [] ? __lru_cache_add+0x92/0xb2
    [ 1.592025] [] blkdev_readpage+0x13/0x15
    [ 1.592025] [] read_cache_page_async+0x90/0x134
    [ 1.592025] [] ? blkdev_readpage+0x0/0x15
    [ 1.592025] [] ? adfspart_check_ICS+0x0/0x16c
    [ 1.592025] [] read_cache_page+0xe/0x45
    [ 1.592025] [] read_dev_sector+0x2e/0x93
    [ 1.592025] [] adfspart_check_ICS+0x28/0x16c
    [ 1.592025] [] ? trace_hardirqs_on+0xd/0xf
    [ 1.592025] [] ? adfspart_check_ICS+0x0/0x16c
    [ 1.592025] [] rescan_partitions+0x168/0x2fb
    [ 1.592025] [] __blkdev_get+0x259/0x336
    [ 1.592025] [] ? kobject_put+0x47/0x4b
    [ 1.592025] [] blkdev_get+0xb/0xd
    [ 1.592025] [] register_disk+0xc4/0x12b
    [ 1.592025] [] add_disk+0xc3/0x12d
    [ 1.592025] [] ? mm_init+0x0/0x1a5
    [ 1.592025] [] mm_init+0x129/0x1a5
    [ 1.592025] [] ? mm_init+0x0/0x1a5
    [ 1.592025] [] _stext+0x56/0x130
    [ 1.592025] [] ? register_irq_proc+0xae/0xca
    [ 1.592025] [] ? proc_pid_lookup+0xb4/0x18b
    [ 1.592025] [] kernel_init+0x132/0x18b
    [ 1.592025] [] child_rip+0xa/0x20
    [ 1.592025] [] ? restore_args+0x0/0x30
    [ 1.592025] [] ? kernel_init+0x0/0x18b
    [ 1.592025] [] ? child_rip+0x0/0x20
    [ 1.592025] ---[ end trace 7150b3b86da74e1e ]---
    [ 1.889858] ------------[ cut here ]------------[ve_plug+0x5f/0x91()
    [ 1.893848] Hardware name: H8SSL
    [ 1.893848] Modules linked in:
    [ 1.893848] Pid: 1, comm: swapper Tainted: G W 2.6.29 #8
    [ 1.893848] Call Trace:
    [ 1.893848] [] warn_slowpath+0xd3/0xf2
    [ 1.893848] [] ? trace_hardirqs_on_thunk+0x3a/0x3f
    [ 1.893848] [] ? restore_args+0x0/0x30
    [ 1.893848] [] ? __atomic_notifier_call_chain+0x0/0xb2
    [ 1.893848] [] ? _spin_unlock_irq+0x31/0x51
    [ 1.893848] [] ? _spin_unlock_irq+0x4d/0x51
    [ 1.893848] [] ? mm_make_request+0x4e/0x59
    [ 1.893848] [] ? get_lock_stats+0x34/0x5e
    [ 1.893848] [] ? put_lock_stats+0x25/0x27
    [ 1.893848] [] ? mm_unplug_device+0x25/0x50
    [ 1.893848] [] blk_remove_plug+0x5f/0x91
    [ 1.893848] [] mm_unplug_device+0x30/0x50
    [ 1.893848] [] blk_unplug+0x78/0x7d
    [ 1.893848] [] blk_backing_dev_unplug+0xd/0xf
    [ 1.893848] [] block_sync_page+0x4a/0x4c
    [ 1.893848] [] sync_page+0x44/0x4d
    [ 1.893848] [] __wait_on_bit_lock+0x42/0x8a
    [ 1.893848] [] ? sync_page+0x0/0x4d
    [ 1.893848] [] __lock_page+0x64/0x6b
    [ 1.893848] [] ? wake_bit_function+0x0/0x2a
    [ 1.893848] [] read_cache_page_async+0xd4/0x134
    [ 1.893848] [] ? blkdev_readpage+0x0/0x15
    [ 1.893848] [] ? adfspart_check_ICS+0x0/0x16c
    [ 1.893848] [] read_cache_page+0xe/0x45
    [ 1.893848] [] read_dev_sector+0x2e/0x93
    [ 1.893848] [] adfspart_check_ICS+0x28/0x16c
    [ 1.893848] [] ? trace_hardirqs_on+0xd/0xf
    [ 1.893848] [] ? adfspart_check_ICS+0x0/0x16c
    [ 1.893848] [] rescan_partitions+0x168/0x2fb
    [ 1.893848] [] __blkdev_get+0x259/0x336
    [ 1.893848] [] ? kobject_put+0x47/0x4b
    [ 1.893848] [] blkdev_get+0xb/0xd
    [ 1.893848] [] register_disk+0xc4/0x12b
    [ 1.893848] [] add_disk+0xc3/0x12d
    [ 1.893848] [] ? mm_init+0x0/0x1a5
    [ 1.893848] [] mm_init+0x129/0x1a5
    [ 1.893848] [] ? mm_init+0x0/0x1a5
    [ 1.893848] [] _stext+0x56/0x130
    [ 1.893848] [] ? register_irq_proc+0xae/0xca
    [ 1.893848] [] ? proc_pid_lookup+0xb4/0x18b
    [ 1.893848] [] kernel_init+0x132/0x18b
    [ 1.893848] [] child_rip+0xa/0x20
    [ 1.893848] [] ? restore_args+0x0/0x30
    [ 1.893848] [] ? kernel_init+0x0/0x18b
    [ 1.893848] [] ? child_rip+0x0/0x20
    [ 1.893848] ---[ end trace 7150b3b86da74e1f ]---

    Signed-off-by: Sage Weil
    Signed-off-by: Jens Axboe

    Sage Weil
     

07 Apr, 2009

2 commits


18 Dec, 2007

1 commit


11 Dec, 2007

1 commit


10 Oct, 2007

7 commits


24 Jul, 2007

1 commit

  • Some of the code has been gradually transitioned to using the proper
    struct request_queue, but there's lots left. So do a full sweet of
    the kernel and get rid of this typedef and replace its uses with
    the proper type.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

16 Jul, 2007

2 commits


09 May, 2007

1 commit


02 Mar, 2007

1 commit


15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

03 Oct, 2006

1 commit


03 Jul, 2006

1 commit


01 Jul, 2006

1 commit


27 Jun, 2006

1 commit


29 Mar, 2006

1 commit


19 Mar, 2006

1 commit


04 Feb, 2006

1 commit


10 Jan, 2006

1 commit


09 Jan, 2006

1 commit

  • HDIO_GETGEO is implemented in most block drivers, and all of them have to
    duplicate the code to copy the structure to userspace, as well as getting
    the start sector. This patch moves that to common code [1] and adds a
    ->getgeo method to fill out the raw kernel hd_geometry structure. For many
    drivers this means ->ioctl can go away now.

    [1] the s390 block drivers are odd in this respect. xpram sets ->start
    to 4 always which seems more than odd, and the dasd driver shifts
    the start offset around, probably because of it's non-standard
    sector size.

    Signed-off-by: Christoph Hellwig
    Cc: Jens Axboe
    Cc:
    Cc: Jeff Dike
    Cc: Paolo Giarrusso
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Neil Brown
    Cc: Markus Lidel
    Cc: Russell King
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: James Bottomley
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

11 Sep, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds