* [PATCH 1/3] ext4: fix over-defensive complain after journal abort @ 2014-09-23 7:02 Dmitry Monakhov 2014-09-23 7:02 ` [PATCH 2/3] ext4: get rid of code duplication Dmitry Monakhov ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Dmitry Monakhov @ 2014-09-23 7:02 UTC (permalink / raw) To: linux-ext4; +Cc: Dmitry Monakhov Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> --- fs/ext4/ext4_jbd2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c index 0074e0d..3445035 100644 --- a/fs/ext4/ext4_jbd2.c +++ b/fs/ext4/ext4_jbd2.c @@ -256,8 +256,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, set_buffer_prio(bh); if (ext4_handle_valid(handle)) { err = jbd2_journal_dirty_metadata(handle, bh); - /* Errors can only happen if there is a bug */ - if (WARN_ON_ONCE(err)) { + /* Errors can only happen due to aborted journal or a nasty bug */ + if (!is_handle_aborted(handle) && WARN_ON_ONCE(err)) { ext4_journal_abort_handle(where, line, __func__, bh, handle, err); if (inode == NULL) { -- 1.7.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] ext4: get rid of code duplication 2014-09-23 7:02 [PATCH 1/3] ext4: fix over-defensive complain after journal abort Dmitry Monakhov @ 2014-09-23 7:02 ` Dmitry Monakhov 2014-09-23 9:54 ` Jan Kara 2014-09-23 7:02 ` [PATCH 3/3] ext4: optimize block allocation on grow indepth Dmitry Monakhov 2014-10-02 2:24 ` [PATCH 1/3] ext4: fix over-defensive complain after journal abort Theodore Ts'o 2 siblings, 1 reply; 9+ messages in thread From: Dmitry Monakhov @ 2014-09-23 7:02 UTC (permalink / raw) To: linux-ext4; +Cc: Dmitry Monakhov Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> --- fs/ext4/mballoc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 65cca28..eab825f 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3155,9 +3155,8 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac, "start %lu, size %lu, fe_logical %lu", (unsigned long) start, (unsigned long) size, (unsigned long) ac->ac_o_ex.fe_logical); + BUG(); } - BUG_ON(start + size <= ac->ac_o_ex.fe_logical && - start > ac->ac_o_ex.fe_logical); BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb)); /* now prepare goal request */ -- 1.7.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] ext4: get rid of code duplication 2014-09-23 7:02 ` [PATCH 2/3] ext4: get rid of code duplication Dmitry Monakhov @ 2014-09-23 9:54 ` Jan Kara 2014-10-02 2:27 ` Theodore Ts'o 0 siblings, 1 reply; 9+ messages in thread From: Jan Kara @ 2014-09-23 9:54 UTC (permalink / raw) To: Dmitry Monakhov; +Cc: linux-ext4 On Tue 23-09-14 11:02:31, Dmitry Monakhov wrote: > > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Looks good. You can add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > fs/ext4/mballoc.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 65cca28..eab825f 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -3155,9 +3155,8 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac, > "start %lu, size %lu, fe_logical %lu", > (unsigned long) start, (unsigned long) size, > (unsigned long) ac->ac_o_ex.fe_logical); > + BUG(); > } > - BUG_ON(start + size <= ac->ac_o_ex.fe_logical && > - start > ac->ac_o_ex.fe_logical); > BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb)); > > /* now prepare goal request */ > -- > 1.7.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Jan Kara <jack@suse.cz> SUSE Labs, CR ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] ext4: get rid of code duplication 2014-09-23 9:54 ` Jan Kara @ 2014-10-02 2:27 ` Theodore Ts'o 0 siblings, 0 replies; 9+ messages in thread From: Theodore Ts'o @ 2014-10-02 2:27 UTC (permalink / raw) To: Jan Kara; +Cc: Dmitry Monakhov, linux-ext4 On Tue, Sep 23, 2014 at 11:54:37AM +0200, Jan Kara wrote: > On Tue 23-09-14 11:02:31, Dmitry Monakhov wrote: > > > > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> > Looks good. You can add: > Reviewed-by: Jan Kara <jack@suse.cz> Applied, thanks. - Ted ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] ext4: optimize block allocation on grow indepth 2014-09-23 7:02 [PATCH 1/3] ext4: fix over-defensive complain after journal abort Dmitry Monakhov 2014-09-23 7:02 ` [PATCH 2/3] ext4: get rid of code duplication Dmitry Monakhov @ 2014-09-23 7:02 ` Dmitry Monakhov 2014-09-23 10:00 ` Jan Kara 2014-10-02 2:52 ` Theodore Ts'o 2014-10-02 2:24 ` [PATCH 1/3] ext4: fix over-defensive complain after journal abort Theodore Ts'o 2 siblings, 2 replies; 9+ messages in thread From: Dmitry Monakhov @ 2014-09-23 7:02 UTC (permalink / raw) To: linux-ext4; +Cc: Dmitry Monakhov It is reasonable to prepent newly created index to older one. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> --- fs/ext4/extents.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 8170b32..37267ea 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -1268,11 +1268,20 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, { struct ext4_extent_header *neh; struct buffer_head *bh; - ext4_fsblk_t newblock; + ext4_fsblk_t newblock, goal = 0; + struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; int err = 0; - newblock = ext4_ext_new_meta_block(handle, inode, NULL, - newext, &err, flags); + /* Try to prepend new index to old one */ + if (ext_depth(inode)) + goal = ext4_idx_pblock(EXT_FIRST_INDEX(ext_inode_hdr(inode))); + if (goal > le32_to_cpu(es->s_first_data_block)) { + flags |= EXT4_MB_HINT_TRY_GOAL; + goal--; + } else + goal = ext4_inode_to_goal_block(inode); + newblock = ext4_new_meta_blocks(handle, inode, goal, flags, + NULL, &err); if (newblock == 0) return err; -- 1.7.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] ext4: optimize block allocation on grow indepth 2014-09-23 7:02 ` [PATCH 3/3] ext4: optimize block allocation on grow indepth Dmitry Monakhov @ 2014-09-23 10:00 ` Jan Kara 2014-09-23 10:26 ` Dmitry Monakhov 2014-10-02 2:52 ` Theodore Ts'o 1 sibling, 1 reply; 9+ messages in thread From: Jan Kara @ 2014-09-23 10:00 UTC (permalink / raw) To: Dmitry Monakhov; +Cc: linux-ext4 On Tue 23-09-14 11:02:32, Dmitry Monakhov wrote: > It is reasonable to prepent newly created index to older one. ... > - newblock = ext4_ext_new_meta_block(handle, inode, NULL, > - newext, &err, flags); > + /* Try to prepend new index to old one */ > + if (ext_depth(inode)) > + goal = ext4_idx_pblock(EXT_FIRST_INDEX(ext_inode_hdr(inode))); > + if (goal > le32_to_cpu(es->s_first_data_block)) { > + flags |= EXT4_MB_HINT_TRY_GOAL; > + goal--; > + } else > + goal = ext4_inode_to_goal_block(inode); > + newblock = ext4_new_meta_blocks(handle, inode, goal, flags, > + NULL, &err); > if (newblock == 0) > return err; Hum, did you actually observe any improvement in file layout with this patch? Honza -- Jan Kara <jack@suse.cz> SUSE Labs, CR ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] ext4: optimize block allocation on grow indepth 2014-09-23 10:00 ` Jan Kara @ 2014-09-23 10:26 ` Dmitry Monakhov 0 siblings, 0 replies; 9+ messages in thread From: Dmitry Monakhov @ 2014-09-23 10:26 UTC (permalink / raw) To: Jan Kara; +Cc: linux-ext4 On Tue, 23 Sep 2014 12:00:31 +0200, Jan Kara <jack@suse.cz> wrote: > On Tue 23-09-14 11:02:32, Dmitry Monakhov wrote: > > It is reasonable to prepent newly created index to older one. > ... > > - newblock = ext4_ext_new_meta_block(handle, inode, NULL, > > - newext, &err, flags); > > + /* Try to prepend new index to old one */ > > + if (ext_depth(inode)) > > + goal = ext4_idx_pblock(EXT_FIRST_INDEX(ext_inode_hdr(inode))); > > + if (goal > le32_to_cpu(es->s_first_data_block)) { > > + flags |= EXT4_MB_HINT_TRY_GOAL; > > + goal--; > > + } else > > + goal = ext4_inode_to_goal_block(inode); > > + newblock = ext4_new_meta_blocks(handle, inode, goal, flags, > > + NULL, &err); > > if (newblock == 0) > > return err; > Hum, did you actually observe any improvement in file layout with this > patch? Hmmm.... well this patch itself unlikely result in improvements because the block we asks is likely used already. This is because non optimal block allocation for mdata. I hope to fix it once we start working on ideas which was described in "fast fsck" tread (http://comments.gmane.org/gmane.comp.file-systems.ext4/41472) > > Honza > -- > Jan Kara <jack@suse.cz> > SUSE Labs, CR ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] ext4: optimize block allocation on grow indepth 2014-09-23 7:02 ` [PATCH 3/3] ext4: optimize block allocation on grow indepth Dmitry Monakhov 2014-09-23 10:00 ` Jan Kara @ 2014-10-02 2:52 ` Theodore Ts'o 1 sibling, 0 replies; 9+ messages in thread From: Theodore Ts'o @ 2014-10-02 2:52 UTC (permalink / raw) To: Dmitry Monakhov; +Cc: linux-ext4 On Tue, Sep 23, 2014 at 11:02:32AM +0400, Dmitry Monakhov wrote: > It is reasonable to prepent newly created index to older one. > > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Thanks, applied with a minor change. - Ted commit c69c690d41e6438ef8e3e9b09d9eb4f2fe669be2 Author: Dmitry Monakhov <dmonakhov@openvz.org> Date: Wed Oct 1 22:52:39 2014 -0400 ext4: optimize block allocation on grow indepth It is reasonable to prepent newld created index to older one. [ Dropped no longer used function parameter newext. -tytso ] Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 8170b32..c3ed9af2 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -1263,16 +1263,24 @@ cleanup: * just created block */ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, - unsigned int flags, - struct ext4_extent *newext) + unsigned int flags) { struct ext4_extent_header *neh; struct buffer_head *bh; - ext4_fsblk_t newblock; + ext4_fsblk_t newblock, goal = 0; + struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; int err = 0; - newblock = ext4_ext_new_meta_block(handle, inode, NULL, - newext, &err, flags); + /* Try to prepend new index to old one */ + if (ext_depth(inode)) + goal = ext4_idx_pblock(EXT_FIRST_INDEX(ext_inode_hdr(inode))); + if (goal > le32_to_cpu(es->s_first_data_block)) { + flags |= EXT4_MB_HINT_TRY_GOAL; + goal--; + } else + goal = ext4_inode_to_goal_block(inode); + newblock = ext4_new_meta_blocks(handle, inode, goal, flags, + NULL, &err); if (newblock == 0) return err; @@ -1373,7 +1381,7 @@ repeat: err = PTR_ERR(path); } else { /* tree is full, time to grow in depth */ - err = ext4_ext_grow_indepth(handle, inode, mb_flags, newext); + err = ext4_ext_grow_indepth(handle, inode, mb_flags); if (err) goto out; ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] ext4: fix over-defensive complain after journal abort 2014-09-23 7:02 [PATCH 1/3] ext4: fix over-defensive complain after journal abort Dmitry Monakhov 2014-09-23 7:02 ` [PATCH 2/3] ext4: get rid of code duplication Dmitry Monakhov 2014-09-23 7:02 ` [PATCH 3/3] ext4: optimize block allocation on grow indepth Dmitry Monakhov @ 2014-10-02 2:24 ` Theodore Ts'o 2 siblings, 0 replies; 9+ messages in thread From: Theodore Ts'o @ 2014-10-02 2:24 UTC (permalink / raw) To: Dmitry Monakhov; +Cc: linux-ext4 On Tue, Sep 23, 2014 at 11:02:30AM +0400, Dmitry Monakhov wrote: > Reviewed-by: Jan Kara <jack@suse.cz> > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Applied, thanks. - Ted ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-10-02 2:53 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-23 7:02 [PATCH 1/3] ext4: fix over-defensive complain after journal abort Dmitry Monakhov 2014-09-23 7:02 ` [PATCH 2/3] ext4: get rid of code duplication Dmitry Monakhov 2014-09-23 9:54 ` Jan Kara 2014-10-02 2:27 ` Theodore Ts'o 2014-09-23 7:02 ` [PATCH 3/3] ext4: optimize block allocation on grow indepth Dmitry Monakhov 2014-09-23 10:00 ` Jan Kara 2014-09-23 10:26 ` Dmitry Monakhov 2014-10-02 2:52 ` Theodore Ts'o 2014-10-02 2:24 ` [PATCH 1/3] ext4: fix over-defensive complain after journal abort Theodore Ts'o
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).