Re: Function to do end-writeback in bulk

David Howells <[email protected]>
Newsgroups dev.linux.lists.netfs
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903
Message-ID <[email protected]>
Matthew Wilcox <[email protected]> wrote:

> I hate this API.  I much prefer the _iter() style:

I'm not that keen on the _iter() style, but whatever.

However, does that make it harder to do the stats manipulation in bulk in
future?

I was looking at __folio_end_writeback(), and I see:

	....
			wb = inode_to_wb(inode);
			wb_stat_mod(wb, WB_WRITEBACK, -nr);
			__wb_writeout_add(wb, nr);
			if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) {
				wb_inode_writeback_end(wb);
				if (mapping->host)
					sb_clear_inode_writeback(mapping->host);
			}
	...
		lruvec_stat_mod_folio(folio, NR_WRITEBACK, -nr);
		zone_stat_mod_folio(folio, NR_ZONE_WRITE_PENDING, -nr);
		node_stat_mod_folio(folio, NR_WRITTEN, nr);
	...

And I was thinking those could be done in bulk... but there seems to be an IRQ
disablement requirement around them.  Does the folio_xor_flags_has_waiters()
have to be done inside?  I presume this is to prevent a set/clear race on the
master WRITEBACK tag.

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.