<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/buffer_head.h, branch v5.18.19</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.18.19</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.18.19'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-08-17T12:40:04Z</updated>
<entry>
<title>add barriers to buffer_uptodate and set_buffer_uptodate</title>
<updated>2022-08-17T12:40:04Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2022-08-09T18:32:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=22e5e0bcc60f7d6547130a3c3f5034959b132a09'/>
<id>urn:sha1:22e5e0bcc60f7d6547130a3c3f5034959b132a09</id>
<content type='text'>
commit d4252071b97d2027d246f6a82cbee4d52f618b47 upstream.

Let's have a look at this piece of code in __bread_slow:

	get_bh(bh);
	bh-&gt;b_end_io = end_buffer_read_sync;
	submit_bh(REQ_OP_READ, 0, bh);
	wait_on_buffer(bh);
	if (buffer_uptodate(bh))
		return bh;

Neither wait_on_buffer nor buffer_uptodate contain any memory barrier.
Consequently, if someone calls sb_bread and then reads the buffer data,
the read of buffer data may be executed before wait_on_buffer(bh) on
architectures with weak memory ordering and it may return invalid data.

Fix this bug by adding a memory barrier to set_buffer_uptodate and an
acquire barrier to buffer_uptodate (in a similar way as
folio_test_uptodate and folio_mark_uptodate).

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Reviewed-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fs: Convert __set_page_dirty_buffers to block_dirty_folio</title>
<updated>2022-03-16T17:37:04Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-09T20:22:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e621900ad28b748e058b81d6078a5d5eb37b3973'/>
<id>urn:sha1:e621900ad28b748e058b81d6078a5d5eb37b3973</id>
<content type='text'>
Convert all callers; mostly this is just changing the aops to point
at it, but a few implementations need a little more work.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Tested-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Acked-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Tested-by: Mike Marshall &lt;hubcap@omnibond.com&gt; # orangefs
Tested-by: David Howells &lt;dhowells@redhat.com&gt; # afs
</content>
</entry>
<entry>
<title>fs: Turn block_invalidatepage into block_invalidate_folio</title>
<updated>2022-03-15T12:23:29Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-09T20:21:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7ba13abbd31ee9265e88d7dc029c0f786e665192'/>
<id>urn:sha1:7ba13abbd31ee9265e88d7dc029c0f786e665192</id>
<content type='text'>
Remove special-casing of a NULL invalidatepage, since there is no
more block_invalidatepage.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Tested-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Acked-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Tested-by: Mike Marshall &lt;hubcap@omnibond.com&gt; # orangefs
Tested-by: David Howells &lt;dhowells@redhat.com&gt; # afs
</content>
</entry>
<entry>
<title>fs: Convert is_partially_uptodate to folios</title>
<updated>2022-03-14T19:43:17Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-09T20:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2e7e80f7e7e9dbbb3c2a85ee923ca32826052816'/>
<id>urn:sha1:2e7e80f7e7e9dbbb3c2a85ee923ca32826052816</id>
<content type='text'>
Since the uptodate property is maintained on a per-folio basis, the
is_partially_uptodate method should also take a folio.  Fix the types
at the same time so it's clear that it returns true/false and takes
the count in bytes, not blocks.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Tested-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Acked-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Tested-by: Mike Marshall &lt;hubcap@omnibond.com&gt; # orangefs
Tested-by: David Howells &lt;dhowells@redhat.com&gt; # afs
</content>
</entry>
<entry>
<title>buffer: Add folio_buffers()</title>
<updated>2022-03-14T19:43:16Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-09T20:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cd1067beeebfe23fc8cab071790fefb273962d51'/>
<id>urn:sha1:cd1067beeebfe23fc8cab071790fefb273962d51</id>
<content type='text'>
While there is no intent to use large folios in filesystems using buffer
heads, converting the filesystems to use single-page folios is still worth
doing to remove legacy infrastructure and hidden calls to compound_head().
These helper functions are needed for that conversion to take place.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Tested-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Acked-by: Damien Le Moal &lt;damien.lemoal@opensource.wdc.com&gt;
Tested-by: Mike Marshall &lt;hubcap@omnibond.com&gt; # orangefs
Tested-by: David Howells &lt;dhowells@redhat.com&gt; # afs
</content>
</entry>
<entry>
<title>mm: fs: invalidate bh_lrus for only cold path</title>
<updated>2021-09-24T23:13:35Z</updated>
<author>
<name>Minchan Kim</name>
<email>minchan@kernel.org</email>
</author>
<published>2021-09-24T22:43:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=243418e3925d5b5b0657ae54c322d43035e97eed'/>
<id>urn:sha1:243418e3925d5b5b0657ae54c322d43035e97eed</id>
<content type='text'>
The kernel test robot reported the regression of fio.write_iops[1] with
commit 8cc621d2f45d ("mm: fs: invalidate BH LRU during page migration").

