From: Jaegeuk Kim Subject: Re: [PATCH] f2fs: reduce unncessary locking pages during read Date: Tue, 19 Mar 2013 16:04:18 +0900 Message-ID: <1363676658.27362.3.camel@kjgkr> References: <1363585809-8138-1-git-send-email-jaegeuk.kim@samsung.com> Reply-To: jaegeuk.kim@samsung.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-rzaBgy7WiFxLhofVZ5p2" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Changman Lee To: Namjae Jeon Return-path: In-reply-to: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --=-rzaBgy7WiFxLhofVZ5p2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2013-03-19 (=ED=99=94), 13:54 +0900, Namjae Jeon: > > > > - err =3D 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 =3D 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! :) >=20 > > return page; > > } > > > > @@ -241,9 +244,13 @@ struct page *get_lock_data_page(struct inode *inod= e, > > pgoff_t index) > > BUG_ON(dn.data_blkaddr =3D=3D NULL_ADDR); > > > > err =3D 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, >=20 > 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" i= n > 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/ --=20 Jaegeuk Kim Samsung --=-rzaBgy7WiFxLhofVZ5p2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJRSA3yAAoJEEAUqH6CSFDSuhwP/A17ULo0WQQHRlxsDsjcFUhD vTqJctXIU9YG+jMwH7GOH07+eFBKeOVL4XcneY73ENOhJzjIjEM9TL4xT2ecggYl SqSgh5zOOGLq3drdDrs7YkZlTKH6BpIXRmmX9SyrHVSM206WhisQkE4/EJVRIlgT oGrfpha4j86n6xB4B5Fok2Z4BrAx9+UN1o2hbbuhYh13CKBCAIbtZFlXZBChUeF7 mmr3RimodaiZRcg2mws69x/Nd1k0qz4IUwjuzSephr9+yMuisWS26O++Dck/4moI 4D87nxu8Dfy7QminU2mxlHKME2VrvkT/+2mcrI8YrEpNnxhP9A8J/TgYMb7xfVeB ad6RWt1/EHo1IdsJXtk8E97I5yp5PbnreNM9FF40n3mwxJFBa/fZacFT3WqLiyWn Vu8pMQ3eazzoxTWedIZ5DBkG6dQZPYrQVN+yt5AGqJzFonY9SizDZPNFuSmoMyqp dqXWuqb5qTgcRTnJfjsc5rs5cx36ONsG8FMcxWedYJ7ZtepLy6NwZ4iPVZxHmgjC wy33ZlGEFyQw4lfspdRorS3VBiOHHLpVDuonqjLi9LcGoPAIrXQZ/i3g+yndoRdX zYqwfXWf6uzH9OUbvW0ey7LsE1PDwoRT7coMVjkeXOjqYDPm+KcUtDK06WlWMYCP D6AhqQh9nMWMbid2b1ot =EFHM -----END PGP SIGNATURE----- --=-rzaBgy7WiFxLhofVZ5p2--