[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUi44LiuyizVh=bfntnvebiEVbvJz+7AwdyT647CJSZcg@mail.gmail.com>
Date: Wed, 14 Jun 2017 15:42:59 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Nadav Amit <nadav.amit@...il.com>,
Rik van Riel <riel@...hat.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Banman <abanman@....com>, Mike Travis <travis@....com>,
Dimitri Sivanich <sivanich@....com>,
Juergen Gross <jgross@...e.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: Re: [PATCH v2 05/10] x86/mm: Rework lazy TLB mode and TLB freshness tracking
On Wed, Jun 14, 2017 at 3:33 PM, Dave Hansen <dave.hansen@...el.com> wrote:
> On 06/13/2017 09:56 PM, Andy Lutomirski wrote:
>> - if (cpumask_test_cpu(cpu, &batch->cpumask))
>> + if (cpumask_test_cpu(cpu, &batch->cpumask)) {
>> + local_irq_disable();
>> flush_tlb_func_local(&info, TLB_LOCAL_SHOOTDOWN);
>> + local_irq_enable();
>> + }
>> +
>
> Could you talk a little about why this needs to be local_irq_disable()
> and not preempt_disable()? Is it about the case where somebody is
> trying to call flush_tlb_func_*() from an interrupt handler?
It's to prevent flush_tlb_func_local() and flush_tlb_func_remote()
from being run concurrently, which would cause flush_tlb_func_common()
to be reentered. Either we'd need to be very careful in
flush_tlb_func_common() to avoid races if this happened, or we could
just disable interrupts around flush_tlb_func_local(). The latter is
fast and easy.
--Andy
Powered by blists - more mailing lists