From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12780 Path: news.gmane.org!.POSTED!not-for-mail From: Patrick Oppenlander Newsgroups: gmane.linux.lib.musl.general Subject: Re: Some questions Date: Mon, 30 Apr 2018 13:55:16 +1000 Message-ID: References: <20180430031653.GI1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1525060408 3059 195.159.176.226 (30 Apr 2018 03:53:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 30 Apr 2018 03:53:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12796-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 30 05:53:24 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fCzsO-0000gD-MD for gllmg-musl@m.gmane.org; Mon, 30 Apr 2018 05:53:20 +0200 Original-Received: (qmail 3773 invoked by uid 550); 30 Apr 2018 03:55:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3749 invoked from network); 30 Apr 2018 03:55:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ZjeIpFdXWXUBxZJ8u27RT+rRNE0OCZICacrQ0n2o8J0=; b=cwn4ptmpF1Onc2PiO8dpVD9aAso4Bj2+siPGABr/1lr1IiaU30+M5cldoOHjWQsjn3 maWhL8zV/3Ksr+fgUa9UPHy1tH6Kh/GjFRj+JrFzm/lg0FeutIwPv9397x3zH0qEFmRC UlFW0tGOA3fUT+WYg2+silCa0tsbcCwUQPIXXDRZ+2vRBnTfnJ0GCIPmXiTJh2R4qI/Q ISesT7n9MVcLxaWxSgwW1PK1u14sgUAqFZ/iuAKT8XKhMzJAmgJFvWSwPjkO5LMxrJO+ zAg7njuavOnAeIiBzJYyjsRUM80jtaV7qzKcuz+l5jbnNPwNzZvvxyA5dQTKIDdkIgby 9bNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ZjeIpFdXWXUBxZJ8u27RT+rRNE0OCZICacrQ0n2o8J0=; b=JzNhb8nIeAajp2mN9C+2UkawsDVUO0aSjpcZ78iRkGopK2wUGEWsK6uXNwkp2yvO3R 9yFoZPB33NEHwUxGZ7O9CWvI42jaYtaDOs5fyDxRloElJ8jhk/rcXoV+RJleKdwZ420M WgC3DBK8eNU36D+eFV5313tL5b3cqIJk8D+ho5O5qSikXkqNDf3nRQi27SMT3GGgh3m3 khAaL5jwH4TqYvtNnng/93xwNh0jhGiUeEyaUCIBdvieIzOb49IpbrzcrKEdOphTQ3ok iMTX1SrC+tJ69DoFxL7hDCrnJhrUVhOqMxr+RNHdSmbDH0VHAUA4w2cZYv7cBMUKOxJk E0uw== X-Gm-Message-State: ALQs6tBpWCRAC9e38GUfOF8Gb/q8keKx2y0zxWwoa5Ez2sCgH6Pla4sN Y/EJCmg2GcGGhZrjwUQz/zdOmINSlbGmWNCwebsBUg== X-Google-Smtp-Source: AB8JxZo+r1ct/+/AQNGCSn5NYMg/cuMbhDTy/B4KNaszQQ9VNMJ4IEEArGhafYGTh/64HbIJL41JW8LubZvbA5NvKrs= X-Received: by 2002:a0c:b4a2:: with SMTP id c34-v6mr10077740qve.70.1525060516437; Sun, 29 Apr 2018 20:55:16 -0700 (PDT) In-Reply-To: <20180430031653.GI1392@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12780 Archived-At: On Mon, Apr 30, 2018 at 1:16 PM, Rich Felker wrote: > On Mon, Apr 30, 2018 at 12:52:06PM +1000, Patrick Oppenlander wrote: >> - Is there a way that spinlocks could be disabled or bypassed on >> uniprocessor systems? > > Whether locks are needed is a matter of whether there are multiple > threads, not whether it's uniprocessor or multiprocessor. For some > things where it's likely to matter (stdio, malloc, some other > internals), locks are already optimized out when there is only one > thread. In other cases it was deemed either too costly/difficult or > irrelevant to overall performance. I was talking about the case of a uniprocessor system running a multi theaded process. In that case the "spin" part of spinlock just burns time & electrons. The "lock" part obviously can't be omitted. Calling straight through to the kernel is the most efficient thing to do. Patrick