From: David Laight <David.Laight@ACULAB.COM>
To: 'Geert Uytterhoeven' <geert@linux-m68k.org>,
Dave Chinner <david@fromorbit.com>
Cc: Dave Chinner <dchinner@redhat.com>,
Chandan Babu R <chandanrlinux@gmail.com>,
"Darrick J . Wong" <djwong@kernel.org>,
"Allison Henderson" <allison.henderson@oracle.com>,
Christoph Hellwig <hch@lst.de>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
Linux-Next <linux-next@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"noreply@ellerman.id.au" <noreply@ellerman.id.au>
Subject: RE: [PATCH] xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs()
Date: Mon, 14 Jun 2021 08:18:37 +0000 [thread overview]
Message-ID: <7478840c18fc45379697609757c6c747@AcuMS.aculab.com> (raw)
In-Reply-To: <CAMuHMdWp3E3QDnbGDcTZsCiQNP3pLV2nXVmtOD7OEQO8P-9egQ@mail.gmail.com>
From: Geert Uytterhoeven
> Sent: 11 June 2021 07:55
> Hi Dave,
>
> On Fri, Jun 11, 2021 at 12:02 AM Dave Chinner <david@fromorbit.com> wrote:
> > On Thu, Jun 10, 2021 at 01:00:01PM +0200, Geert Uytterhoeven wrote:
...
> > 64 bit division on 32 bit platforms is still a problem in this day
> > and age?
>
> They're not a problem. But you should use the right operations from
> <linux/math64.h>, iff you really need these expensive operations.
(64bit) division isn't exactly cheap on 64bit cpus.
Some timing tables for x86 give latencies of well over 1 bit/clock
for Intel cpus, AMD ryzen manage 2 bits/clock.
Signed divide is also significantly more expensive than
unsigned divide.
Integer divide performance is clearly not important enough
to throw silicon at.
The same tables show fdiv having a latency of 16 clocks.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2021-06-14 8:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-10 11:00 [PATCH] xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs() Geert Uytterhoeven
2021-06-10 22:01 ` Dave Chinner
2021-06-10 22:50 ` Darrick J. Wong
2021-06-11 6:55 ` Geert Uytterhoeven
2021-06-11 22:46 ` Dave Chinner
2021-06-12 8:54 ` Geert Uytterhoeven
2021-06-14 8:18 ` David Laight [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=7478840c18fc45379697609757c6c747@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=allison.henderson@oracle.com \
--cc=chandanrlinux@gmail.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=geert@linux-m68k.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=noreply@ellerman.id.au \
/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