Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161054AbXBVLxd (ORCPT ); Thu, 22 Feb 2007 06:53:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161061AbXBVLxd (ORCPT ); Thu, 22 Feb 2007 06:53:33 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:47982 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161054AbXBVLxc (ORCPT ); Thu, 22 Feb 2007 06:53:32 -0500 Subject: Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3 From: Arjan van de Ven To: Evgeniy Polyakov Cc: Ingo Molnar , Ulrich Drepper , linux-kernel@vger.kernel.org, Linus Torvalds , Christoph Hellwig , Andrew Morton , Alan Cox , Zach Brown , "David S. Miller" , Suparna Bhattacharya , Davide Libenzi , Jens Axboe , Thomas Gleixner In-Reply-To: <20070222113148.GA3781@2ka.mipt.ru> References: <20070221211355.GA7302@elte.hu> <20070221233111.GB5895@elte.hu> <45DCD9E5.2010106@redhat.com> <20070222074044.GA4158@elte.hu> <20070222113148.GA3781@2ka.mipt.ru> Content-Type: text/plain Organization: Intel International BV Date: Thu, 22 Feb 2007 12:52:39 +0100 Message-Id: <1172145159.3531.253.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 (2.8.2.1-3.fc6) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 33 > It is not a TUX anymore - you had 1024 threads, and all of them will be > consumed by tcp_sendmsg() for slow clients - rescheduling will kill a > machine. I think it's time to make a split in what "context switch" or "reschedule" means... there are two types of context switch: 1) To a different process. This means teardown of the TLB, going to a new MMU state, saving FPU state etc etc etc. This is obviously quite expensive 2) To a thread of the same process. No TLB flush no new MMU state, effectively all it does is getting a new task struct on the kernel side, and a new ESP/EIP pair on the userspace side. If there is FPU code involved that gets saved as well. Number 1 is very expensive and that is what is really worrying normally; number 2 is a LOT lighter weight, and while Linux is a bit heavy there, it can be made lighter... there's no fundamental reason for it to be really expensive. -- if you want to mail me at work (you don't), use arjan (at) linux.intel.com Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org - 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/