From: Dave Hansen <dave.hansen@intel.com>
To: Nadav Amit <nadav.amit@gmail.com>,
linux-kernel@vger.kernel.org, Hugh Dickins <hughd@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, Linux MM <linux-mm@kvack.org>,
Nadav Amit <namit@vmware.com>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH v2] x86/mm/tlb: ignore f->new_tlb_gen when zero
Date: Tue, 19 Jul 2022 09:13:23 -0700 [thread overview]
Message-ID: <1648fbf5-0659-b480-1725-8a30eba51974@intel.com> (raw)
In-Reply-To: <20220710232837.3618-1-namit@vmware.com>
On 7/10/22 16:28, 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. To avoid future confusions,
> introduce TLB_GENERATION_INVALID constant and use it properly. Add some
> assertions to check no partial flushes are done with
> TLB_GENERATION_INVALID or when f->mm is NULL, since this does not make
> any sense.
>
> In addition, add the missing unlikely().
I've applied this:
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/mm&id=8f1d56f64f8d6b80dea2d1978d10071132a695c5
Please double-check that my rewording of the commit message looks good
to you. I also replaced the VM_BUG_ON()'s with warnings. Screwing up
TLB flushing isn't great, but it's also not worth killing the system.
prev parent reply other threads:[~2022-07-19 16:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-10 23:28 Nadav Amit
2022-07-11 17:39 ` Nadav Amit
2022-07-13 0:33 ` Nadav Amit
2022-07-13 0:49 ` Hugh Dickins
2022-07-13 0:50 ` Nadav Amit
2022-07-19 16:13 ` Dave Hansen [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=1648fbf5-0659-b480-1725-8a30eba51974@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nadav.amit@gmail.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