<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/md/bcache/btree.c, branch linux-4.7.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-05-24T15:00:45+00:00</updated>
<entry>
<title>bcache: bch_gc_thread() is not freezable</title>
<updated>2016-05-24T15:00:45+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2016-05-24T14:38:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=29e6c57cc78eb7cb8302088061a0721a41ade658'/>
<id>urn:sha1:29e6c57cc78eb7cb8302088061a0721a41ade658</id>
<content type='text'>
bch_gc_thread() doesn't mark itself freezable, so calling try_to_freeze()
in its context is just an expensive no-op.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>bcache: Add a cond_resched() call to gc</title>
<updated>2015-12-31T03:23:06+00:00</updated>
<author>
<name>Kent Overstreet</name>
<email>kmo@daterainc.com</email>
</author>
<published>2015-11-30T01:18:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c5f1e5adf956e3ba82d204c7c141a75da9fa449a'/>
<id>urn:sha1:c5f1e5adf956e3ba82d204c7c141a75da9fa449a</id>
<content type='text'>
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Tested-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
Cc: Kent Overstreet &lt;kmo@daterainc.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>bcache: fix a livelock when we cause a huge number of cache misses</title>
<updated>2015-12-31T03:23:05+00:00</updated>
<author>
<name>Zheng Liu</name>
<email>gnehzuil.liu@gmail.com</email>
</author>
<published>2015-11-30T01:17:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2ef9ccbfcb90cf84bdba320a571b18b05c41101b'/>
<id>urn:sha1:2ef9ccbfcb90cf84bdba320a571b18b05c41101b</id>
<content type='text'>
Subject :	[PATCH v2] bcache: fix a livelock in btree lock
Date :	Wed, 25 Feb 2015 20:32:09 +0800 (02/25/2015 04:32:09 AM)

This commit tries to fix a livelock in bcache.  This livelock might
happen when we causes a huge number of cache misses simultaneously.

When we get a cache miss, bcache will execute the following path.

-&gt;cached_dev_make_request()
  -&gt;cached_dev_read()
    -&gt;cached_lookup()
      -&gt;bch-&gt;btree_map_keys()
        -&gt;btree_root()  &lt;------------------------
          -&gt;bch_btree_map_keys_recurse()        |
            -&gt;cache_lookup_fn()                 |
              -&gt;cached_dev_cache_miss()         |
                -&gt;bch_btree_insert_check_key() -|
                  [If btree-&gt;seq is not equal to seq + 1, we should return
                   EINTR and traverse btree again.]

In bch_btree_insert_check_key() function we first need to check upgrade
flag (op-&gt;lock == -1), and when this flag is true we need to release
read btree-&gt;lock and try to take write btree-&gt;lock.  During taking and
releasing this write lock, btree-&gt;seq will be monotone increased in
order to prevent other threads modify this in cache miss (see btree.h:74).
But if there are some cache misses caused by some requested, we could
meet a livelock because btree-&gt;seq is always changed by others.  Thus no
one can make progress.

This commit will try to take write btree-&gt;lock if it encounters a race
when we traverse btree.  Although it sacrifice the scalability but we
can ensure that only one can modify the btree.

Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Tested-by: Joshua Schmid &lt;jschmid@suse.com&gt;
Tested-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
Cc: Joshua Schmid &lt;jschmid@suse.com&gt;
Cc: Zhu Yanhai &lt;zhu.yanhai@gmail.com&gt;
Cc: Kent Overstreet &lt;kmo@daterainc.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: add a bi_error field to struct bio</title>
<updated>2015-07-29T14:55:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-07-20T13:29:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4246a0b63bd8f56a1469b12eafeb875b1041a451'/>
<id>urn:sha1:4246a0b63bd8f56a1469b12eafeb875b1041a451</id>
<content type='text'>
Currently we have two different ways to signal an I/O error on a BIO:

 (1) by clearing the BIO_UPTODATE flag
 (2) by returning a Linux errno value to the bi_end_io callback

The first one has the drawback of only communicating a single possible
error (-EIO), and the second one has the drawback of not beeing persistent
when bios are queued up, and are not passed along from child to parent
bio in the ever more popular chaining scenario.  Having both mechanisms
available has the additional drawback of utterly confusing driver authors
and introducing bugs where various I/O submitters only deal with one of
them, and the others have to add boilerplate code to deal with both kinds
of error returns.

So add a new bi_error field to store an errno value directly in struct
bio and remove the existing mechanisms to clean all this up.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>bcache: try to set b-&gt;parent properly</title>
<updated>2014-08-04T22:23:04+00:00</updated>
<author>
<name>Slava Pestov</name>
<email>sp@daterainc.com</email>
</author>
<published>2014-07-12T07:22:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2452cc89063a2a6890368f185c4b6d7d8802179e'/>
<id>urn:sha1:2452cc89063a2a6890368f185c4b6d7d8802179e</id>
<content type='text'>
bcache_flash_dev.ktest would reliably crash with 8k and 16k bucket size
before; now it passes.

Change-Id: Ib542232235e39298c3a7548fe52b645cabb823d1
</content>
</entry>
<entry>
<title>bcache: fix use-after-free in btree_gc_coalesce()</title>
<updated>2014-08-04T22:23:04+00:00</updated>
<author>
<name>Slava Pestov</name>
<email>sp@daterainc.com</email>
</author>
<published>2014-07-13T04:53:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=400ffaa2acd72274e2c7293a9724382383bebf3e'/>
<id>urn:sha1:400ffaa2acd72274e2c7293a9724382383bebf3e</id>
<content type='text'>
If we goto out_nocoalesce after we free new_nodes[0], we end up freeing
new_nodes[0] again. This was generating a lockdep warning. The fix is
to set new_nodes[0] to NULL, since the out_nocoalesce path safely
ignores NULL entries in the new_nodes array.

This regression was introduced in 2d7f9531.

Change-Id: I76564d7257800583214376b4bacf236cda90c89c
</content>
</entry>
<entry>
<title>bcache: fix crash in bcache_btree_node_alloc_fail tracepoint</title>
<updated>2014-08-04T22:23:03+00:00</updated>
<author>
<name>Slava Pestov</name>
<email>sp@daterainc.com</email>
</author>
<published>2014-05-23T18:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=913dc33fb2720fb5f979011664294137ddd8b13b'/>
<id>urn:sha1:913dc33fb2720fb5f979011664294137ddd8b13b</id>
<content type='text'>
'b' was NULL.

Change-Id: Icac0fd04afa2d23f213d96d51afd53374e6dd0c0
</content>
</entry>
<entry>
<title>bcache: Allocate bounce buffers with GFP_NOWAIT</title>
<updated>2014-08-04T22:23:03+00:00</updated>
<author>
<name>Kent Overstreet</name>
<email>kmo@daterainc.com</email>
</author>
<published>2014-05-19T15:55:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=501d52a90cbe652b41336c206ff0e95799d5a9b5'/>
<id>urn:sha1:501d52a90cbe652b41336c206ff0e95799d5a9b5</id>
<content type='text'>
There's no point in blocking on these allocations, since our fallback paths will
probably go faster than blocking.

Change-Id: I733ca202c25cb36bde02607a0a60552229a4241c
</content>
</entry>
<entry>
<title>bcache: Make sure to pass GFP_WAIT to mempool_alloc()</title>
<updated>2014-08-04T22:23:03+00:00</updated>
<author>
<name>Kent Overstreet</name>
<email>kmo@daterainc.com</email>
</author>
<published>2014-05-19T15:57:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bcf090e0040e30f8409e6a535a01e6473afb096f'/>
<id>urn:sha1:bcf090e0040e30f8409e6a535a01e6473afb096f</id>
<content type='text'>
this was very wrong - mempool_alloc() only guarantees success with GFP_WAIT.
bcache uses GFP_NOWAIT in various other places where we have a fallback,
circuits must've gotten crossed when writing this code or something.

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
<entry>
<title>bcache: wait for buckets when allocating new btree root</title>
<updated>2014-08-04T22:23:03+00:00</updated>
<author>
<name>Slava Pestov</name>
<email>sp@daterainc.com</email>
</author>
<published>2014-04-22T01:23:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c5aa4a3157b55bdca18dd2a9d9f43314470b6d32'/>
<id>urn:sha1:c5aa4a3157b55bdca18dd2a9d9f43314470b6d32</id>
<content type='text'>
Tested:
- sometimes bcache_tier test would hang on startup with a failure
  to allocate the btree root -- no longer seeing this

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
</feed>
