Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 19 Feb 2002 12:32:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 19 Feb 2002 12:32:17 -0500 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:12051 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Tue, 19 Feb 2002 12:32:04 -0500 Date: Tue, 19 Feb 2002 09:29:04 -0800 (PST) From: Linus Torvalds To: Daniel Phillips cc: Rik van Riel , Hugh Dickins , , Kernel Mailing List , , Robert Love , , Andrew Morton , , Subject: Re: [RFC] Page table sharing In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Feb 2002, Daniel Phillips wrote: > > > > At that point you might as well make the TLB shootdown global (ie you keep > > track of a mask of CPU's whose TLB's you want to kill, and any pmd that > > has count > 1 just makes that mask be "all CPU's"). > > How do we know when to do the global tlb flush? See above. Basically, the algorithm is: invalidate_cpu_mask = 0; .. for each page swapped out .. pte = ptep_get_and_clear(ptep); save_pte_and_mm(pte_page(pte)); mask = mm->cpu_vm_mask; if (page_count(pmd_page) > 1) mask = ~0UL; invalidate_cpu_mask |= mask; and then at the end you just do flush_tlb_cpus(invalidate_cpu_mask); for_each_page_saved() { free_page(page); } (yeah, yeah, add cache coherency etc). 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/