Since lru_add_drain is called frequently, invalidate bh_lrus there could
increase bh_lrus cache miss ratio, which needs more IO in the end.

This patch moves the bh_lrus invalidation from the hot path( e.g.,
zap_page_range, pagevec_release) to cold path(i.e., lru_add_drain_all,
lru_cache_disable).

Zhengjun Xing confirmed
 "I test the patch, the regression reduced to -2.9%"

[1] https://lore.kernel.org/lkml/20210520083144.GD14190@xsang-OptiPlex-9020/
[2] 8cc621d2f45d, mm: fs: invalidate BH LRU during page migration

Link: https://lkml.kernel.org/r/20210907212347.1977686-1-minchan@kernel.org
Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Reviewed-by: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Tested-by: "Xing, Zhengjun" &lt;zhengjun.xing@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>include/linux/buffer_head.h: fix boolreturn.cocci warnings</title>
<updated>2021-09-03T16:58:10Z</updated>
<author>
<name>Jing Yangyang</name>
<email>jing.yangyang@zte.com.cn</email>
</author>
<published>2021-09-02T21:53:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6de522d1667f628376517e4b177af10c739d745b'/>
<id>urn:sha1:6de522d1667f628376517e4b177af10c739d745b</id>
<content type='text'>
./include/linux/buffer_head.h:412:64-65:WARNING:return of 0/1 in
function 'has_bh_in_lru' with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Link: https://lkml.kernel.org/r/20210824055828.58783-1-deng.changcheng@zte.com.cn
Signed-off-by: Jing Yangyang &lt;jing.yangyang@zte.com.cn&gt;
Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: fs: invalidate BH LRU during page migration</title>
<updated>2021-05-05T18:27:24Z</updated>
<author>
<name>Minchan Kim</name>
<email>minchan@kernel.org</email>
</author>
<published>2021-05-05T01:37:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8cc621d2f45ddd3dc664024a647ee7adf48d79a5'/>
<id>urn:sha1:8cc621d2f45ddd3dc664024a647ee7adf48d79a5</id>
<content type='text'>
Pages containing buffer_heads that are in one of the per-CPU buffer_head
LRU caches will be pinned and thus cannot be migrated.  This can prevent
CMA allocations from succeeding, which are often used on platforms with
co-processors (such as a DSP) that can only use physically contiguous
memory.  It can also prevent memory hot-unplugging from succeeding,
which involves migrating at least MIN_MEMORY_BLOCK_SIZE bytes of memory,
which ranges from 8 MiB to 1 GiB based on the architecture in use.

Correspondingly, invalidate the BH LRU caches before a migration starts
and stop any buffer_head from being cached in the LRU caches, until
migration has finished.

Link: https://lkml.kernel.org/r/20210319175127.886124-3-minchan@kernel.org
Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Reported-by: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Reported-by: Laura Abbott &lt;labbott@kernel.org&gt;
Tested-by: Oliver Sang &lt;oliver.sang@intel.com&gt;
Cc: David Hildenbrand &lt;david@redhat.com&gt;
Cc: John Dias &lt;joaodias@google.com&gt;
Cc: Matthew Wilcox &lt;willy@infradead.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs: move the buffer_heads_over_limit stub to buffer_head.h</title>
<updated>2020-06-24T15:16:02Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-06-20T07:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d2de7ea48d83195ef1310555f1fdd9e8e1bab0d3'/>
<id>urn:sha1:d2de7ea48d83195ef1310555f1fdd9e8e1bab0d3</id>
<content type='text'>
Move the !CONFIG_BLOCK stub to the same place as the non-stub
declaration.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>buffer_head.h: remove attach_page_buffers</title>
<updated>2020-06-02T17:59:08Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>guoqing.jiang@cloud.ionos.com</email>
</author>
<published>2020-06-02T04:48:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b59435a2afed12dc9b2ec1b930efa2e94f1c397'/>
<id>urn:sha1:7b59435a2afed12dc9b2ec1b930efa2e94f1c397</id>
<content type='text'>
All the callers have replaced attach_page_buffers with the new function
attach_page_private, so remove it.

Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@cloud.ionos.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Roman Gushchin &lt;guro@fb.com&gt;
Cc: Andreas Dilger &lt;adilger@dilger.ca&gt;
Link: http://lkml.kernel.org/r/20200517214718.468-10-guoqing.jiang@cloud.ionos.com
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
