From: "Qun-wei Lin (林群崴)" <Qun-wei.Lin@mediatek.com>
To: "hch@infradead.org" <hch@infradead.org>,
"chrisl@kernel.org" <chrisl@kernel.org>
Cc: "Andrew Yang (楊智強)" <Andrew.Yang@mediatek.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"baohua@kernel.org" <baohua@kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"willy@infradead.org" <willy@infradead.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
wsd_upstream <wsd_upstream@mediatek.com>,
"david@redhat.com" <david@redhat.com>,
"schatzberg.dan@gmail.com" <schatzberg.dan@gmail.com>,
"Chinwen Chang (張錦文)" <chinwen.chang@mediatek.com>,
"John Hsu (許永翰)" <John.Hsu@mediatek.com>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"kasong@tencent.com" <kasong@tencent.com>,
"Casper Li (李中榮)" <casper.li@mediatek.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"ying.huang@intel.com" <ying.huang@intel.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"ryan.roberts@arm.com" <ryan.roberts@arm.com>
Subject: Re: [PATCH 0/2] Add BLK_FEAT_READ_SYNCHRONOUS and SWP_READ_SYNCHRONOUS_IO
Date: Fri, 27 Sep 2024 10:14:19 +0000 [thread overview]
Message-ID: <120a91c2b71256d7723c6de7d98c611899b84bac.camel@mediatek.com> (raw)
In-Reply-To: <CACePvbUCNxy3sf6+7hk9HPGTNtTMbA2=Entu0xbV7TbwX4M2WQ@mail.gmail.com>
Hi Chris & Christoph,
Thank you for your review and valuable feedback.
I will submit a v2 version of the patch.
In this version, I will ensure that 'bdev_syncronous()' sets both
'SWP_READ_SYNCHRONOUS_IO' and 'SWP_WRITE_SYNCHRONOUS_IO' flags.
Best regards,
Qun-Wei
On Fri, 2024-09-20 at 17:04 -0700, Chris Li wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> Hi Qun-Wei,
>
> Agree with Christoph that BLK_FEAT_READ_SYNCHRONOUS is not set
> anywhere. That needs to be fixed.
>
> Having a flag for BLK_FEAT_READ_SYNCHRONOUS and another flag for
> BLK_FEAT_SYNCHRONOUS is just confusing.
> for example, read path need to test two bits: "sis->flags &
> (SWP_SYNCHRONOUS_IO | SWP_READ_SYNCHRONOUS_IO)"
>
> There is only one caller of the bdev_synchronous(), which is in
> swapfile.c.
>
> I suggest if you have BLK_FEAT_READ_SYNCHRONOUS, you should have a
> BLK_FEAT_WRITE_SYNCHRONOUS for writing.
> The previous path that test the SWP_SYNCHRONOUS_IO should convert
> into
> one of tests of SWP_READ_SYNCHRONOUS_IO or SWP_WRITE_SYNCHRONOUS_IO
> depend on the read or write path (never both).
>
> "sis->flags & (SWP_SYNCHRONOUS_IO | SWP_READ_SYNCHRONOUS_IO)" will
> change into "sis->flags & SWP_READ_SYNCHRONOUS_IO"
>
> Then you can have bdev_synchronous() just return the
> SWP_READ_SYNCHRONOUS_IO | SWP_WRITE_SYNCHRONOUS_IO if both are set.
> You don't need to have just bdev_synchronous() and
> bdev_read_synchronous(). That is more boilerplate code which is
> unnecessary.
>
> I also suggest you squish your two patches into one because there is
> no user of bdev_read_synchronous() in the first patch.
> You should introduce the function with the code that uses it. Yes,
> yes, I know you want to have a seperate patch for define vs another
> patch for using it. In this case there is no good reason for that.
>
> Best regards,
>
> Chris
>
>
> On Thu, Sep 19, 2024 at 4:37 AM Christoph Hellwig <hch@infradead.org>
> wrote:
> >
> > Well, you're not actually setting your new flags anywhere, which -
> > as you might know - is an reson for an insta-NAK.
> >
next prev parent reply other threads:[~2024-09-27 10:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 11:29 [PATCH 0/2] Add BLK_FEAT_READ_SYNCHRONOUS and SWP_READ_SYNCHRONOUS_IO Qun-Wei Lin
2024-09-19 11:29 ` [PATCH 1/2] block: add BLK_FEAT_READ_SYNCHRONOUS feature for synchronous read Qun-Wei Lin
2024-09-19 11:29 ` [PATCH 2/2] mm, swap: introduce SWP_READ_SYNCHRONOUS_IO Qun-Wei Lin
2024-09-19 11:37 ` [PATCH 0/2] Add BLK_FEAT_READ_SYNCHRONOUS and SWP_READ_SYNCHRONOUS_IO Christoph Hellwig
2024-09-21 0:04 ` Chris Li
2024-09-27 10:14 ` Qun-wei Lin (林群崴) [this message]
2024-09-25 7:34 ` Huang, Ying
2024-10-11 9:08 ` Qun-wei Lin (林群崴)
2024-10-12 7:14 ` Matthew Wilcox
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=120a91c2b71256d7723c6de7d98c611899b84bac.camel@mediatek.com \
--to=qun-wei.lin@mediatek.com \
--cc=Andrew.Yang@mediatek.com \
--cc=John.Hsu@mediatek.com \
--cc=akpm@linux-foundation.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=axboe@kernel.dk \
--cc=baohua@kernel.org \
--cc=casper.li@mediatek.com \
--cc=chinwen.chang@mediatek.com \
--cc=chrisl@kernel.org \
--cc=david@redhat.com \
--cc=hch@infradead.org \
--cc=kasong@tencent.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=matthias.bgg@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=schatzberg.dan@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=wsd_upstream@mediatek.com \
--cc=ying.huang@intel.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;
as well as URLs for NNTP newsgroup(s).