Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 2010 13:42:42 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Attilio Rao <attilio@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r211176 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <4C62E112.5090206@FreeBSD.org>
In-Reply-To: <AANLkTimczmkAkqTnCDmHh1otsX1OuVggeEA8NkpY3bYO@mail.gmail.com>
References:  <201008111051.o7BApRp4028538@svn.freebsd.org>	<4C62DADF.1000202@FreeBSD.org> <AANLkTimczmkAkqTnCDmHh1otsX1OuVggeEA8NkpY3bYO@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Attilio Rao wrote:
> 2010/8/11 John Baldwin <jhb@freebsd.org>:
>> Attilio Rao wrote:
>>> Author: attilio
>>> Date: Wed Aug 11 10:51:27 2010
>>> New Revision: 211176
>>> URL: http://svn.freebsd.org/changeset/base/211176
>>>
>>> Log:
>>>  IPI handlers may run generally with interrupts disabled because they
>>>  are served via an interrupt gate.
>>>    However, that doesn't explicitly prevent preemption and thread
>>>  migration thus scheduler pinning may be necessary in some handlers.
>>>  Fix that.
>>>    Tested by:  gianni
>>>  MFC after:    1 month
>> Actually that does prevent preemption if you do not call any code that would
>> schedule a thread.  I think this change is all safe to revert.
> 
> Do you recall, then, why lapic_handle_timer() does critical section?
> It seems to be catered by interrupt gate as well, and I don't see any
> point re-enabling them explicitly.

Because hardclock() explicitly calls sched_add() via swi_sched() when 
scheduling the softclock swi.  The critical section there is just to 
ensure that the preemption to softclock happens after all of the clock 
interrupt handlers have finished.  However, PCPU_GET() does not call 
sched_add(), so it does not need to be protected.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C62E112.5090206>