All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Linus Torvalds' <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: RE: objtool clac/stac handling change..
Date: Mon, 13 Jul 2020 09:32:32 +0000	[thread overview]
Message-ID: <88850c316ed14c7b8391cea05d875406@AcuMS.aculab.com> (raw)
In-Reply-To: <CAHk-=wjQJjZX3cgX6vLp6ntTiBG+a6md64J+e74SDntoTi+q4A@mail.gmail.com>

From: Linus Torvalds
> Sent: 10 July 2020 23:37
> On Tue, Jul 7, 2020 at 5:35 AM David Laight <David.Laight@aculab.com> wrote:
> >
> >
> > So separate copy and checksum passes should easily exceed 4 bytes/clock,
> > but I suspect that doing them together never does.
> > (Unless the buffer is too big for the L1 cache.)
> 
> Its' the "touch the caches twice" that is the problem".
> 
> And it's not the "buffer is too big for L1", it's "the source, the
> destination and any incidentals are too big for L1" with the
> additional noise from replacement policies etc.

That's really what I meant.
L1D is actually (probably) only 32kB.
I guess that gives you 8k for the buffer.

It is a shame you can't use the AVX instructions in kernel.
(Although saving them probably costs more than the gain.)
Then you could use something based on:
10:	load ymm,src+idx   // 32 bytes
	store ymm,tgt+idx
	addq sum0,ymm   // eight 32bit adds
	rotate ymm,16   // Pretty sure there in an instruction for this!
	addq sum1,ymm
	add idx,32
	jnz 10b
It is then possibly to determine the correct result from sum0/sum1.
On very recent Intel cpu that might even run at 1 iteration/clock!
(Probably needs and unroll and explicit interleave.)
At one iteration every 2 clocks it matches the ADDX[OC] loop
but includes the write.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

      reply	other threads:[~2020-07-13  9:32 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 18:22 objtool clac/stac handling change Linus Torvalds
2020-07-01 18:29 ` Andy Lutomirski
2020-07-01 19:35   ` Linus Torvalds
2020-07-01 20:36     ` Andy Lutomirski
2020-07-01 20:51       ` Josh Poimboeuf
2020-07-01 21:02         ` Linus Torvalds
2020-07-02  0:00           ` Josh Poimboeuf
2020-07-02  8:05             ` Peter Zijlstra
2020-07-01 20:51       ` Linus Torvalds
2020-07-02  0:47         ` Andy Lutomirski
2020-07-02  2:30           ` Linus Torvalds
2020-07-02  2:35             ` Linus Torvalds
2020-07-02  3:08             ` Andy Lutomirski
2020-07-01 18:41 ` Al Viro
2020-07-01 19:04   ` Linus Torvalds
2020-07-01 19:59     ` Al Viro
2020-07-01 20:25       ` Linus Torvalds
2020-07-02 13:34         ` Michael Ellerman
2020-07-02 14:01           ` Al Viro
2020-07-02 14:04             ` Al Viro
2020-07-02 15:13           ` Christophe Leroy
2020-07-02 20:13             ` Linus Torvalds
2020-07-03  3:59               ` Michael Ellerman
2020-07-03  3:17             ` Michael Ellerman
2020-07-03  5:27               ` Christophe Leroy
2020-07-03  5:27                 ` Christophe Leroy
2020-07-02 19:52           ` Linus Torvalds
2020-07-02 20:17             ` Al Viro
2020-07-02 20:32               ` Linus Torvalds
2020-07-02 20:59                 ` Al Viro
2020-07-02 21:55                   ` Linus Torvalds
2020-07-03  1:33                     ` Al Viro
2020-07-03  3:32                       ` Linus Torvalds
2020-07-03 21:02                       ` Al Viro
2020-07-03 21:10                         ` Linus Torvalds
2020-07-03 21:41                           ` Andy Lutomirski
2020-07-03 22:25                             ` Al Viro
2020-07-03 21:59                           ` Al Viro
2020-07-03 22:04                             ` Al Viro
2020-07-03 22:12                           ` Al Viro
2020-07-04  0:49                         ` Al Viro
2020-07-04  1:54                           ` Linus Torvalds
2020-07-04  2:30                             ` Al Viro
2020-07-04  3:06                               ` Linus Torvalds
2020-07-04  2:11                           ` Al Viro
2020-07-07 12:35                             ` David Laight
2020-07-10 22:37                               ` Linus Torvalds
2020-07-13  9:32                                 ` 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=88850c316ed14c7b8391cea05d875406@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@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 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.