Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 22 Aug 2002 12:06:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 22 Aug 2002 12:06:51 -0400 Received: from [195.223.140.120] ([195.223.140.120]:31588 "EHLO penguin.e-mind.com") by vger.kernel.org with ESMTP id ; Thu, 22 Aug 2002 12:06:50 -0400 Date: Thu, 22 Aug 2002 18:12:16 +0200 From: Andrea Arcangeli To: "Martin J. Bligh" Cc: Linus Torvalds , Benjamin LaHaise , Alan Cox , Chris Friesen , Pavel Machek , linux-kernel@vger.kernel.org, linux-aio@kvack.org Subject: Re: aio-core why not using SuS? [Re: [rfc] aio-core for 2.5.29 (Re: async-io API registration for 2.5.29)] Message-ID: <20020822161216.GQ1117@dualathlon.random> References: <2159880183.1029535922@[10.10.2.3]> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2159880183.1029535922@[10.10.2.3]> User-Agent: Mutt/1.3.27i X-GnuPG-Key-URL: http://e-mind.com/~andrea/aa.gnupg.asc X-PGP-Key-URL: http://e-mind.com/~andrea/aa.asc Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1936 Lines: 32 On Fri, Aug 16, 2002 at 10:12:04PM -0700, Martin J. Bligh wrote: > Yes, I guess you'd have to TLB flush on the context switch with > shared mm's which you don't have to do now, and you'd use an extra Flushing tlb across thread context switch sounds the worst part. One of the main reasons to use threads is to avoid tlb flushing across context switches and to reduce the context switch nearly to a longjump through kernel space (i.e. use threads instead of segmentation to skip the tlb flushes across context switches). If we had ASN on the x86 that wouldn't be such a big problem, a tlb flush in the common case would just bump the current ASN, however the main lack of the x86 architecture is the lack of tlb tagging (hope it'll be fixed soon, it's definitely fixable without breaking backwards compatibility so eventually some x86 hardware vendor will wakeup and the others will have to follow). So I would guess adding some per-VM locking like a mm->kmap_sem to serialize the use of the per-VM pool of kmaps, sounds better unless we get address space numbers on 32bit x86, over days of computations there are going to be much more context switches than page faults, however it also depends on the workload. The point about needing the tlb flush anyways for replicated .text is valid, however not all the SMP highmem boxes are necessiarly NUMA boxes too, and if they aren't NUMA I guess they prefer not to flush the tlb over context switches. You may probably want to do some measurements about the overhead of tlb flushes by adding a __flush_tlb() in switch_to across two tasks (not across kernel threads though) to simulate the behaviour of your proposed per-task PMD design. Andrea - 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/