From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: fix sign handling problem in xfs_bmbt_diff_two_keys
Date: Fri, 30 Aug 2019 08:30:08 -0700 [thread overview]
Message-ID: <20190830153008.GA13924@infradead.org> (raw)
In-Reply-To: <20190829154158.GB5354@magnolia>
On Thu, Aug 29, 2019 at 08:41:58AM -0700, Darrick J. Wong wrote:
> A signed s64 comparison would just break the diff_two_keys function
> again. The reason for the big dorky comment is to point out that the
> signed comparison doesn't work for xfs_btree_query_all, because it does:
Even more reason to have a good helper encapsulating and documenting
all the caveats :)
> I wouldn't mind you cooking up a patch (I think I'm going to be busy
> for a few hours digging through all of Dave's patches) but the helper
> needs to be cmp_u64. Though ... I also think the logic in the patched
> bmbt diff_two_keys is easy enough to follow along.
>
> (Personally I find the subtraction logic harder to follow, though it
> generates less asm code on x64...)
The subtraction is a little weird, but very efficient if it works.
I'm not sure any of our users is worth the micro-optimization, though.
I'll cook up a series over the weekend.
prev parent reply other threads:[~2019-08-30 15:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 18:38 [PATCH] xfs: fix sign handling problem in xfs_bmbt_diff_two_keys Darrick J. Wong
2019-08-29 7:23 ` Christoph Hellwig
2019-08-29 15:41 ` Darrick J. Wong
2019-08-30 15:30 ` Christoph Hellwig [this message]
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=20190830153008.GA13924@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.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