Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Mar 2005 01:05:50 +0300
From:      Denis Ustimenko <denus@ngs.ru>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: TDF_NEEDRESCHED when extending pcb on x86
Message-ID:  <4224E73E.6080105@ngs.ru>
In-Reply-To: <200503011331.17677.jhb@FreeBSD.org>
References:  <4223A1D1.6000104@ngs.ru> <200502281606.50074.peter@wemm.org> <200503011331.17677.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4224E73E.6080105>