Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Sep 2012 22:55:35 -0700
From:      Julian Elischer <julian@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: cpu_spinwait in cngetc
Message-ID:  <505EA457.6070906@freebsd.org>
In-Reply-To: <505DF965.2020506@FreeBSD.org>
References:  <50587635.8070007@FreeBSD.org> <505DF965.2020506@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/22/12 10:46 AM, Andriy Gapon wrote:
> on 18/09/2012 16:25 Andriy Gapon said the following:
>> (Why[*]) Would anyone object to a change like this?
>>
>> diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
>> index 5346bc3..d17846a 100644
>> --- a/sys/kern/kern_cons.c
>> +++ b/sys/kern/kern_cons.c
>> @@ -384,7 +384,7 @@ cngetc(void)
>>   	if (cn_mute)
>>   		return (-1);
>>   	while ((c = cncheckc()) == -1)
>> -		;
>> +		cpu_spinwait();
>>   	if (c == '\r')
>>   		c = '\n';		/* console input is always ICRNL */
>>   	return (c);
>>
>> [*] :-)
>>
> I would to re-ping with this question.
> Is there any architecture where a cpu_spinwait could cause a surprise?
> Or is universally safe?
>
> The most visible place which this change can affect is ddb prompt.
>
>

looks like the right thing to do



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?505EA457.6070906>