Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1443089

Re: [PATCH 2/4] x86, pagetable: ignore A/D bits in pte/pmd/pud_none()

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] x86, pagetable: ignore A/D bits in pte/pmd/pud_none()
Date 2016-07-14 08:20 +0200
Message-ID <rUIa5-5Pz-3@gated-at.bofh.it> (permalink)
References <rSrGp-5Fj-5@gated-at.bofh.it> <rSrGp-5Fj-7@gated-at.bofh.it> <rUugO-4RD-11@gated-at.bofh.it> <rUuA9-4Zu-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 13-07-16 08:47:51, Dave Hansen wrote:
> On 07/13/2016 08:21 AM, Michal Hocko wrote:
> >> > This adds a tiny amount of overhead to all pte_none() checks.
> >> > I doubt we'll be able to measure it anywhere.
> > It would be better to introduce the overhead only for the affected
> > cpu models but I guess this is also acceptable. Would it be too
> > complicated to use alternatives for that?
> 
> The patch as it stands ends up doing a one-instruction change in
> pte_none().  It goes from
> 
>     64c8:       48 85 ff                test   %rdi,%rdi
> 
> to
> 
>     64a8:       48 f7 c7 9f ff ff ff    test   $0xffffffffffffff9f,%rdi
> 
> So it essentially eats 4 bytes of icache more than it did before.  But,
> it's the same number of instructions, and I can't imagine that the CPU
> will have any more trouble with a test against an immediate than a test
> against 0.

I see. Thanks for the clarification.

> We could theoretically do alternatives for this, but we would at *best*
> end up with 4 bytes of noops.  So, unless the processor likes decoding 4
> noops better than 4 bytes of immediate as part of an instruction, we'll
> not win anything.  *Plus* the ugliness of the assembly that we'll need
> to have the compiler guarantee that the PTE ends up in %rdi.

Agreed!
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/4] x86, pagetable: ignore A/D bits in pte/pmd/pud_none() Michal Hocko <mhocko@kernel.org> - 2016-07-13 17:30 +0200
  Re: [PATCH 2/4] x86, pagetable: ignore A/D bits in pte/pmd/pud_none() Dave Hansen <dave@sr71.net> - 2016-07-13 17:50 +0200
    Re: [PATCH 2/4] x86, pagetable: ignore A/D bits in pte/pmd/pud_none() Michal Hocko <mhocko@kernel.org> - 2016-07-14 08:20 +0200

csiph-web