linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>,
	Hou Tao <houtao1@huawei.com>, Amir Goldstein <amir73il@gmail.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] xfs: log recovery should replay deferred ops in order
Date: Thu, 23 Nov 2017 14:36:40 +0100	[thread overview]
Message-ID: <20171123133640.GA27935@lst.de> (raw)
In-Reply-To: <20171122182949.GH2135@magnolia>

Hi Darrick,

this looks generally good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

But I have a few nitpicks below:

> +	/*
> +	 * We're finishing the defer_ops that accumulated as a result of
> +	 * recovering unfinished intent items during log recovery.  We
> +	 * reserve an itruncate transaction because it is the largest
> +	 * permanent transaction type.  Since we're the only user of the
> +	 * fs right now, take 93% of the available free blocks.  Use
> +	 * weird math to avoid a 64-bit division.
> +	 */

Those magic 93% are 15/16th, maybe better to write it that way :)
That being said / 16 still is a 64-bit division, and I'm pretty sure
we'll run into an old gcc on some weird architecture that will not
turn it into a shift, so better write it as a shift to start with.

> +	freeblks = percpu_counter_sum(&mp->m_fdblocks);
> +	resblks = min_t(s64, UINT_MAX, freeblks);

Didn't I just got called out for using u* types?  The same applies
to s*, so use int64_t here to be consistent.

> +		/*
> +		 * NOTE: If your intent processing routine can create
> +		 * more deferred ops, you /must/ attach them to the
> +		 * dfops in this routine or else those subsequent
> +		 * intents will get replayed in the wrong order!
> +		 */

Please use up all available 80 characters for your comments.

  parent reply	other threads:[~2017-11-23 13:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 18:29 [PATCH] xfs: log recovery should replay deferred ops in order Darrick J. Wong
2017-11-23 10:46 ` Amir Goldstein
2017-11-23 13:36 ` Christoph Hellwig [this message]
2017-11-27 17:50   ` Darrick J. Wong
2017-11-30 20:31 ` Amir Goldstein

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=20171123133640.GA27935@lst.de \
    --to=hch@lst.de \
    --cc=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=houtao1@huawei.com \
    --cc=linux-xfs@vger.kernel.org \
    /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 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).