<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/md/bcache/bcache.h, 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>2023-06-15T13:30:11Z</updated>
<entry>
<title>bcache: make kobj_type structures constant</title>
<updated>2023-06-15T13:30:11Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2023-06-15T12:12:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b98dd0b0a596fdeaca68396ce8f782883ed253a9'/>
<id>urn:sha1:b98dd0b0a596fdeaca68396ce8f782883ed253a9</id>
<content type='text'>
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definitions to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20230615121223.22502-3-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: replace fmode_t with a block-specific type for block open flags</title>
<updated>2023-06-12T14:04:05Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2023-06-08T11:02:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=05bdb9965305bbfdae79b31d22df03d1e2cfcb22'/>
<id>urn:sha1:05bdb9965305bbfdae79b31d22df03d1e2cfcb22</id>
<content type='text'>
The only overlap between the block open flags mapped into the fmode_t and
other uses of fmode_t are FMODE_READ and FMODE_WRITE.  Define a new
blk_mode_t instead for use in blkdev_get_by_{dev,path}, -&gt;open and
-&gt;ioctl and stop abusing fmode_t.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;		[rnbd]
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Christian Brauner &lt;brauner@kernel.org&gt;
Link: https://lore.kernel.org/r/20230608110258.189493-28-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache:: fix repeated words in comments</title>
<updated>2022-09-19T17:12:35Z</updated>
<author>
<name>Jilin Yuan</name>
<email>yuanjilin@cdjrlc.com</email>
</author>
<published>2022-09-19T16:16:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6dd3be6923eec2c49860e7292e4e2783c74a9dff'/>
<id>urn:sha1:6dd3be6923eec2c49860e7292e4e2783c74a9dff</id>
<content type='text'>
Delete the redundant word 'we'.

Signed-off-by: Jilin Yuan &lt;yuanjilin@cdjrlc.com&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20220919161647.81238-5-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: avoid unnecessary soft lockup in kworker update_writeback_rate()</title>
<updated>2022-05-28T12:48:26Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2022-05-28T12:45:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a1a2d8f0162b27e85e7ce0ae6a35c96a490e0559'/>
<id>urn:sha1:a1a2d8f0162b27e85e7ce0ae6a35c96a490e0559</id>
<content type='text'>
The kworker routine update_writeback_rate() is schedued to update the
writeback rate in every 5 seconds by default. Before calling
__update_writeback_rate() to do real job, semaphore dc-&gt;writeback_lock
should be held by the kworker routine.

At the same time, bcache writeback thread routine bch_writeback_thread()
also needs to hold dc-&gt;writeback_lock before flushing dirty data back
into the backing device. If the dirty data set is large, it might be
very long time for bch_writeback_thread() to scan all dirty buckets and
releases dc-&gt;writeback_lock. In such case update_writeback_rate() can be
starved for long enough time so that kernel reports a soft lockup warn-
ing started like:
  watchdog: BUG: soft lockup - CPU#246 stuck for 23s! [kworker/246:31:179713]

Such soft lockup condition is unnecessary, because after the writeback
thread finishes its job and releases dc-&gt;writeback_lock, the kworker
update_writeback_rate() may continue to work and everything is fine
indeed.

This patch avoids the unnecessary soft lockup by the following method,
- Add new member to struct cached_dev
  - dc-&gt;rate_update_retry (0 by default)
- In update_writeback_rate() call down_read_trylock(&amp;dc-&gt;writeback_lock)
  firstly, if it fails then lock contention happens.
- If dc-&gt;rate_update_retry &lt;= BCH_WBRATE_UPDATE_MAX_SKIPS (15), doesn't
  acquire the lock and reschedules the kworker for next try.
- If dc-&gt;rate_update_retry &gt; BCH_WBRATE_UPDATE_MAX_SKIPS, no retry
  anymore and call down_read(&amp;dc-&gt;writeback_lock) to wait for the lock.

By the above method, at worst case update_writeback_rate() may retry for
1+ minutes before blocking on dc-&gt;writeback_lock by calling down_read().
For a 4TB cache device with 1TB dirty data, 90%+ of the unnecessary soft
lockup warning message can be avoided.

When retrying to acquire dc-&gt;writeback_lock in update_writeback_rate(),
of course the writeback rate cannot be updated. It is fair, because when
the kworker is blocked on the lock contention of dc-&gt;writeback_lock, the
writeback rate cannot be updated neither.

This change follows Jens Axboe's suggestion to a more clear and simple
version.

Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20220528124550.32834-2-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: move uapi header bcache.h to bcache code directory</title>
<updated>2021-10-29T12:43:21Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2021-10-29T06:09:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cf2197ca4b8c199d188593ca6800ea1827c42171'/>
<id>urn:sha1:cf2197ca4b8c199d188593ca6800ea1827c42171</id>
<content type='text'>
The header file include/uapi/linux/bcache.h is not really a user space
API heaer. This file defines the ondisk format of bcache internal meta
data but no one includes it from user space, bcache-tools has its own
copy of this header with minor modification.

