Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp393932pxu; Tue, 6 Oct 2020 08:54:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVX824sgMT+qJIJMI5vyOku1qjZSIjOdy2NjeFSQg967thSPGh/PIwspJodDx7xB36Ejnc X-Received: by 2002:a17:906:e0c4:: with SMTP id gl4mr175893ejb.172.1601999668302; Tue, 06 Oct 2020 08:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601999668; cv=none; d=google.com; s=arc-20160816; b=BN5qHCodcHzFf1cgFHf2Rmd3WpVohAnNTCUX6Pm2lSUZz9YZTAfnZx+6+vEqtNLkIV Lb3tZHOIR6qDi0ZAdzPgT+2LCANCoJHPMSjnlfXaSXZRDcrioZ9lNAUT7wHNj0RbLbNL BYiiJrJCN53S0eutMlCg7PuFiKMyXzXUAPmX+PMWU6c9SPC0B/4kmVFvqULF/Kr3yHHa pwzswRhfVUbpcXAGiH35zIBcH1/nuu4CT2jLSBv51JAFQ8vlK2gQyNlGi3weO1azy6lu otnTcLr2ApXghqqPyMK9dHdKxg2CcMqCG6A8SKmdWaXU2k7mWqpktw/ITd+v1Ppj2ZRI O60A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=q78Mm4J4ZTn6MBVflxKonJkGOZYPxFYuhHMfXgZ/CMU=; b=ife9gQWaYmp/q896q968TM7BG8eWithGvgiwzTNmY3GQzlVAN4HSDDRgVT2Smg6TBQ tQ7MhQJ2U88bmeBGIxJTGOPuD1k4OhWvKsZ0+EjnvWMyRUFtLeV1VXDGKa5u4iYOB8cQ BmeB8EpZ14UBHfl+bNf1RLHxvjkcnFwSK6elWvwDlOThc8CIXmjb1nLn80JL4X22dRdF Gv/jKc/PoOAkzg+J7HLBuDqILVytVDMVgk3X1jud73bgjgA5zqdM/3389T9znuI1irlA E5UoGNr1tYhDJt5YWU9P0WG7AVBgSo3rZz1Fd2SQq+MyiiHIr5/chz2E4jjAbcwIdJSF Yv5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mgun+BsV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i88si2858331edd.601.2020.10.06.08.54.04; Tue, 06 Oct 2020 08:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mgun+BsV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbgJFPux (ORCPT + 99 others); Tue, 6 Oct 2020 11:50:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:36304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbgJFPux (ORCPT ); Tue, 6 Oct 2020 11:50:53 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F6D9206F7; Tue, 6 Oct 2020 15:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601999452; bh=TvsmiV/kSOvronREsSY7zNuUQtF9sAQYhFLAvwcc/zM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=mgun+BsV0rA//Mmwh1vjYZyTT/goSPLAA0MxqRsT/l2oqR+gtwtp0c5jg2hOB52uR SzXifAaaipWIEg/iikustBTW7/VcVATWPUPNxBbV6/gRR2ExABbi0SYG1bzcZvRr/M VBASUoxzgwXcNq7k2l7rBUZH5UETU+OkxnpK5w4k= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 1DD363520A89; Tue, 6 Oct 2020 08:50:52 -0700 (PDT) Date: Tue, 6 Oct 2020 08:50:52 -0700 From: "Paul E. McKenney" To: David Laight Cc: 'Nick Clifton' , Peter Zijlstra , "stern@rowland.harvard.edu" , "linux-toolchains@vger.kernel.org" , Will Deacon , "linux-kernel@vger.kernel.org" , "parri.andrea@gmail.com" , "boqun.feng@gmail.com" , "npiggin@gmail.com" , "dhowells@redhat.com" , "j.alglave@ucl.ac.uk" , "luc.maranget@inria.fr" , "akiyks@gmail.com" , "dlustig@nvidia.com" , "joel@joelfernandes.org" , "torvalds@linux-foundation.org" Subject: Re: Control Dependencies vs C Compilers Message-ID: <20201006155052.GJ29330@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201006114710.GQ2628@hirez.programming.kicks-ass.net> <3dfe7daed3c44f46a6989b6513ad7bb0@AcuMS.aculab.com> <20201006133115.GT2628@hirez.programming.kicks-ass.net> <20201006142324.GB416765@rowland.harvard.edu> <20201006144302.GY2628@hirez.programming.kicks-ass.net> <47bfda8f-304e-5283-c6d6-0753037b0b2c@redhat.com> <1dabfd1939f348198678121f94d6c9b2@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1dabfd1939f348198678121f94d6c9b2@AcuMS.aculab.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2020 at 03:37:24PM +0000, David Laight wrote: > > My suggestion as an alternative is to use assembler instead. > > That way you can guarantee that you get the instructions you > > want in the order that you want them. It should be fairly > > straightforward to create a macro or inline function that > > contains the necessary code and this can be done once and > > then used wherever the functionality is required. > > C exists because K&R got fed up of writing pdp-11 assembler. > Compared to some modern ones it is nice and easy to write > (I'm old enough to have used pdp-11.) > > You can't put control dependencies inside C asm statements. What David said! And not only are modern machine languages quite complex and strange compared to that of the PDP-11, but writing core Linux-kernel code in assembler requires writing it 25 times, once for each of the supported architectures. And even that is an underestimate because some architectures have multiple variants, for but one example, arm's multiple instruction sets. Comparing 25+ assembly languages to but two compilers most definitely motivates looking hard at doing something with the compilers. Thanx, Paul