Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp334082ybv; Thu, 13 Feb 2020 01:12:33 -0800 (PST) X-Google-Smtp-Source: APXvYqw9/Qwfzwbrmn/DXmLk578Q8nNq10XEjdkdXQW/EHhMZDBf0BwKgl6fe/0nkg/RMgliKNAJ X-Received: by 2002:aca:ebcb:: with SMTP id j194mr2277720oih.154.1581585153538; Thu, 13 Feb 2020 01:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581585153; cv=none; d=google.com; s=arc-20160816; b=HfbX06OExgyssGe0LdzFCR5W8LO6XTOQbo5iaJ5hjg74ZguDYJpYH5xDaJeThy4NOz jIYdf/0H3RJ/n5GAtnx4vcSz98SiJDhV50/aU4iyp5uQs+yWRa56+Iu0S+V39Cql//Yi VhuNj1k41USgMNT8fvLCIbxOMQvJKaHAkF4wv8QtFHi2gwWtZVDe6KUSr4hGMbdI53FC bRbFi7o+alANPlslQUp+UZ+MuXev8C9QkhrZOVcsg+9Qvgz8o6wo0E4cQr/1K69gOINW jvx2A2wEu2jazfPB/2gfE4uBRkEuouKT5gvO4VZ18fUxln+YSXLXqewTlxMP6+TR8en8 jZsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DxpiptL2pUZ6GLGMQaYrfBXAAODM92lCFecuBtl0f50=; b=n/0kOiH8AQvXHp2SH4KS8TWla8lAO9uS3zKvI95Ip6k5Z9BdChXOH7CuhliKjS5eiH 7ISjH5b1bHSp062g7pWyRK93Br9rH29+ZVAGHeXcdpNLy7nfG7ypqc5NW2E7K6H8Gq+U GMFwUAS4niQB/CRBUPq3eZKt7aqFPezGj3t0FgHR/AuFYchBtitbs+955fy+C42aa3NB 5Pdi6zcMYzP99Z8Ojtl7zLfd8ppvU4goWv1diottTAz/cIZjz5c2vyxybsZDtTlkPzbh iwL6xEBLqXIjBs0Cfi7Di/WXqLWQJFDbj6GxeVEin1sC7kArKBOEBMilnpX1WnhAu9SP mBWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FTr4ag9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si811550otn.172.2020.02.13.01.12.20; Thu, 13 Feb 2020 01:12:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FTr4ag9Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729694AbgBMJLL (ORCPT + 99 others); Thu, 13 Feb 2020 04:11:11 -0500 Received: from merlin.infradead.org ([205.233.59.134]:40164 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729655AbgBMJLK (ORCPT ); Thu, 13 Feb 2020 04:11:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DxpiptL2pUZ6GLGMQaYrfBXAAODM92lCFecuBtl0f50=; b=FTr4ag9Qxwa1NG8zi/HRSHf9Hz O6V6wVy9IdVnkYJc43lq7Nh+uUCTGy1hXehEixF7g+CtmU+I1I6jlI0wbdj9ykzDI1wgLZaDBWdfG HLyRMd941f6JVZu6Y7e+O5xLqGHxRZXZ6maHOQeE+NtzsaKbQu9M51ltWJkdZ1nW0xwOZV/UYf1Kc 5Sf3vrhkFO+1Q+pr3NFO6OqJlV/YwHQPSZTLh78ZWSo+aA4IYfkE367OMQrOr82XuWL6cM7Ou1t25 kPT6w5ONGr91aEYwuDEm43vTrtH4AjeDjWY6yu2W0nD/hwneb8IzbUJ78ER9wF2EgsMMqYKaE53SO xq0Qlt7w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2AWV-0006O1-3p; Thu, 13 Feb 2020 09:11:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A960C30066E; Thu, 13 Feb 2020 10:09:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3562D20206D69; Thu, 13 Feb 2020 10:11:01 +0100 (CET) Date: Thu, 13 Feb 2020 10:11:01 +0100 From: Peter Zijlstra To: Stefan Asserhall Cc: Michal Simek , "linux-kernel@vger.kernel.org" , "monstr@monstr.eu" , git , "arnd@arndb.de" , Greg Kroah-Hartman , Masahiro Yamada , Will Deacon Subject: Re: [PATCH 3/7] microblaze: Define SMP safe bit operations Message-ID: <20200213091101.GM14897@hirez.programming.kicks-ass.net> References: <6a052c943197ed33db09ad42877e8a2b7dad6b96.1581522136.git.michal.simek@xilinx.com> <20200212155309.GA14973@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 13, 2020 at 09:01:21AM +0000, Stefan Asserhall wrote: > The comment in the generic bitops.h says "You should recode these in the > native assembly language, if at all possible". I don't think using the generic > implementation will be as efficient as the current arch specific one. That is a very crusty old recommendation. Please look at the compiler generated code. We've extended the atomic_t operations the past few years and Will wrote the generic atomic bitops for Arm64, we're looking to convert more LL/SC archs to them. There is currently one known issue with it, but Will has a patch-set pending to solve that (IIRC that only matters if you have stack protector on). Also see this thread: https://lkml.kernel.org/r/875zimp0ay.fsf@mpe.ellerman.id.au And these patches: https://lkml.kernel.org/r/20200123153341.19947-1-will@kernel.org