From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f48.google.com ([209.85.215.48]:33062 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933681AbbENUix (ORCPT ); Thu, 14 May 2015 16:38:53 -0400 Received: by lagr1 with SMTP id r1so4240926lag.0 for ; Thu, 14 May 2015 13:38:51 -0700 (PDT) From: Dmitry Monakhov To: Alex Shi , Theodore Ts'o , Jan Kara , Linaro Kernel Cc: stable@vger.kernel.org Subject: Re: a old issue of ext4 on lts 3.10 In-Reply-To: <5554B3E3.6090407@linaro.org> References: <5554B3E3.6090407@linaro.org> Date: Thu, 14 May 2015 23:36:31 +0300 Message-ID: <87bnhmrj5c.fsf@openvz.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: stable-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Alex Shi writes: > Hi Dmitry&Theodore, > > Someone said without the following patch on lts 3.10 kernel (which used > as android base kernel). the write maybe very very slow, needs 1 or 2 > seconds to finish. In fact this was an optimization. wait_for_stable_page() is actually and optimized wait_on_page_writeback() see: void wait_for_stable_page(struct page *page) { struct address_space *mapping =3D page_mapping(page); struct backing_dev_info *bdi =3D mapping->backing_dev_info; if (!bdi_cap_stable_pages_required(bdi)) return; wait_on_page_writeback(page); } It is very unlikely the patch provokes such huge slowdown. Can you please repeat your measurements and double check your evidence. > > I quick looked this patch, seems it's no harm for a normal fs function. > but still don't know why it is helpful. So do you remember why you > commit this change at that time? > > Thanks > Alex > > ommit 7afe5aa59ed3da7b6161617e7f157c7c680dc41e > Author: Dmitry Monakhov > Date: Wed Aug 28 14:30:47 2013 -0400 > > ext4: convert write_begin methods to stable_page_writes semantics > > Use wait_for_stable_page() instead of wait_on_page_writeback() > > Signed-off-by: Dmitry Monakhov > Signed-off-by: "Theodore Ts'o" > Reviewed-by: Jan Kara > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index fc4051e..47c8e46 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -969,7 +969,8 @@ retry_journal: > ext4_journal_stop(handle); > goto retry_grab; > } > - wait_on_page_writeback(page); > + /* In case writeback began while the page was unlocked */ > + wait_for_stable_page(page); > > if (ext4_should_dioread_nolock(inode)) > ret =3D __block_write_begin(page, pos, len, > ext4_get_block_write); > @@ -2678,7 +2679,7 @@ retry_journal: > goto retry_grab; > } > /* In case writeback began while the page was unlocked */ > - wait_on_page_writeback(page); > + wait_for_stable_page(page); > > ret =3D __block_write_begin(page, pos, len, ext4_da_get_block_pre= p); > if (ret < 0) { > ~ > > --=20 > Thanks > Alex --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJVVQdPAAoJELhyPTmIL6kBSrYH/jLiLofBpP+SQJeBZSNpc53y 0ea1o8wDnjeq6t0j6XBu6hOrVPVehYHbZFENijxPCmKYBkdGbBZwviuK9Zt2bBVN VcOOQXUwr+wKEgylxSUPi00jkrPayU9sWPNXZKqUhaXDy68HfGeo4VIGgc1rbyot x2OTfbV7q2aMlsEW7Su/fBXbm+sgruMY75B2BrmLALQHaF5ca2HScPEoIqBUYK/7 Ywl0vEo158jA+gdMCB2GXyy8gt1n2fWcmeWDe9bYZM3r5Ca1RHhShRHQJ8nBtw2i FZ24ifPUA8uWWCr9H4sfR2qMplzcUmCHtlozy9pf6t/dL738YH+y9ow1yVwxLMA= =09DW -----END PGP SIGNATURE----- --=-=-=--