From owner-freebsd-mips@FreeBSD.ORG Tue Jun 4 08:19:24 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D704480B for ; Tue, 4 Jun 2013 08:19:24 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF4110F7 for ; Tue, 4 Jun 2013 08:19:23 +0000 (UTC) Received: (qmail 96941 invoked from network); 4 Jun 2013 09:16:43 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 4 Jun 2013 09:16:43 -0000 Message-ID: <51ADA308.6040904@freebsd.org> Date: Tue, 04 Jun 2013 10:19:20 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ed Schouten Subject: Re: Kernelspace C11 atomics for MIPS References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-mips@freebsd.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2013 08:19:24 -0000 On 03.06.2013 16:04, Ed Schouten wrote: > Hi, > > As of r251230, it should be possible to use C11 atomics in > kernelspace, by including ! Even when not using Clang > (but GCC 4.2), it is possible to use quite a large portion of the API. I'm a bit wary of *kernel* developers using C11-native atomics as opposed to our own atomic API. This could lead to a proliferation of home-grown, more or less correctly working, locks and variants thereof (mostly less correct). Atomics and locks are difficult enough to get right and reason about even with our rather good API and I scream in fear thinking about everyone(tm) doing their own "optimized" lock or even forgoing it because "it's atomic". I would even propose to go as far as disbarring the use of C11 atomics in the kernel other than inside the officially supported lock API. -- Andre