linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Convert write_cache_pages() to an iterator v3
@ 2023-12-18 15:35 Christoph Hellwig
  2023-12-18 15:35 ` [PATCH 01/17] writeback: fix done_index when hitting the wbc->nr_to_write Christoph Hellwig
                   ` (17 more replies)
  0 siblings, 18 replies; 44+ messages in thread
From: Christoph Hellwig @ 2023-12-18 15:35 UTC (permalink / raw)
  To: linux-mm
  Cc: Matthew Wilcox (Oracle), Jan Kara, David Howells, Brian Foster,
	linux-fsdevel, linux-kernel

Hi all,

this is basically a evolution of the series Matthew Wilcox originally
set in June.  Based on comments from Jan a Brian this now actually
untangles some of the more confusing conditional in the writeback code
before refactoring it into the iterator.  Because of that all the
later patches need a fair amount of rebasing and I've not carried any
reviewed-by over.

The original cover letter is below:

Dave Howells doesn't like the indirect function call imposed by
write_cache_pages(), so refactor it into an iterator.  I took the
opportunity to add the ability to iterate a folio_batch without having
an external variable.

This is against next-20230623.  If you try to apply it on top of a tree
which doesn't include the pagevec removal series, IT WILL CRASH because
it won't reinitialise folio_batch->i and the iteration will index out
of bounds.

I have a feeling the 'done' parameter could have a better name, but I
can't think what it might be.

Diffstat:
 include/linux/pagevec.h   |   18 ++
 include/linux/writeback.h |   19 ++
 mm/page-writeback.c       |  333 +++++++++++++++++++++++++---------------------
 3 files changed, 220 insertions(+), 150 deletions(-)

^ permalink raw reply	[flat|nested] 44+ messages in thread
* Convert write_cache_pages() to an iterator v4
@ 2023-12-22 15:08 Christoph Hellwig
  2023-12-22 15:08 ` [PATCH 09/17] writeback: Simplify the loops in write_cache_pages() Christoph Hellwig
  0 siblings, 1 reply; 44+ messages in thread
From: Christoph Hellwig @ 2023-12-22 15:08 UTC (permalink / raw)
  To: linux-mm
  Cc: Matthew Wilcox (Oracle), Jan Kara, David Howells, Brian Foster,
	linux-fsdevel, linux-kernel

Hi all,

this is basically a evolution of the series Matthew Wilcox originally
set in June.  Based on comments from Jan a Brian this now actually
untangles some of the more confusing conditional in the writeback code
before refactoring it into the iterator.  Because of that all the
later patches need a fair amount of rebasing and I've not carried any
reviewed-by over.

The original cover letter is below:

Dave Howells doesn't like the indirect function call imposed by
write_cache_pages(), so refactor it into an iterator.  I took the
opportunity to add the ability to iterate a folio_batch without having
an external variable.

This is against next-20230623.  If you try to apply it on top of a tree
which doesn't include the pagevec removal series, IT WILL CRASH because
it won't reinitialise folio_batch->i and the iteration will index out
of bounds.

I have a feeling the 'done' parameter could have a better name, but I
can't think what it might be.

Changes since v3:
 - various commit log spelling fixes
 - remove a statement from a commit log that isn't true any more with the
   changes in v3
 - rename a function
 - merge two helpers

Diffstat:
 include/linux/pagevec.h   |   18 ++
 include/linux/writeback.h |   19 ++
 mm/page-writeback.c       |  328 +++++++++++++++++++++++++---------------------
 3 files changed, 215 insertions(+), 150 deletions(-)

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2023-12-22 15:08 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 15:35 Convert write_cache_pages() to an iterator v3 Christoph Hellwig
2023-12-18 15:35 ` [PATCH 01/17] writeback: fix done_index when hitting the wbc->nr_to_write Christoph Hellwig
2023-12-19 17:33   ` Jan Kara
2023-12-18 15:35 ` [PATCH 02/17] writeback: also update wbc->nr_to_write on writeback failure Christoph Hellwig
2023-12-19 17:36   ` Jan Kara
2023-12-18 15:35 ` [PATCH 03/17] writeback: rework the loop termination condition in write_cache_pages Christoph Hellwig
2023-12-19 18:27   ` Jan Kara
2023-12-18 15:35 ` [PATCH 04/17] writeback: only update ->writeback_index for range_cyclic writeback Christoph Hellwig
2023-12-21 10:59   ` Jan Kara
2023-12-18 15:35 ` [PATCH 05/17] writeback: remove a duplicate prototype for tag_pages_for_writeback Christoph Hellwig
2023-12-21 10:59   ` Jan Kara
2023-12-18 15:35 ` [PATCH 06/17] writeback: Factor out writeback_finish() Christoph Hellwig
2023-12-21 11:09   ` Jan Kara
2023-12-18 15:35 ` [PATCH 07/17] writeback: Factor writeback_get_batch() out of write_cache_pages() Christoph Hellwig
2023-12-21 11:17   ` Jan Kara
2023-12-21 12:22     ` Christoph Hellwig
2023-12-21 12:30       ` Jan Kara
2023-12-18 15:35 ` [PATCH 08/17] writeback: Factor should_writeback_folio() " Christoph Hellwig
2023-12-21 11:22   ` Jan Kara
2023-12-21 12:23     ` Christoph Hellwig
2023-12-18 15:35 ` [PATCH 09/17] writeback: Simplify the loops in write_cache_pages() Christoph Hellwig
2023-12-21 11:24   ` Jan Kara
2023-12-18 15:35 ` [PATCH 10/17] pagevec: Add ability to iterate a queue Christoph Hellwig
2023-12-21 11:26   ` Jan Kara
2023-12-18 15:35 ` [PATCH 11/17] writeback: Use the folio_batch queue iterator Christoph Hellwig
2023-12-21 11:28   ` Jan Kara
2023-12-18 15:35 ` [PATCH 12/17] writeback: Factor writeback_iter_init() out of write_cache_pages() Christoph Hellwig
2023-12-21 11:29   ` Jan Kara
2023-12-18 15:35 ` [PATCH 13/17] writeback: Factor writeback_get_folio() " Christoph Hellwig
2023-12-21 11:41   ` Jan Kara
2023-12-21 12:25     ` Christoph Hellwig
2023-12-21 12:31       ` Jan Kara
2023-12-18 15:35 ` [PATCH 14/17] writeback: Factor writeback_iter_next() " Christoph Hellwig
2023-12-21 11:46   ` Jan Kara
2023-12-18 15:35 ` [PATCH 15/17] writeback: Add for_each_writeback_folio() Christoph Hellwig
2023-12-21 11:51   ` Jan Kara
2023-12-21 12:29     ` Christoph Hellwig
2023-12-21 12:49       ` Jan Kara
2023-12-18 15:35 ` [PATCH 16/17] writeback: Remove a use of write_cache_pages() from do_writepages() Christoph Hellwig
2023-12-21 11:53   ` Jan Kara
2023-12-18 15:35 ` [PATCH 17/17] writeback: update the kerneldoc comment for tag_pages_for_writeback Christoph Hellwig
2023-12-21 11:54   ` Jan Kara
2023-12-18 21:00 ` Convert write_cache_pages() to an iterator v3 Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2023-12-22 15:08 Convert write_cache_pages() to an iterator v4 Christoph Hellwig
2023-12-22 15:08 ` [PATCH 09/17] writeback: Simplify the loops in write_cache_pages() Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).