<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/md/bcache/bset.c, branch linux-6.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.5.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.5.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-09-19T17:12:35Z</updated>
<entry>
<title>bcache: bset: Fix comment typos</title>
<updated>2022-09-19T17:12:35Z</updated>
<author>
<name>Jules Maselbas</name>
<email>jmaselbas@kalray.eu</email>
</author>
<published>2022-09-19T16:16:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=11e529ccea33f24af6b54fe10bb3be9c1c48eddb'/>
<id>urn:sha1:11e529ccea33f24af6b54fe10bb3be9c1c48eddb</id>
<content type='text'>
Remove the redundant word `by`, correct the typo `creaated`.

CC: Kent Overstreet &lt;kent.overstreet@gmail.com&gt;
CC: linux-bcache@vger.kernel.org
Signed-off-by: Jules Maselbas &lt;jmaselbas@kalray.eu&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20220919161647.81238-4-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: Avoid comma separated statements</title>
<updated>2021-02-10T15:06:00Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2021-02-10T05:07:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6751c1e3cff3aa763c760c08862627069a37b50e'/>
<id>urn:sha1:6751c1e3cff3aa763c760c08862627069a37b50e</id>
<content type='text'>
Use semicolons and braces.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: allocate meta data pages as compound pages</title>
<updated>2020-07-25T13:38:19Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2020-07-25T12:00:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5fe48867856367142d91a82f2cbf7a57a24cbb70'/>
<id>urn:sha1:5fe48867856367142d91a82f2cbf7a57a24cbb70</id>
<content type='text'>
There are some meta data of bcache are allocated by multiple pages,
and they are used as bio bv_page for I/Os to the cache device. for
example cache_set-&gt;uuids, cache-&gt;disk_buckets, journal_write-&gt;data,
bset_tree-&gt;data.

For such meta data memory, all the allocated pages should be treated
as a single memory block. Then the memory management and underlying I/O
code can treat them more clearly.

This patch adds __GFP_COMP flag to all the location allocating &gt;0 order
pages for the above mentioned meta data. Then their pages are treated
as compound pages now.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: Convert pr_&lt;level&gt; uses to a more typical style</title>
<updated>2020-05-27T11:19:36Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2020-05-27T04:01:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=46f5aa8806e34f2e48de852cc7db2c74c3a5cd8d'/>
<id>urn:sha1:46f5aa8806e34f2e48de852cc7db2c74c3a5cd8d</id>
<content type='text'>
Remove the trailing newline from the define of pr_fmt and add newlines
to the uses.

Miscellanea:

o Convert bch_bkey_dump from multiple uses of pr_err to pr_cont
  as the earlier conversion was inappropriate done causing multiple
  lines to be emitted where only a single output line was desired
o Use vsprintf extension %pV in bch_cache_set_error to avoid multiple
  line output where only a single line output was desired
o Coalesce formats

Fixes: 6ae63e3501c4 ("bcache: replace printk() by pr_*() routines")

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: add code comments for state-&gt;pool in __btree_sort()</title>
<updated>2020-01-23T18:40:02Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2020-01-23T17:01:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7a0bc2a8966040d54289b64842d55e2cf4343ad9'/>
<id>urn:sha1:7a0bc2a8966040d54289b64842d55e2cf4343ad9</id>
<content type='text'>
To explain the pages allocated from mempool state-&gt;pool can be
swapped in __btree_sort(), because state-&gt;pool is a page pool,
which allocates pages by alloc_pages() indeed.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: don't export symbols</title>
<updated>2019-11-13T22:42:51Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-11-13T08:03:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=15fbb2312f32cf99bd8e0247ac0240c9bce0ba47'/>
<id>urn:sha1:15fbb2312f32cf99bd8e0247ac0240c9bce0ba47</id>
<content type='text'>
None of the exported bcache symbols are actually used anywhere.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: add code comment bch_keylist_pop() and bch_keylist_pop_front()</title>
<updated>2019-11-13T22:42:50Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2019-11-13T08:03:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=06c1526da97dd0022973de3fc41b79b2d431b435'/>
<id>urn:sha1:06c1526da97dd0022973de3fc41b79b2d431b435</id>
<content type='text'>
This patch adds simple code comments for bch_keylist_pop() and
bch_keylist_pop_front() in bset.c, to make the code more easier to
be understand.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: make bset_search_tree() be more understandable</title>
<updated>2019-06-28T13:39:15Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2019-06-28T11:59:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=944a4f340a65c21ee311d2d3e617034bef9d0b25'/>
<id>urn:sha1:944a4f340a65c21ee311d2d3e617034bef9d0b25</id>
<content type='text'>
The purpose of following code in bset_search_tree() is to avoid a branch
instruction,
 994         if (likely(f-&gt;exponent != 127))
 995                 n = j * 2 + (((unsigned int)
 996                               (f-&gt;mantissa -
 997                                bfloat_mantissa(search, f))) &gt;&gt; 31);
 998         else
 999                 n = (bkey_cmp(tree_to_bkey(t, j), search) &gt; 0)
1000                         ? j * 2
1001                         : j * 2 + 1;

This piece of code is not very clear to understand, even when I tried to
add code comment for it, I made mistake. This patch removes the implict
bit operation and uses explicit branch to calculate next location in
binary tree search.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: remove unncessary code in bch_btree_keys_init()</title>
<updated>2019-06-28T13:39:15Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2019-06-28T11:59:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bd9026c8a7f33ebe25543b7b7e6276b49db60f7e'/>
<id>urn:sha1:bd9026c8a7f33ebe25543b7b7e6276b49db60f7e</id>
<content type='text'>
Function bch_btree_keys_init() initializes b-&gt;set[].size and
b-&gt;set[].data to zero. As the code comments indicates, these code indeed
is unncessary, because both struct btree_keys and struct bset_tree are
nested embedded into struct btree, when struct btree is filled with 0
bits by kzalloc() in mca_bucket_alloc(), b-&gt;set[].size and
b-&gt;set[].data are initialized to 0 (a.k.a NULL) already.

This patch removes the redundant code, and add comments in
bch_btree_keys_init() and mca_bucket_alloc() to explain why it's safe.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: remove unnecessary prefetch() in bset_search_tree()</title>
<updated>2019-06-28T13:39:14Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2019-06-28T11:59:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f960facb399ece6ff88a7a2d4b4a5515e3a467a0'/>
<id>urn:sha1:f960facb399ece6ff88a7a2d4b4a5515e3a467a0</id>
<content type='text'>
In function bset_search_tree(), when p &gt;= t-&gt;size, t-&gt;tree[0] will be
prefetched by the following code piece,
 974                 unsigned int p = n &lt;&lt; 4;
 975
 976                 p &amp;= ((int) (p - t-&gt;size)) &gt;&gt; 31;
 977
 978                 prefetch(&amp;t-&gt;tree[p]);

The purpose of the above code is to avoid a branch instruction, but
when p &gt;= t-&gt;size, prefetch(&amp;t-&gt;tree[0]) has no positive performance
contribution at all. This patch avoids the unncessary prefetch by only
calling prefetch() when p &lt; t-&gt;size.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
