From: Hugh Dickins <hughd@google.com>
To: Nadav Amit <namit@vmware.com>
Cc: Hugh Dickins <hughd@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"x86@kernel.org" <x86@kernel.org>, Linux MM <linux-mm@kvack.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] x86/mm/tlb: ignore f->new_tlb_gen when zero
Date: Fri, 8 Jul 2022 13:48:46 -0700 (PDT) [thread overview]
Message-ID: <23b7e5f8-8b38-51aa-fecd-3ed92118af72@google.com> (raw)
In-Reply-To: <49C173B5-CF12-44AA-BE00-689E99E65C23@vmware.com>
[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]
On Fri, 8 Jul 2022, Nadav Amit wrote:
> On Jul 8, 2022, at 12:21 PM, Hugh Dickins <hughd@google.com> wrote:
>
> > ⚠ External Email
> >
> > On Thu, 7 Jul 2022, Nadav Amit wrote:
> >
> >> From: Nadav Amit <namit@vmware.com>
> >>
> >> Commit aa44284960d5 ("x86/mm/tlb: Avoid reading mm_tlb_gen when
> >> possible") introduced an optimization of skipping the flush if the TLB
> >> generation that is flushed (as provided in flush_tlb_info) was already
> >> flushed.
> >>
> >> However, arch_tlbbatch_flush() does not provide any generation in
> >> flush_tlb_info. As a result, try_to_unmap_one() would not perform any
> >> TLB flushes.
> >>
> >> Fix it by checking whether f->new_tlb_gen is nonzero. Zero value is
> >> anyhow is an invalid generation value.
> >>
> >> In addition, add the missing unlikely() and jump to get tracing right.
> >>
> >> Fixes: aa44284960d5 ("x86/mm/tlb: Avoid reading mm_tlb_gen when possible")
> >> Reported-by: Hugh Dickins <hughd@google.com>
> >> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> >> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> >> Cc: Andy Lutomirski <luto@kernel.org>
> >> Signed-off-by: Nadav Amit <namit@vmware.com>
> >
> > Thanks a lot for your rapid response and thinking it through
> > (before I got around to any "nopcid" or "nopti" experiments).
> >
> > I've been testing this one for a few hours now, and no problems seen.
> > I expect you'll be sending another version, maybe next week, meeting
> > Dave's concerns; but wanted to reassure that you have correctly
> > identified the issue and fixed it with this - thanks.
>
> Thanks, Hugh. Sorry again for my mistake.
>
> Can I please have your “Tested-by”?
Sure, let me scrabble around in my box of tags, yes, here's one:
Tested-by: Hugh Dickins <hughd@google.com>
prev parent reply other threads:[~2022-07-08 20:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 0:30 [PATCH] x86/mm/tlb: ignore f->new_tlb_gen when zero Nadav Amit
2022-07-08 11:40 ` David Hildenbrand
2022-07-08 15:13 ` Dave Hansen
2022-07-08 16:54 ` Nadav Amit
2022-07-08 17:01 ` Dave Hansen
2022-07-08 17:09 ` Nadav Amit
2022-07-08 18:03 ` Nadav Amit
2022-07-08 14:49 ` Dave Hansen
2022-07-08 17:04 ` Nadav Amit
2022-07-08 18:54 ` Dave Hansen
2022-07-11 5:19 ` Nadav Amit
2022-07-08 19:21 ` Hugh Dickins
2022-07-08 20:02 ` Nadav Amit
2022-07-08 20:48 ` Hugh Dickins [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=23b7e5f8-8b38-51aa-fecd-3ed92118af72@google.com \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=namit@vmware.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox