04 Aug, 2011

6 commits

  • Fernando found we hit the regular OFF_SLAB 'recursion' before we
    annotate the locks, cure this.

    The relevant portion of the stack-trace:

    > [ 0.000000] [] rt_spin_lock+0x50/0x56
    > [ 0.000000] [] __cache_free+0x43/0xc3
    > [ 0.000000] [] kmem_cache_free+0x6c/0xdc
    > [ 0.000000] [] slab_destroy+0x4f/0x53
    > [ 0.000000] [] free_block+0x94/0xc1
    > [ 0.000000] [] do_tune_cpucache+0x10b/0x2bb
    > [ 0.000000] [] enable_cpucache+0x7b/0xa7
    > [ 0.000000] [] kmem_cache_init_late+0x1f/0x61
    > [ 0.000000] [] start_kernel+0x24c/0x363
    > [ 0.000000] [] i386_start_kernel+0xa9/0xaf

    Reported-by: Fernando Lopez-Lezcano
    Acked-by: Pekka Enberg
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1311888176.2617.379.camel@laptop
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • lockdep_init_map() only initializes parts of lockdep_map and triggers
    kmemcheck warning when it is copied as a whole. There isn't anything
    to be gained by clearing selectively. memset() the whole structure
    and remove loop for ->class_cache[] clearing.

    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=35532

    Signed-off-by: Tejun Heo
    Reported-and-tested-by: Christian Casteyde
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=35532
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110714131909.GJ3455@htj.dyndns.org
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Lockdep thinks there's lock recursion through:

    kmem_cache_free()
    cache_flusharray()
    spin_lock(&l3->list_lock) list_lock) --'

    Now debug objects doesn't use SLAB_DESTROY_BY_RCU and hence there is no
    actual possibility of recursing. Luckily debug objects marks it slab
    with SLAB_DEBUG_OBJECTS so we can identify the thing.

    Mark all SLAB_DEBUG_OBJECTS (all one!) slab caches with a special
    lockdep key so that lockdep sees its a different cachep.

    Also add a WARN on trying to create a SLAB_DESTROY_BY_RCU |
    SLAB_DEBUG_OBJECTS cache, to avoid possible future trouble.

    Reported-and-tested-by: Sebastian Siewior
    [ fixes to the initial patch ]
    Reported-by: Thomas Gleixner
    Acked-by: Pekka Enberg
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1311341165.27400.58.camel@twins
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • On Sun, 2011-07-24 at 21:06 -0400, Arnaud Lacombe wrote:

    > /src/linux/linux/kernel/lockdep.c: In function 'mark_held_locks':
    > /src/linux/linux/kernel/lockdep.c:2471:31: warning: comparison of
    > distinct pointer types lacks a cast

    The warning is harmless in this case, but the below makes it go away.

    Reported-by: Arnaud Lacombe
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1311588599.2617.56.camel@laptop
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Commit dd4e5d3ac4a ("lockdep: Fix trace_[soft,hard]irqs_[on,off]()
    recursion") made a bit of a mess of the various checks and error
    conditions.

    In particular it moved the check for !irqs_disabled() before the
    spurious enable test, resulting in some warnings.

    Reported-by: Arnaud Lacombe
    Reported-by: Dave Jones
    Reported-and-tested-by: Sergey Senozhatsky
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1311679697.24752.28.camel@twins
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Ingo Molnar
     

03 Aug, 2011

7 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (31 commits)
    Btrfs: don't call writepages from within write_full_page
    Btrfs: Remove unused variable 'last_index' in file.c
    Btrfs: clean up for find_first_extent_bit()
    Btrfs: clean up for wait_extent_bit()
    Btrfs: clean up for insert_state()
    Btrfs: remove unused members from struct extent_state
    Btrfs: clean up code for merging extent maps
    Btrfs: clean up code for extent_map lookup
    Btrfs: clean up search_extent_mapping()
    Btrfs: remove redundant code for dir item lookup
    Btrfs: make acl functions really no-op if acl is not enabled
    Btrfs: remove remaining ref-cache code
    Btrfs: remove a BUG_ON() in btrfs_commit_transaction()
    Btrfs: use wait_event()
    Btrfs: check the nodatasum flag when writing compressed files
    Btrfs: copy string correctly in INO_LOOKUP ioctl
    Btrfs: don't print the leaf if we had an error
    btrfs: make btrfs_set_root_node void
    Btrfs: fix oops while writing data to SSD partitions
    Btrfs: Protect the readonly flag of block group
    ...

    Fix up trivial conflicts (due to acl and writeback cleanups) in
    - fs/btrfs/acl.c
    - fs/btrfs/ctree.h
    - fs/btrfs/extent_io.c

    Linus Torvalds
     
  • * 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6:
    MAINTAINERS: Add keyword match for of_match_table to device tree section
    of: constify property name parameters for helper functions
    input: xilinx_ps2: Add missing of_address.h header
    of: address: use resource_size helper

    Linus Torvalds
     
  • * 'spi/next' of git://git.secretlab.ca/git/linux-2.6:
    spi/pl022: remove function cannot exit

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (34 commits)
    dm table: set flush capability based on underlying devices
    dm crypt: optionally support discard requests
    dm raid: add md raid1 support
    dm raid: support metadata devices
    dm raid: add write_mostly parameter
    dm raid: add region_size parameter
    dm raid: improve table parameters documentation
    dm ioctl: forbid multiple device specifiers
    dm ioctl: introduce __get_dev_cell
    dm ioctl: fill in device parameters in more ioctls
    dm flakey: add corrupt_bio_byte feature
    dm flakey: add drop_writes
    dm flakey: support feature args
    dm flakey: use dm_target_offset and support discards
    dm table: share target argument parsing functions
    dm snapshot: skip reading origin when overwriting complete chunk
    dm: ignore merge_bvec for snapshots when safe
    dm table: clean dm_get_device and move exports
    dm raid: tidy includes
    dm ioctl: prevent empty message
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-watchdog:
    watchdog: Cleanup WATCHDOG_CORE help text
    watchdog: Fix POST failure on ASUS P5N32-E SLI and similar boards
    watchdog: shwdt: fix usage of mod_timer

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    ALSA: asihpi - Clarify adapter index validity check
    ALSA: asihpi - Don't leak firmware if mem alloc fails
    ALSA: rtctimer.c needs module.h
    ASoC: Fix txx9aclc.c build
    ALSA: hdspm - Add firmware revision 0xcc for RME MADI
    ALSA: hdspm - Fix reported external sample rate on RME MADI and MADIface
    ALSA: hdspm - Provide MADI speed mode selector on RME MADI and MADIface
    ALSA: sound/core/pcm_compat.c: adjust array index

    Linus Torvalds
     
  • If a patch is working with an of_match_table it's probably adding an OF
    binding to a driver in which case the binding ought to be reviewed by the
    device tree folks to make sure that things like the device matches are set
    up correctly.

    Signed-off-by: Mark Brown
    Signed-off-by: Grant Likely

    Mark Brown
     

02 Aug, 2011

27 commits

  • The helper functions for reading u32 integers, u32 arrays and strings
    should have the property name as a const pointer.

    Cc: Grant Likely
    Signed-off-by: Jamie Iles
    Signed-off-by: Grant Likely

    Jamie Iles
     
  • The remove function in the PL022 driver cannot abort the remove
    function any way, so restructure the code so as not to make that
    assumption. Remove will now proceed no matter whether it can
    stop the transfer queue or not.

    Reported-by: Russell King
    Signed-off-by: Linus Walleij
    Signed-off-by: Grant Likely

    Linus Walleij
     
  • DM has always advertised both REQ_FLUSH and REQ_FUA flush capabilities
    regardless of whether or not a given DM device's underlying devices
    also advertised a need for them.

    Block's flush-merge changes from 2.6.39 have proven to be more costly
    for DM devices. Performance regressions have been reported even when
    DM's underlying devices do not advertise that they have a write cache.

    Fix the performance regressions by configuring a DM device's flushing
    capabilities based on those of the underlying devices' capabilities.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • Add optional parameter field to dmcrypt table and support
    "allow_discards" option.

    Discard requests bypass crypt queue processing. Bio is simple remapped
    to underlying device.

    Note that discard will be never enabled by default because of security
    consequences. It is up to the administrator to enable it for encrypted
    devices.

    (Note that userspace cryptsetup does not understand new optional
    parameters yet. Support for this will come later. Until then, you
    should use 'dmsetup' to enable and disable this.)

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Milan Broz
     
  • Support the MD RAID1 personality through dm-raid.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Jonathan Brassow
     
  • Add the ability to parse and use metadata devices to dm-raid. Although
    not strictly required, without the metadata devices, many features of
    RAID are unavailable. They are used to store a superblock and bitmap.

    The role, or position in the array, of each device must be recorded in
    its superblock. This is to help with fault handling, array reshaping,
    and sanity checks. RAID 4/5/6 devices must be loaded in a specific order:
    in this way, the 'array_position' field helps validate the correctness
    of the mapping when it is loaded. It can be used during reshaping to
    identify which devices are added/removed. Fault handling is impossible
    without this field. For example, when a device fails it is recorded in
    the superblock. If this is a RAID1 device and the offending device is
    removed from the array, there must be a way during subsequent array
    assembly to determine that the failed device was the one removed. This
    is done by correlating the 'array_position' field and the bit-field
    variable 'failed_devices'.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Jonathan Brassow
     
  • Add the write_mostly parameter to RAID1 dm-raid tables.

    This allows the user to set the WriteMostly flag on a RAID1 device that
    should normally be avoided for read I/O.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Jonathan Brassow
     
  • Allow the user to specify the region_size.

    Ensures that the supplied value meets md's constraints, viz. the number of
    regions does not exceed 2^21.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Jonathan Brassow
     
  • Add more information about some dm-raid table parameters and clarify how
    parameters are printed when 'dmsetup table' is issued.

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Jonathan Brassow
     
  • Exactly one of name, uuid or device must be specified when referencing
    an existing device. This removes the ambiguity (risking the wrong
    device being updated) if two conflicting parameters were specified.
    Previously one parameter got used and any others were ignored silently.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Move logic to find device based on major/minor number to a separate
    function __get_dev_cell (similar to __get_uuid_cell and __get_name_cell).
    This makes the function __find_device_hash_cell more straightforward.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Move parameter filling from find_device to __find_device_hash_cell.

    This patch causes ioctls using __find_device_hash_cell
    (DM_DEV_REMOVE_CMD, DM_DEV_SUSPEND_CMD - resume, DM_TABLE_CLEAR_CMD)
    to return device parameters, bringing them into line with the other
    ioctls.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Add corrupt_bio_byte feature to simulate corruption by overwriting a byte at a
    specified position with a specified value during intervals when the device is
    "down".

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • Add 'drop_writes' option to drop writes silently while the
    device is 'down'. Reads are not touched.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • Add the ability to specify arbitrary feature flags when creating a
    flakey target. This code uses the same target argument helpers that
    the multipath target does.

    Also remove the superfluous 'dm-flakey' prefixes from the error messages,
    as they already contain the prefix 'flakey'.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • Use dm_target_offset() and support discards.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • Move multipath target argument parsing code into dm-table so other
    targets can share it.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • If we write a full chunk in the snapshot, skip reading the origin device
    because the whole chunk will be overwritten anyway.

    This patch changes the snapshot write logic when a full chunk is written.
    In this case:
    1. allocate the exception
    2. dispatch the bio (but don't report the bio completion to device mapper)
    3. write the exception record
    4. report bio completed

    Callbacks must be done through the kcopyd thread, because callbacks must not
    race with each other. So we create two new functions:

    dm_kcopyd_prepare_callback: allocate a job structure and prepare the callback.
    (This function must not be called from interrupt context.)

    dm_kcopyd_do_callback: submit callback.
    (This function may be called from interrupt context.)

    Performance test (on snapshots with 4k chunk size):
    without the patch:
    non-direct-io sequential write (dd): 17.7MB/s
    direct-io sequential write (dd): 20.9MB/s
    non-direct-io random write (mkfs.ext2): 0.44s

    with the patch:
    non-direct-io sequential write (dd): 26.5MB/s
    direct-io sequential write (dd): 33.2MB/s
    non-direct-io random write (mkfs.ext2): 0.27s

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Add a new flag DMF_MERGE_IS_OPTIONAL to struct mapped_device to indicate
    whether the device can accept bios larger than the size its merge
    function returns. When set, use this to send large bios to snapshots
    which can split them if necessary. Snapshot I/O may be significantly
    fragmented and this approach seems to improve peformance.

    Before the patch, dm_set_device_limits restricted bio size to page size
    if the underlying device had a merge function and the target didn't
    provide a merge function. After the patch, dm_set_device_limits
    restricts bio size to page size if the underlying device has a merge
    function, doesn't have DMF_MERGE_IS_OPTIONAL flag and the target doesn't
    provide a merge function.

    The snapshot target can't provide a merge function because when the merge
    function is called, it is impossible to determine where the bio will be
    remapped. Previously this led us to impose a 4k limit, which we can
    now remove if the snapshot store is located on a device without a merge
    function. Together with another patch for optimizing full chunk writes,
    it improves performance from 29MB/s to 40MB/s when writing to the
    filesystem on snapshot store.

    If the snapshot store is placed on a non-dm device with a merge function
    (such as md-raid), device mapper still limits all bios to page size.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • There is no need for __table_get_device to be factored out.
    Also move the exports to the end of their respective functions.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • A dm target only needs to use include/linux dm headers.

    Signed-off-by: Alasdair G Kergon

    Alasdair G Kergon
     
  • Detect invalid empty messages in core dm instead of requiring every target to
    check this.

    Signed-off-by: Alasdair G Kergon

    Alasdair G Kergon
     
  • Re-order the parameters so they are handled consistently in the same order
    where defined, parsed and output.

    Only include rebuild parameters in the STATUSTYPE_TABLE output if they were
    supplied in the original table line.

    Correct the parameter count when outputting rebuild: there are two words,
    not one.

    Use case-independent checks for keywords (as in other device-mapper targets).

    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Jonathan Brassow
     
  • Coding style cleanups.

    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Jonathan Brassow

    Jonathan Brassow
     
  • Remove a couple of unused #defines.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • The nr_pages field in struct kcopyd_job is only used temporarily in
    run_pages_job() to count the number of required pages.
    We can use a local variable instead.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • The offset field in struct kcopyd_job is always zero so remove it.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka