From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 22 17:46:17 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3820C106566B for ; Sat, 22 Sep 2012 17:46:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8105C8FC0A for ; Sat, 22 Sep 2012 17:46:16 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA07720 for ; Sat, 22 Sep 2012 20:46:15 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TFTmQ-000NWW-MQ for freebsd-hackers@freebsd.org; Sat, 22 Sep 2012 20:46:14 +0300 Message-ID: <505DF965.2020506@FreeBSD.org> Date: Sat, 22 Sep 2012 20:46:13 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120913 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-hackers References: <50587635.8070007@FreeBSD.org> In-Reply-To: <50587635.8070007@FreeBSD.org> X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: cpu_spinwait in cngetc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:46:17 -0000 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. -- Andriy Gapon