xfs
[Top] [All Lists]

Re: [PATCH v3] xfs: introduce object readahead to log recovery

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH v3] xfs: introduce object readahead to log recovery
From: Zhi Yong Wu <zwu.kernel@xxxxxxxxx>
Date: Wed, 14 Aug 2013 13:59:02 +0800
Cc: xfstests <xfs@xxxxxxxxxxx>, "linux-fsdevel@xxxxxxxxxxxxxxx" <linux-fsdevel@xxxxxxxxxxxxxxx>, Zhi Yong Wu <wuzhy@xxxxxxxxxxxxxxxxxx>, linux-kernel mlist <linux-kernel@xxxxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=F0WqMbVHVPB9D9/3AnoTnN6OLa5inOYUH8BovdivMf8=; b=RkXToll/PEHpP4preIdpEJHRNeESseyegQ398VOmfXT668YC4caT9ZdHFtI8lkstoc 92KO6eHnV/p9+75EPckAiioJ9OQzGAwMvbrZ/4fnNDUWK0RkXE88Z4ov51xhizgrBR2Z qh8kQB7OQlWgGiozKWmeeSekql8wbpedHeFv9Op4QrP6S7Fac7r1YMW12OkRC8d1PReX 9hMaSePqLy+hDzP6Pa32o3tl1Va9mrN9N1ux7S78vprwuBCOHz2A8FZAIF+3wlOjcHI6 8N0FDAXVNO3s9qPt4MsrxxXmKtJVQ8kXqGLbNckM1HjL5ejxnCVVKWwc8hDiglo3wQ3M PuCQ==
In-reply-to: <20130814053523.GY12779@dastard>
References: <1375260165-8773-1-git-send-email-zwu.kernel@xxxxxxxxx> <20130814053523.GY12779@dastard>
On Wed, Aug 14, 2013 at 1:35 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> On Wed, Jul 31, 2013 at 04:42:45PM +0800, zwu.kernel@xxxxxxxxx wrote:
>> From: Zhi Yong Wu <wuzhy@xxxxxxxxxxxxxxxxxx>
>>
>>   It can take a long time to run log recovery operation because it is
>> single threaded and is bound by read latency. We can find that it took
>> most of the time to wait for the read IO to occur, so if one object
>> readahead is introduced to log recovery, it will obviously reduce the
>> log recovery time.
>>
>> Log recovery time stat:
>>
>>           w/o this patch        w/ this patch
>>
>> real:        0m15.023s             0m7.802s
>> user:        0m0.001s              0m0.001s
>> sys:         0m0.246s              0m0.107s
>
> This version works as advertised as well.
>
>> @@ -3216,6 +3351,18 @@ xlog_recover_commit_trans(
>>                       goto out;
>>       }
>>
>> +     if (!list_empty(&ra_list)) {
>> +             error = xlog_recover_items_pass2(log, trans,
>> +                             &buffer_list, &ra_list);
>> +             if (error)
>> +                     goto out;
>> +
>> +             list_splice_tail_init(&ra_list, &done_list);
>> +     }
>> +
>> +     if (!list_empty(&done_list))
>> +             list_splice_init(&done_list, &trans->r_itemq);
>> +
>>       xlog_recover_free_trans(trans);
>
> I think this still leaks the trans structure when an error occurs.
> Indeed, I think this is a pre-existing leak, as the current code
> will skip freeing the trans structure on item recovery failure and
> nothing else frees it.  So it appears to me to be busted before this
> patch is added.
Yes, i also found this and think so.
>
> Hence on a xlog_recover_items_pass2() error we need to splice the
> ra-list to the done_list and free trans. i.e. the "if (error) goto
> out;" lines in the above hunk do not need to be there, and the
> "out:" label moved to above the call to xlog_recover_free_trans() so
> the main loop does the right thing when an error occurs.
Do you need to draft one patch to fix trans leaking? or can it be
fixed in this patch?
or will you draft one patch?

>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@xxxxxxxxxxxxx



-- 
Regards,

Zhi Yong Wu

<Prev in Thread] Current Thread [Next in Thread>