From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
Changman Lee <cm224.lee@samsung.com>
Subject: Re: [PATCH] f2fs: reduce unncessary locking pages during read
Date: Tue, 19 Mar 2013 16:04:18 +0900 [thread overview]
Message-ID: <1363676658.27362.3.camel@kjgkr> (raw)
In-Reply-To: <CAKYAXd9VawA5p+mWXdQUgq2rfNoYeRcj+zt0OM+k6eALCQjtcA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]
2013-03-19 (화), 13:54 +0900, Namjae Jeon:
> >
> > - err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> > - if (err) {
> > - f2fs_put_page(page, 1);
> > - return ERR_PTR(err);
> > + if (PageUptodate(page)) {
> > + unlock_page(page);
> > + return page;
> > }
> > - unlock_page(page);
> Hi Jaegeuk.
> > +
> > + err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> > + wait_on_page_locked(page);
> > + if (!PageUptodate(page))
> > + return ERR_PTR(-EIO);
> We don't need to release page before returning EIO ?
Good catch! :)
>
> > return page;
> > }
> >
> > @@ -241,9 +244,13 @@ struct page *get_lock_data_page(struct inode *inode,
> > pgoff_t index)
> > BUG_ON(dn.data_blkaddr == NULL_ADDR);
> >
> > err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> > - if (err) {
> > - f2fs_put_page(page, 1);
> > + if (err)
> > return ERR_PTR(err);
> Here is also same. We don't need to release page in case of err ?
It's different.
The f2fs_readpage() releases the page if error is occurred.
Thanks,
>
> Thanks.
> > +
> > + lock_page(page);
> > + if (!PageUptodate(page)) {
> > + f2fs_put_page(page, 1);
> > + return ERR_PTR(-EIO);
> > }
> > return page;
> > }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Jaegeuk Kim
Samsung
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-03-19 7:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 5:50 [PATCH] f2fs: reduce unncessary locking pages during read Jaegeuk Kim
2013-03-19 4:54 ` Namjae Jeon
2013-03-19 7:04 ` Jaegeuk Kim [this message]
2013-03-19 8:17 ` Namjae Jeon
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=1363676658.27362.3.camel@kjgkr \
--to=jaegeuk.kim@samsung.com \
--cc=cm224.lee@samsung.com \
--cc=linkinjeon@gmail.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).