mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gou Hao <gouhao@uniontech.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: brauner@kernel.org, djwong@kernel.org, gouhaojake@163.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-xfs@vger.kernel.org, wangyuli@uniontech.com
Subject: Re: [PATCH V2] iomap: skip unnecessary ifs_block_is_uptodate check
Date: Thu, 10 Apr 2025 14:25:19 +0800	[thread overview]
Message-ID: <C11672FE2A6808C2+0da2e5a1-440e-4bd4-bf69-e9086d45ce42@uniontech.com> (raw)
In-Reply-To: <Z_dc-UmJs0F1UWTN@infradead.org>


On 2025/4/10 13:54, Christoph Hellwig wrote:
> On Thu, Apr 10, 2025 at 01:42:23PM +0800, Gou Hao wrote:
>> prior to the loop, $i is either the first !uptodate block, or
>> it's past $last.  Assuming there's no overflow (there's no combination
>> of huge folios and tiny blksize) then yeah, there's no point in
>> retesting that the same block $i is uptodate since we hold the folio
>> lock so nobody else could have set uptodate.
> Capitalize the first word in the sentence and use up the 73 characters
> available for the commit log:
>
> In iomap_adjust_read_range, i is either the first !uptodate block, or it
> is past last for the second loop looking for trailing uptodate blocks.
> Assuming there's no overflow (there's no combination of huge folios and
> tiny blksize) then yeah, there is no point in retesting that the same
> block pointed to by i is uptodate since we hold the folio lock so nobody
> else could have set it uptodate.
Thank you, i will change the log in next patch.
>>   		/* truncate len if we find any trailing uptodate block(s) */
>> -		for ( ; i <= last; i++) {
>> +		for (i++; i <= last; i++) {
> A bit nitpicky, but I find a i++ in the initialization condition of a
> for loop a bit odd.
>
> What about turning this into a:
>
> 		while (++i <= last) {
>
> ?
Yes,  it is better.  I will test this.
>


  reply	other threads:[~2025-04-10  6:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 17:29 [PATCH] " Gou Hao
2025-04-09 15:30 ` Darrick J. Wong
2025-04-10  5:37   ` Gou Hao
2025-04-10  5:42 ` [PATCH V2] " Gou Hao
2025-04-10  5:54   ` Christoph Hellwig
2025-04-10  6:25     ` Gou Hao [this message]
2025-04-10  7:12 ` [PATCH V3] " Gou Hao
2025-04-10  7:17   ` Christoph Hellwig
2025-04-11 14:02   ` Christian Brauner

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=C11672FE2A6808C2+0da2e5a1-440e-4bd4-bf69-e9086d45ce42@uniontech.com \
    --to=gouhao@uniontech.com \
    --cc=Z_dc-UmJs0F1UWTN@infradead.org \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gouhaojake@163.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=wangyuli@uniontech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®