On Thu, May 30, 2019 at 12:56 AM Zhenzhong Duan
<zhenzhong.duan@xxxxxxxxxx> wrote:
This is a small optimization to stale TLB flush, if there is one new TLBI think this is invalid because:
flush, let it choose to do partial or full flush. or else, the stale
flush take over and do full flush.
+ if (unlikely(f->new_tlb_gen <= local_tlb_gen &&We do indeed know that the TLB will get flushed eventually, but we're
+ local_tlb_gen + 1 == mm_tlb_gen)) {
+ /*
+ * For stale TLB flush request, if there will be one new TLB
+ * flush coming, we leave the work to the new IPI as it knows
+ * partial or full TLB flush to take, or else we do the full
+ * flush.
+ */
+ trace_tlb_flush(reason, 0);
+ return;
actually providing a stronger guarantee that the TLB will be
adequately flushed by the time we return. Otherwise, after
flush_tlb_mm_range(), there will be a window in which the TLB isn't
flushed yet.