Skip to content
  1. May 23, 2011
    • liubo's avatar
      Btrfs: do not flush csum items of unchanged file data during treelog · 8e531cdf
      liubo authored
      
      
      The current code relogs the entire inode every time during fsync log,
      and it is much better suited to small files rather than large ones.
      
      During my performance test, the fsync performace of large files sucks,
      and we can ascribe this to the tremendous amount of csum infos of the
      large ones, cause we have to flush all of these csum infos into log trees
      even when there are only _one_ change in the whole file data.  Apparently,
      to optimize fsync, we need to create a filter to skip the unnecessary csum
      ones, that is, the corresponding file data remains unchanged before this fsync.
      
      Here I have some test results to show, I use sysbench to do "random write + fsync".
      
      ===
      sysbench --test=fileio --num-threads=1 --file-num=2 --file-block-size=4K --file-total-size=8G --file-test-mode=rndwr --file-io-mode=sync --file-extra-flags=  [prepare, run]
      ===
      
      Sysbench args:
        - Number of threads: 1
        - Extra file open flags: 0
        - 2 files, 4Gb each
        - Block size 4Kb
        - Number of random requests for random IO: 10000
        - Read/Write ratio for combined random IO test: 1.50
        - Periodic FSYNC enabled, calling fsync() each 100 requests.
        - Calling fsync() at the end of test, Enabled.
        - Using synchronous I/O mode
        - Doing random write test
      
      Sysbench results:
      ===
         Operations performed:  0 Read, 10000 Write, 200 Other = 10200 Total
         Read 0b  Written 39.062Mb  Total transferred 39.062Mb
      ===
      a) without patch:  (*SPEED* : 451.01Kb/sec)
         112.75 Requests/sec executed
      
      b) with patch:     (*SPEED* : 4.7533Mb/sec)
         1216.84 Requests/sec executed
      
      PS: I've made a _sub transid_ stuff patch, but it does not perform as effectively as this patch,
      and I'm wanderring where the problem is and trying to improve it more.
      
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      8e531cdf
    • Chris Mason's avatar
      Merge branch 'for-chris' of... · 71267333
      Chris Mason authored
      
      Merge branch 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/arne/btrfs-unstable-arne into inode_numbers
      
      Conflicts:
      	fs/btrfs/Makefile
      	fs/btrfs/ctree.h
      	fs/btrfs/volumes.h
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      71267333
    • Chris Mason's avatar
      Merge branch 'allocator' of... · aa2dfb37
      Chris Mason authored
      
      Merge branch 'allocator' of git://git.kernel.org/pub/scm/linux/kernel/git/arne/btrfs-unstable-arne into inode_numbers
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      aa2dfb37
    • Chris Mason's avatar
      Merge branch 'cleanups' of git://repo.or.cz/linux-2.6/btrfs-unstable into inode_numbers · 945d8962
      Chris Mason authored
      
      
      Conflicts:
      	fs/btrfs/extent-tree.c
      	fs/btrfs/free-space-cache.c
      	fs/btrfs/inode.c
      	fs/btrfs/tree-log.c
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      945d8962
  2. May 22, 2011
  3. May 21, 2011
    • Miao Xie's avatar
      btrfs: implement delayed inode items operation · 16cdcec7
      Miao Xie authored
      
      
      Changelog V5 -> V6:
      - Fix oom when the memory load is high, by storing the delayed nodes into the
        root's radix tree, and letting btrfs inodes go.
      
      Changelog V4 -> V5:
      - Fix the race on adding the delayed node to the inode, which is spotted by
        Chris Mason.
      - Merge Chris Mason's incremental patch into this patch.
      - Fix deadlock between readdir() and memory fault, which is reported by
        Itaru Kitayama.
      
      Changelog V3 -> V4:
      - Fix nested lock, which is reported by Itaru Kitayama, by updating space cache
        inode in time.
      
      Changelog V2 -> V3:
      - Fix the race between the delayed worker and the task which does delayed items
        balance, which is reported by Tsutomu Itoh.
      - Modify the patch address David Sterba's comment.
      - Fix the bug of the cpu recursion spinlock, reported by Chris Mason
      
      Changelog V1 -> V2:
      - break up the global rb-tree, use a list to manage the delayed nodes,
        which is created for every directory and file, and used to manage the
        delayed directory name index items and the delayed inode item.
      - introduce a worker to deal with the delayed nodes.
      
      Compare with Ext3/4, the performance of file creation and deletion on btrfs
      is very poor. the reason is that btrfs must do a lot of b+ tree insertions,
      such as inode item, directory name item, directory name index and so on.
      
      If we can do some delayed b+ tree insertion or deletion, we can improve the
      performance, so we made this patch which implemented delayed directory name
      index insertion/deletion and delayed inode update.
      
      Implementation:
      - introduce a delayed root object into the filesystem, that use two lists to
        manage the delayed nodes which are created for every file/directory.
        One is used to manage all the delayed nodes that have delayed items. And the
        other is used to manage the delayed nodes which is waiting to be dealt with
        by the work thread.
      - Every delayed node has two rb-tree, one is used to manage the directory name
        index which is going to be inserted into b+ tree, and the other is used to
        manage the directory name index which is going to be deleted from b+ tree.
      - introduce a worker to deal with the delayed operation. This worker is used
        to deal with the works of the delayed directory name index items insertion
        and deletion and the delayed inode update.
        When the delayed items is beyond the lower limit, we create works for some
        delayed nodes and insert them into the work queue of the worker, and then
        go back.
        When the delayed items is beyond the upper bound, we create works for all
        the delayed nodes that haven't been dealt with, and insert them into the work
        queue of the worker, and then wait for that the untreated items is below some
        threshold value.
      - When we want to insert a directory name index into b+ tree, we just add the
        information into the delayed inserting rb-tree.
        And then we check the number of the delayed items and do delayed items
        balance. (The balance policy is above.)
      - When we want to delete a directory name index from the b+ tree, we search it
        in the inserting rb-tree at first. If we look it up, just drop it. If not,
        add the key of it into the delayed deleting rb-tree.
        Similar to the delayed inserting rb-tree, we also check the number of the
        delayed items and do delayed items balance.
        (The same to inserting manipulation)
      - When we want to update the metadata of some inode, we cached the data of the
        inode into the delayed node. the worker will flush it into the b+ tree after
        dealing with the delayed insertion and deletion.
      - We will move the delayed node to the tail of the list after we access the
        delayed node, By this way, we can cache more delayed items and merge more
        inode updates.
      - If we want to commit transaction, we will deal with all the delayed node.
      - the delayed node will be freed when we free the btrfs inode.
      - Before we log the inode items, we commit all the directory name index items
        and the delayed inode update.
      
      I did a quick test by the benchmark tool[1] and found we can improve the
      performance of file creation by ~15%, and file deletion by ~20%.
      
      Before applying this patch:
      Create files:
              Total files: 50000
              Total time: 1.096108
              Average time: 0.000022
      Delete files:
              Total files: 50000
              Total time: 1.510403
              Average time: 0.000030
      
      After applying this patch:
      Create files:
              Total files: 50000
              Total time: 0.932899
              Average time: 0.000019
      Delete files:
              Total files: 50000
              Total time: 1.215732
              Average time: 0.000024
      
      [1] http://marc.info/?l=linux-btrfs&m=128212635122920&q=p3
      
      Many thanks for Kitayama-san's help!
      
      Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
      Reviewed-by: default avatarDavid Sterba <dave@jikos.cz>
      Tested-by: default avatarTsutomu Itoh <t-itoh@jp.fujitsu.com>
      Tested-by: default avatarItaru Kitayama <kitayama@cl.bb4u.ne.jp>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      16cdcec7
    • Chris Mason's avatar
      Merge branch 'ino-alloc' of git://repo.or.cz/linux-btrfs-devel into inode_numbers · 09655373
      Chris Mason authored
      
      
      Conflicts:
      	fs/btrfs/free-space-cache.c
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      09655373
  4. May 19, 2011
    • Linus Torvalds's avatar
      Linux 2.6.39 · 61c4f2c8
      Linus Torvalds authored
      v2.6.39
      61c4f2c8
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2 · 3f80fbff
      Linus Torvalds authored
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
        configfs: Fix race between configfs_readdir() and configfs_d_iput()
        configfs: Don't try to d_delete() negative dentries.
        ocfs2/dlm: Target node death during resource migration leads to thread spin
        ocfs2: Skip mount recovery for hard-ro mounts
        ocfs2/cluster: Heartbeat mismatch message improved
        ocfs2/cluster: Increase the live threshold for global heartbeat
        ocfs2/dlm: Use negotiated o2dlm protocol version
        ocfs2: skip existing hole when removing the last extent_rec in punching-hole codes.
        ocfs2: Initialize data_ac (might be used uninitialized)
      3f80fbff
    • Linus Torvalds's avatar
      Merge branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6 · fce51958
      Linus Torvalds authored
      * 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6:
        drivercore: revert addition of of_match to struct device
        of: fix race when matching drivers
      fce51958
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus · 7103dbed
      Linus Torvalds authored
      * 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus:
        MIPS: Kludge IP27 build for 2.6.39.
        MIPS: AR7: Fix GPIO register size for Titan variant.
        MIPS: Fix duplicate invocation of notify_die.
        MIPS: RB532: Fix iomap resource size miscalculation.
      7103dbed
    • Grant Likely's avatar
      drivercore: revert addition of of_match to struct device · b1608d69
      Grant Likely authored
      Commit b826291c
      
      , "drivercore/dt: add a match table pointer to struct
      device" added an of_match pointer to struct device to cache the
      of_match_table entry discovered at driver match time.  This was unsafe
      because matching is not an atomic operation with probing a driver.  If
      two or more drivers are attempted to be matched to a driver at the
      same time, then the cached matching entry pointer could get
      overwritten.
      
      This patch reverts the of_match cache pointer and reworks all users to
      call of_match_device() directly instead.
      
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      b1608d69
    • Milton Miller's avatar
      of: fix race when matching drivers · 01294d82
      Milton Miller authored
      
      
      If two drivers are probing devices at the same time, both will write
      their match table result to the dev->of_match cache at the same time.
      
      Only write the result if the device matches.
      
      In a thread titled "SBus devices sometimes detected, sometimes not",
      Meelis reported his SBus hme was not detected about 50% of the time.
      From the debug suggested by Grant it was obvious another driver matched
      some devices between the call to match the hme and the hme discovery
      failling.
      
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
      [grant.likely: modified to only call of_match_device() once]
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      01294d82
  5. May 18, 2011
  6. May 17, 2011
    • Linus Torvalds's avatar
      Merge branch 'timers-fixes-for-linus' of... · a085963a
      Linus Torvalds authored
      Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        tick: Clear broadcast active bit when switching to oneshot
        rtc: mc13xxx: Don't call rtc_device_register while holding lock
        rtc: rp5c01: Initialize drvdata before registering device
        rtc: pcap: Initialize drvdata before registering device
        rtc: msm6242: Initialize drvdata before registering device
        rtc: max8998: Initialize drvdata before registering device
        rtc: max8925: Initialize drvdata before registering device
        rtc: m41t80: Initialize clientdata before registering device
        rtc: ds1286: Initialize drvdata before registering device
        rtc: ep93xx: Initialize drvdata before registering device
        rtc: davinci: Initialize drvdata before registering device
        rtc: mxc: Initialize drvdata before registering device
        clocksource: Install completely before selecting
      a085963a
    • Borislav Petkov's avatar
      x86, AMD: Fix ARAT feature setting again · 14fb57dc
      Borislav Petkov authored
      
      
      Trying to enable the local APIC timer on early K8 revisions
      uncovers a number of other issues with it, in conjunction with
      the C1E enter path on AMD. Fixing those causes much more churn
      and troubles than the benefit of using that timer brings so
      don't enable it on K8 at all, falling back to the original
      functionality the kernel had wrt to that.
      
      Reported-and-bisected-by: default avatarNick Bowler <nbowler@elliptictech.com>
      Cc: Boris Ostrovsky <Boris.Ostrovsky@amd.com>
      Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
      Cc: Greg Kroah-Hartman <greg@kroah.com>
      Cc: Hans Rosenfeld <hans.rosenfeld@amd.com>
      Cc: Nick Bowler <nbowler@elliptictech.com>
      Cc: Joerg-Volker-Peetz <jvpeetz@web.de>
      Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
      Link: http://lkml.kernel.org/r/1305636919-31165-3-git-send-email-bp@amd64.org
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      14fb57dc
    • Borislav Petkov's avatar
      Revert "x86, AMD: Fix APIC timer erratum 400 affecting K8 Rev.A-E processors" · 328935e6
      Borislav Petkov authored
      This reverts commit e20a2d20
      
      , as it crashes
      certain boxes with specific AMD CPU models.
      
      Moving the lower endpoint of the Erratum 400 check to accomodate
      earlier K8 revisions (A-E) opens a can of worms which is simply
      not worth to fix properly by tweaking the errata checking
      framework:
      
      * missing IntPenging MSR on revisions < CG cause #GP:
      
      http://marc.info/?l=linux-kernel&m=130541471818831
      
      * makes earlier revisions use the LAPIC timer instead of the C1E
      idle routine which switches to HPET, thus not waking up in
      deeper C-states:
      
      http://lkml.org/lkml/2011/4/24/20
      
      Therefore, leave the original boundary starting with K8-revF.
      
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      328935e6
    • Jens Axboe's avatar
      scsi: remove performance regression due to async queue run · 9937a5e2
      Jens Axboe authored
      Commit c21e6beb
      
       removed our queue request_fn re-enter
      protection, and defaulted to always running the queues from
      kblockd to be safe. This was a known potential slow down,
      but should be safe.
      
      Unfortunately this is causing big performance regressions for
      some, so we need to improve this logic. Looking into the details
      of the re-enter, the real issue is on requeue of requests.
      
      Requeue of requests upon seeing a BUSY condition from the device
      ends up re-running the queue, causing traces like this:
      
      scsi_request_fn()
              scsi_dispatch_cmd()
                      scsi_queue_insert()
                              __scsi_queue_insert()
                                      scsi_run_queue()
      					scsi_request_fn()
      						...
      
      potentially causing the issue we want to avoid. So special
      case the requeue re-run of the queue, but improve it to offload
      the entire run of local queue and starved queue from a single
      workqueue callback. This is a lot better than potentially
      kicking off a workqueue run for each device seen.
      
      This also fixes the issue of the local device going into recursion,
      since the above mentioned commit never moved that queue run out
      of line.
      
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      9937a5e2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · c1d10d18
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
        net: Change netdev_fix_features messages loglevel
        vmxnet3: Fix inconsistent LRO state after initialization
        sfc: Fix oops in register dump after mapping change
        IPVS: fix netns if reading ip_vs_* procfs entries
        bridge: fix forwarding of IPv6
      c1d10d18
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 477de0de
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        Revert "mmc: fix a race between card-detect rescan and clock-gate work instances"
      477de0de
    • Randy Dunlap's avatar
      mm: fix kernel-doc warning in page_alloc.c · b5e6ab58
      Randy Dunlap authored
      
      
      Fix new kernel-doc warning in mm/page_alloc.c:
      
        Warning(mm/page_alloc.c:2370): No description found for parameter 'nid'
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b5e6ab58