Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755550Ab1BCED4 (ORCPT ); Wed, 2 Feb 2011 23:03:56 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:47382 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754971Ab1BCEDz (ORCPT ); Wed, 2 Feb 2011 23:03:55 -0500 MIME-Version: 1.0 In-Reply-To: References: <1296677247.4418.103.camel@sbsiddha-MOBL3.sc.intel.com> From: Linus Torvalds Date: Wed, 2 Feb 2011 20:03:30 -0800 Message-ID: Subject: Re: [patch] x86, mm: avoid stale tlb entries by clearing prev mm_cpumask after switching mm To: Suresh Siddha Cc: "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , LKML , "Mallick, Asit K" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1370 Lines: 34 On Wed, Feb 2, 2011 at 5:55 PM, Linus Torvalds wrote: > On Wed, Feb 2, 2011 at 12:07 PM, Suresh Siddha > wrote: >> For the prev mm that is handing over the cpu to another mm, clear the cpu >> from the mm_cpumask(prev) after the cr3 is changed. >> >> Otherwise, clearing the mm_cpumask early will avoid the flush tlb IPI's while >> the cr3 and TLB's are still pointing to the prev mm. And this window can lead >> to the stale (global) TLB entries. > > Why? > > This looks pointless. Explain why this matters. Global entries are > never per-mm, so any global entries can never care about the > mm_cpumask. > > And for any normal entries it doesn't matter if the IPI gets lost, > since the TLB will be flushed (immediately afterwards) by the cr3 > write. Actually, for normal entries I could well imagine the code that wants to do a flush before freeing the page caring. So I think the _patch_ may be correct, but the changelog is definitely not correct, and needs serious surgery to explain what the bug that this fixes actually is. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/