Therefore, this patch moves include/uapi/linux/bcache.h to bcache code
directory as drivers/md/bcache/bcache_ondisk.h.

Suggested-by: Arnd Bergmann &lt;arnd@kernel.org&gt;
Suggested-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20211029060930.119923-2-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: remove the backing_dev_name field from struct cached_dev</title>
<updated>2021-10-20T14:40:54Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-20T14:38:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0f5cd7815f7f4bb1dd340a9aeb9b9d6a7c7eec22'/>
<id>urn:sha1:0f5cd7815f7f4bb1dd340a9aeb9b9d6a7c7eec22</id>
<content type='text'>
Just use the %pg format specifier to print the name directly.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20211020143812.6403-7-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: remove the cache_dev_name field from struct cache</title>
<updated>2021-10-20T14:40:54Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-10-20T14:38:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7e84c2150731faec088ebfe33459f61d118b2497'/>
<id>urn:sha1:7e84c2150731faec088ebfe33459f61d118b2497</id>
<content type='text'>
Just use the %pg format specifier to print the name directly.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20211020143812.6403-6-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: remove bcache device self-defined readahead</title>
<updated>2021-06-08T21:06:03Z</updated>
<author>
<name>Coly Li</name>
<email>colyli@suse.de</email>
</author>
<published>2021-06-07T12:50:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1616a4c2ab1a80893b6890ae93da40a2b1d0c691'/>
<id>urn:sha1:1616a4c2ab1a80893b6890ae93da40a2b1d0c691</id>
<content type='text'>
For read cache missing, bcache defines a readahead size for the read I/O
request to the backing device for the missing data. This readahead size
is initialized to 0, and almost no one uses it to avoid unnecessary read
amplifying onto backing device and write amplifying onto cache device.
Considering upper layer file system code has readahead logic allready
and works fine with readahead_cache_policy sysfile interface, we don't
have to keep bcache self-defined readahead anymore.

This patch removes the bcache self-defined readahead for cache missing
request for backing device, and the readahead sysfs file interfaces are
removed as well.

This is the preparation for next patch to fix potential kernel panic due
to oversized request in a simpler method.

Reported-by: Alexander Ullrich &lt;ealex1979@gmail.com&gt;
Reported-by: Diego Ercolani &lt;diego.ercolani@gmail.com&gt;
Reported-by: Jan Szubiak &lt;jan.szubiak@linuxpolska.pl&gt;
Reported-by: Marco Rebhan &lt;me@dblsaiko.net&gt;
Reported-by: Matthias Ferdinand &lt;bcache@mfedv.net&gt;
Reported-by: Victor Westerhuis &lt;victor@westerhu.is&gt;
Reported-by: Vojtech Pavlik &lt;vojtech@suse.cz&gt;
Reported-and-tested-by: Rolf Fokkens &lt;rolf@rolffokkens.nl&gt;
Reported-and-tested-by: Thorsten Knabe &lt;linux@thorsten-knabe.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: stable@vger.kernel.org
Cc: Kent Overstreet &lt;kent.overstreet@gmail.com&gt;
Cc: Nix &lt;nix@esperi.org.uk&gt;
Cc: Takashi Iwai &lt;tiwai@suse.com&gt;
Link: https://lore.kernel.org/r/20210607125052.21277-2-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: remove PTR_CACHE</title>
<updated>2021-04-11T14:37:55Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-04-11T13:43:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=11e9560e6c005b4adca12d17b27dc5ac22b40663'/>
<id>urn:sha1:11e9560e6c005b4adca12d17b27dc5ac22b40663</id>
<content type='text'>
Remove the PTR_CACHE inline and replace it with a direct dereference
of c-&gt;cache.

(Coly Li: fix the typo from PTR_BUCKET to PTR_CACHE in commit log)

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Link: https://lore.kernel.org/r/20210411134316.80274-3-colyli@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>bcache: Move journal work to new flush wq</title>
<updated>2021-02-10T15:06:00Z</updated>
<author>
<name>Kai Krakow</name>
<email>kai@kaishome.de</email>
</author>
<published>2021-02-10T05:07:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=afe78ab46f638ecdf80a35b122ffc92c20d9ae5d'/>
<id>urn:sha1:afe78ab46f638ecdf80a35b122ffc92c20d9ae5d</id>
<content type='text'>
This is potentially long running and not latency sensitive, let's get
it out of the way of other latency sensitive events.

As observed in the previous commit, the `system_wq` comes easily
congested by bcache, and this fixes a few more stalls I was observing
every once in a while.

Let's not make this `WQ_MEM_RECLAIM` as it showed to reduce performance
of boot and file system operations in my tests. Also, without
`WQ_MEM_RECLAIM`, I no longer see desktop stalls. This matches the
previous behavior as `system_wq` also does no memory reclaim:

&gt; // workqueue.c:
&gt; system_wq = alloc_workqueue("events", 0, 0);

Cc: Coly Li &lt;colyli@suse.de&gt;
Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: Kai Krakow &lt;kai@kaishome.de&gt;
Signed-off-by: Coly Li &lt;colyli@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
