Thread (128 messages) 128 messages, 3 authors, 2021-06-28

Re: [PATCH v2 27/46] mm/writeback: Add __folio_mark_dirty()

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-06-28 15:54:18
Also in: linux-fsdevel, lkml

On Mon, Jun 28, 2021 at 07:03:26AM +0100, Christoph Hellwig wrote:
On Thu, Jun 24, 2021 at 07:37:30PM +0100, Matthew Wilcox wrote:
quoted
On Wed, Jun 23, 2021 at 11:27:12AM +0200, Christoph Hellwig wrote:
quoted
On Tue, Jun 22, 2021 at 01:15:32PM +0100, Matthew Wilcox (Oracle) wrote:
quoted
Turn __set_page_dirty() into a wrapper around __folio_mark_dirty() (which
can directly cast from page to folio because we know that set_page_dirty()
calls filesystems with the head page).  Convert account_page_dirtied()
into folio_account_dirtied() and account the number of pages in the folio.
Is it really worth micro-optimizing a transitional function like that?
I'd rather eat the overhead of the compound_page() call over adding hacky
casts like this.
Fair enough.  There's only three calls to it and one of them goes away
this series.
The other option would be a helper that asserts a page is not a tail
page and then do the cast to document the assumptions.
btw, every call to folio_flags() checks !PageTail:

        struct page *page = &folio->page;

        VM_BUG_ON_PGFLAGS(PageTail(page), page);

now, that's not going to be turned on for regular builds, but it does
give us a _lot_ of runtime assertions that somebody hasn't cast a tail
page to a folio.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help