From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 1 22:04:40 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 577AD16A4CE; Tue, 1 Mar 2005 22:04:40 +0000 (GMT) Received: from intranet.ru (intranet.ru [212.164.71.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 314B643D53; Tue, 1 Mar 2005 22:04:38 +0000 (GMT) (envelope-from denus@ngs.ru) Received: from [172.16.0.10] (HELO smtp.ngs.ru) by intranet.ru (CommuniGate Pro SMTP 4.2.4) with ESMTP id 205170427; Wed, 02 Mar 2005 04:05:59 +0600 Received: from ngs.ru (unknown [83.237.135.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.ngs.ru (Postfix) with ESMTP id E0D18774CC6; Wed, 2 Mar 2005 04:04:33 +0600 (NOVT) Message-ID: <4224E73E.6080105@ngs.ru> Date: Wed, 02 Mar 2005 01:05:50 +0300 From: Denis Ustimenko User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20041215 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: John Baldwin References: <4223A1D1.6000104@ngs.ru> <200502281606.50074.peter@wemm.org> <200503011331.17677.jhb@FreeBSD.org> In-Reply-To: <200503011331.17677.jhb@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@FreeBSD.org Subject: Re: TDF_NEEDRESCHED when extending pcb on x86 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2005 22:04:40 -0000 John Baldwin wrote: > On Monday 28 February 2005 07:06 pm, Peter Wemm wrote: > >>On Monday 28 February 2005 02:57 pm, Denis Ustimenko wrote: >> >>>The problem occurs when we extend pcb and set TDF_NEEDRESCHED bit hoping >>>that thread will be rescheduled and new TSS will be loaded. But >>>sched_switch function skips cpu_switch when thread was not changed and >>>ltr is not executed. >> >>I think it would be better to fix the semantics of TDF_NEEDRESCHED. I was >>thinking that mi_switch could negate the cpu_switch optimization if >>TDF_NEEDRESCHED was set. That would avoid duplicating the internal >>knowledge of the pcb/tss/etc handling in this code. > > > Forcing a context switch is a rather round-about way of getting ltr to be > executed though. We already have intimate knowledge of TSS, etc. in this > file anyway, so I wonder if just doing the ltr() directly is the better > approach? > Yes, John, I think it's better to load TR directly. Usage of TDF_NEEDRESCHED for loading TR is the only platform specific resort of this bit, so elimination of it makes design more clear and we do not need drop out cpu_switch optimization. -- Best regards Denis