[Ocfs2-devel] [PATCH v2] ocfs2: improve recovery performance
Junxiao Bi
junxiao.bi at oracle.com
Sun Jul 10 19:12:39 PDT 2016
On 07/09/2016 05:23 AM, Andrew Morton wrote:
> On Thu, 7 Jul 2016 10:24:48 +0800 Junxiao Bi <junxiao.bi at oracle.com> wrote:
>
>> Journal replay will be run when do recovery for a dead node,
>> to avoid the stale cache impact, all blocks of dead node's
>> journal inode were reload from disk. This hurts the performance,
>> check whether one block is cached before reload it can improve
>> a lot performance. In my test env, the time doing recovery was
>> improved from 120s to 1s.
>
> So since v1 you did this (unchangelogged bugfix!):
>
> --- a/fs/ocfs2/journal.c~ocfs2-improve-recovery-performance-v2
> +++ a/fs/ocfs2/journal.c
> @@ -1194,6 +1194,7 @@ static int ocfs2_force_read_journal(stru
>
> brelse(bh);
> bh = NULL;
> + p_blkno++;
> }
>
> v_blkno += p_blocks;
>
>
> I suppose this is a bit neater?
Yes, looks good. Thank you.
Thanks,
Junxiao.
>
> --- a/fs/ocfs2/journal.c~ocfs2-improve-recovery-performance-v2-fix
> +++ a/fs/ocfs2/journal.c
> @@ -1172,14 +1172,12 @@ static int ocfs2_force_read_journal(stru
> goto bail;
> }
>
> - for (i = 0; i < p_blocks; i++) {
> + for (i = 0; i < p_blocks; i++, p_blkno++) {
> bh = __find_get_block(osb->sb->s_bdev, p_blkno,
> osb->sb->s_blocksize);
> /* block not cached. */
> - if (!bh) {
> - p_blkno++;
> + if (!bh)
> continue;
> - }
>
> brelse(bh);
> bh = NULL;
> @@ -1194,7 +1192,6 @@ static int ocfs2_force_read_journal(stru
>
> brelse(bh);
> bh = NULL;
> - p_blkno++;
> }
>
> v_blkno += p_blocks;
> _
>
More information about the Ocfs2-devel
mailing list