All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Aravinda Herle <araherle@in.ibm.com>
Subject: Re: [RFCv2 1/3] iomap: Move creation of iomap_page early in __iomap_write_begin
Date: Mon, 30 Jan 2023 21:00:01 +0000	[thread overview]
Message-ID: <Y9gv0YV9V6gR9l3F@casper.infradead.org> (raw)
In-Reply-To: <20230130202150.pfohy5yg6dtu64ce@rh-tp>

On Tue, Jan 31, 2023 at 01:51:50AM +0530, Ritesh Harjani (IBM) wrote:
> > > Thus the iop structure will only gets allocated at the time of writeback
> > > in iomap_writepage_map(). This I think, was a not problem till now since
> > > we anyway only track uptodate status in iop (no support of tracking
> > > dirty bitmap status which later patches will add), and we also end up
> > > setting all the bits in iomap_page_create(), if the page is uptodate.
> >
> > delayed iop allocation is a feature and not a bug.  We might have to
> > refine the criteria for sub-page dirty tracking, but in general having
> > the iop allocates is a memory and performance overhead and should be
> > avoided as much as possible.  In fact I still have some unfinished
> > work to allocate it even more lazily.
> 
> So, what I meant here was that the commit[1] chaged the behavior/functionality
> without indenting to. I agree it's not a bug.

It didn't change the behaviour or functionality.  It broke your patches,
but it certainly doesn't deserve its own commit reverting it -- because
it's not wrong.

> But when I added dirty bitmap tracking support, I couldn't understand for
> sometime on why were we allocating iop only at the time of writeback.
> And it was due to a small line change which somehow slipped into this commit [1].
> Hence I made this as a seperate patch so that it doesn't slip through again w/o
> getting noticed/review.

It didn't "slip through".  It was intended.

> Thanks for the info on the lazy allocation work. Yes, though it is not a bug, but
> with subpage dirty tracking in iop->state[], if we end up allocating iop only
> at the time of writeback, than that might cause some performance degradation
> compared to, if we allocat iop at ->write_begin() and mark the required dirty
> bit ranges in ->write_end(). Like how we do in this patch series.
> (Ofcourse it is true only for bs < ps use case).
> 
> [1]: https://lore.kernel.org/all/20220623175157.1715274-5-shr@fb.com/

You absolutely can allocate it in iomap_write_begin, but you can avoid
allocating it until writeback time if (pos, len) entirely overlap the
folio.  ie:

	if (pos > folio_pos(folio) ||
	    pos + len < folio_pos(folio) + folio_size(folio))
		iop = iomap_page_create(iter->inode, folio, iter->flags, false);

  reply	other threads:[~2023-01-30 21:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 16:14 [RFCv2 0/3] iomap: Add support for subpage dirty state tracking to improve write performance Ritesh Harjani (IBM)
2023-01-30 16:14 ` [RFCv2 1/3] iomap: Move creation of iomap_page early in __iomap_write_begin Ritesh Harjani (IBM)
2023-01-30 17:02   ` Christoph Hellwig
2023-01-30 20:21     ` Ritesh Harjani (IBM)
2023-01-30 21:00       ` Matthew Wilcox [this message]
2023-01-31 18:37         ` Ritesh Harjani (IBM)
2023-01-31 18:48           ` Matthew Wilcox
2023-01-31 20:00             ` Ritesh Harjani (IBM)
2023-01-30 16:14 ` [RFCv2 2/3] iomap: Change uptodate variable name to state Ritesh Harjani (IBM)
2023-01-30 21:56   ` Dave Chinner
2023-01-30 22:24     ` Matthew Wilcox
2023-01-31 15:07       ` Christoph Hellwig
2023-01-31 18:05         ` Ritesh Harjani (IBM)
2023-01-30 16:14 ` [RFCv2 3/3] iomap: Support subpage size dirty tracking to improve write performance Ritesh Harjani (IBM)
2023-01-30 17:16   ` Christoph Hellwig
2023-01-30 18:01     ` Matthew Wilcox
2023-01-30 20:44       ` Ritesh Harjani (IBM)
2023-01-30 20:27     ` Ritesh Harjani (IBM)
2023-01-30 17:54   ` Matthew Wilcox
2023-01-30 20:34     ` Ritesh Harjani (IBM)
2023-01-30 18:10 ` [RFCv2 0/3] iomap: Add support for subpage dirty state " Matthew Wilcox
2023-01-30 21:01   ` Ritesh Harjani (IBM)
2023-02-02  4:45 ` Ritesh Harjani (IBM)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y9gv0YV9V6gR9l3F@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=araherle@in.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.