All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Zhi Yong Wu <zwu.kernel@gmail.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	linux-kernel mlist <linux-kernel@vger.kernel.org>,
	xfstests <xfs@oss.sgi.com>
Subject: Re: [PATCH v3] xfs: introduce object readahead to log recovery
Date: Wed, 14 Aug 2013 16:42:39 +1000	[thread overview]
Message-ID: <20130814064239.GE12779@dastard> (raw)
In-Reply-To: <CAEH94LjeZHJ1uv7qCzVywq6rqkjisZ66+Y2+dXG64+Af6PXyEw@mail.gmail.com>

On Wed, Aug 14, 2013 at 01:59:02PM +0800, Zhi Yong Wu wrote:
> On Wed, Aug 14, 2013 at 1:35 PM, Dave Chinner <david@fromorbit.com> wrote:
> > On Wed, Jul 31, 2013 at 04:42:45PM +0800, zwu.kernel@gmail.com wrote:
> >> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> >>
> >>   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?

Just fix it in this patch - the above paragraph explains how to fix
it....

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

WARNING: multiple messages have this Message-ID (diff)
From: Dave Chinner <david@fromorbit.com>
To: Zhi Yong Wu <zwu.kernel@gmail.com>
Cc: xfstests <xfs@oss.sgi.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	linux-kernel mlist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] xfs: introduce object readahead to log recovery
Date: Wed, 14 Aug 2013 16:42:39 +1000	[thread overview]
Message-ID: <20130814064239.GE12779@dastard> (raw)
In-Reply-To: <CAEH94LjeZHJ1uv7qCzVywq6rqkjisZ66+Y2+dXG64+Af6PXyEw@mail.gmail.com>

On Wed, Aug 14, 2013 at 01:59:02PM +0800, Zhi Yong Wu wrote:
> On Wed, Aug 14, 2013 at 1:35 PM, Dave Chinner <david@fromorbit.com> wrote:
> > On Wed, Jul 31, 2013 at 04:42:45PM +0800, zwu.kernel@gmail.com wrote:
> >> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> >>
> >>   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?

Just fix it in this patch - the above paragraph explains how to fix
it....

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2013-08-14  6:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31  8:42 [PATCH v3] xfs: introduce object readahead to log recovery zwu.kernel
2013-07-31  8:42 ` zwu.kernel
2013-08-07 14:04 ` Zhi Yong Wu
2013-08-07 14:04   ` Zhi Yong Wu
2013-08-14  5:35 ` Dave Chinner
2013-08-14  5:35   ` Dave Chinner
2013-08-14  5:59   ` Zhi Yong Wu
2013-08-14  5:59     ` Zhi Yong Wu
2013-08-14  6:42     ` Dave Chinner [this message]
2013-08-14  6:42       ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130814064239.GE12779@dastard \
    --to=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wuzhy@linux.vnet.ibm.com \
    --cc=xfs@oss.sgi.com \
    --cc=zwu.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.