1. 09 1月, 2014 19 次提交
  2. 11 11月, 2013 12 次提交
    • K
      bcache: Delete some slower inline asm · 098fb254
      Kent Overstreet 提交于
      Never saw a profile of bset_search_tree() where it wasn't bottlenecked
      on memory until I got my new Haswell machine, but when I tried it there
      it was suddenly burning 20% of the cpu in the inner loop on shrd...
      
      Turns out, the version of shrd that takes 64 bit operands has a 9 cycle
      latency. hah.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      098fb254
    • K
      bcache: Move spinlock into struct time_stats · 65d22e91
      Kent Overstreet 提交于
      Minor cleanup.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      65d22e91
    • K
      bcache: Kill bch_next_recurse_key() · 50310164
      Kent Overstreet 提交于
      This dates from before the btree iterator, and now it's finally gone
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      50310164
    • K
      bcache: bch_(btree|extent)_ptr_invalid() · d5cc66e9
      Kent Overstreet 提交于
      Trying to treat btree pointers and leaf node pointers the same way was a
      mistake - going to start being more explicit about the type of
      key/pointer we're dealing with. This is the first part of that
      refactoring; this patch shouldn't change any actual behaviour.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      d5cc66e9
    • K
      bcache: Debug code improvements · 280481d0
      Kent Overstreet 提交于
      Couple changes:
       * Consolidate bch_check_keys() and bch_check_key_order(), and move the
         checks that only check_key_order() could do to bch_btree_iter_next().
      
       * Get rid of CONFIG_BCACHE_EDEBUG - now, all that code is compiled in
         when CONFIG_BCACHE_DEBUG is enabled, and there's now a sysfs file to
         flip on the EDEBUG checks at runtime.
      
       * Dropped an old not terribly useful check in rw_unlock(), and
         refactored/improved a some of the other debug code.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      280481d0
    • K
      bcache: Fix bch_ptr_bad() · e58ff155
      Kent Overstreet 提交于
      Previously, bch_ptr_bad() could return false when there was a pointer to
      a nonexistant device... it only filtered out keys with PTR_CHECK_DEV
      pointers.
      
      This behaviour was intended for multiple cache device support; for that,
      just because the device for one of the pointers has gone away doesn't
      mean we want to filter out the rest of the pointers.
      
      But we don't yet explicitly filter/check individual pointers, so without
      that this behaviour was wrong - a corrupt bkey with a bad device pointer
      could cause us to deref a bad pointer. Doh.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      e58ff155
    • K
      bcache: Pull on disk data structures out into a separate header · 81ab4190
      Kent Overstreet 提交于
      Now, the on disk data structures are in a header that can be exported to
      userspace - and having them all centralized is nice too.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      81ab4190
    • K
      bcache: Kill op->cl · b54d6934
      Kent Overstreet 提交于
      This isn't used for waiting asynchronously anymore - so this is a fairly
      trivial refactoring.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      b54d6934
    • K
      bcache: Prune struct btree_op · c18536a7
      Kent Overstreet 提交于
      Eventual goal is for struct btree_op to contain only what is necessary
      for traversing the btree.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      c18536a7
    • K
      bcache: Add btree_map() functions · 48dad8ba
      Kent Overstreet 提交于
      Lots of stuff has been open coding its own btree traversal - which is
      generally pretty simple code, but there are a few subtleties.
      
      This adds new new functions, bch_btree_map_nodes() and
      bch_btree_map_keys(), which do the traversal for you. Everything that's
      open coding btree traversal now (with the exception of garbage
      collection) is slowly going to be converted to these two functions;
      being able to write other code at a higher level of abstraction  is a
      big improvement w.r.t. overall code quality.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      48dad8ba
    • K
      bcache: Clean up keylist code · c2f95ae2
      Kent Overstreet 提交于
      More random refactoring.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      c2f95ae2
    • K
      bcache: Add btree_insert_node() · 26c949f8
      Kent Overstreet 提交于
      The flow of control in the old btree insertion code was rather -
      backwards; we'd recurse down the btree (in btree_insert_recurse()), and
      then if we needed to split the keys to be inserted into the parent node
      would be effectively returned up to btree_insert_recurse(), which would
      notice there was more work to do and finish the insertion.
      
      The main problem with this was that the full logic for btree insertion
      could only be used by calling btree_insert_recurse; if you'd gotten to a
      btree leaf some other way and had a key to insert, if it turned out that
      node needed to be split you were SOL.
      
      This inverts the flow of control so btree_insert_node() does _full_
      btree insertion, including splitting - and takes a (leaf) btree node to
      insert into as a parameter.
      
      This means we can now _correctly_ handle cache misses - for cache
      misses, we need to insert a fake "check" key into the btree when we
      discover we have a cache miss - while we still have the btree locked.
      Previously, if the btree node was full inserting a cache miss would just
      fail.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      26c949f8
  3. 25 9月, 2013 1 次提交
  4. 27 6月, 2013 2 次提交
  5. 18 6月, 2013 1 次提交
  6. 09 4月, 2013 2 次提交
  7. 29 3月, 2013 1 次提交
  8. 26 3月, 2013 2 次提交
    • K
      bcache: Style/checkpatch fixes · b1a67b0f
      Kent Overstreet 提交于
      Took out some nested functions, and fixed some more checkpatch
      complaints.
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: linux-bcache@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b1a67b0f
    • K
      bcache: Build fixes from test robot · 07e86ccb
      Kent Overstreet 提交于
      config: make ARCH=i386 allmodconfig
      
      All error/warnings:
      
         drivers/md/bcache/bset.c: In function 'bch_ptr_bad':
      >> drivers/md/bcache/bset.c:164:2: warning: format '%li' expects argument of type 'long int', but argument 4 has type 'size_t' [-Wformat]
      --
         drivers/md/bcache/debug.c: In function 'bch_pbtree':
      >> drivers/md/bcache/debug.c:86:4: warning: format '%li' expects argument of type 'long int', but argument 4 has type 'size_t' [-Wformat]
      --
         drivers/md/bcache/btree.c: In function 'bch_btree_read_done':
      >> drivers/md/bcache/btree.c:245:8: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Wformat]
      --
         drivers/md/bcache/closure.o: In function `closure_debug_init':
      >> (.init.text+0x0): multiple definition of `init_module'
      >> drivers/md/bcache/super.o:super.c:(.init.text+0x0): first defined here
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: linux-bcache@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      07e86ccb