Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6204773ybv; Wed, 12 Feb 2020 07:55:02 -0800 (PST) X-Google-Smtp-Source: APXvYqw73iZJVsJgIW9x4pGlm/7L/IJRW0VvfJGnSh2fncyujIZtyZ4H9GH9Y/b47cpUkKX4yk86 X-Received: by 2002:a9d:7a56:: with SMTP id z22mr9280604otm.201.1581522902204; Wed, 12 Feb 2020 07:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581522902; cv=none; d=google.com; s=arc-20160816; b=r7VknPJbu8SsflXe57AjnkQV/Qo5fRnuV/3SzqH+HjvGnGn5NzXmudN5yPZOJZ8ShQ X4Rvwtz3TlFD9KQk77JJ6aQBl9ar7TkX90sJIhYiMPiPlpsSAXl1GSZexMcdmgVS9kIO d4W5rRM0BnG1x/ik/XwuBI6FwSSe4tv+lmdx4pxDuuN0yYQPjt4OMQC5HFO8zf/U/xr2 qeLR+Z+yDN7iGxgEeON4Vxt02r1G6Hw1XnnpmCByQwMNOoV3t0ZoYRfbPtpcmi3aDuhn vEChOmAgTzRWUF9oB43ByJefud5sqXpcV6XZhmgGQLFfeFsVSGNUscdAqtafm6Tz5Rny 4M/w== 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=I78sEJ8+ptaFjhSR0f/UOcUJHo+xxWDSJ6PGpnWy2jA=; b=Dbgm4fLcztsbyEKG9r3ivK8gDm00RPVcO66jRYcXEoXT1WsLTt6NCrHaynP//XCpUO qr2bTaO3JmiOLapfxBOVS87jE7MHcaRdnHNpdkiATb/9u67PiJjvI/NJUhE5vdZhkz2r UKHVOf1MshGTFIRXFZg5YOfqY4O/CQ5idOvfQKpPmwhRyb9/9Lm3WR7qUzWcmdJhq3h2 R6NP+Ia+7i5hO+JF7i79dmWIcfYAO+4VthDhn98Gl8wu8kbX19dpRONTrjtilzENo/4t SHutqvQWHWpUHh0hyIujfm8FuELOH1LOjLgV1GmW4CoIAS1nik/DHiSXLL3ssksOdQS+ wvuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=aAolVHgx; 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 x20si3328511oix.155.2020.02.12.07.54.50; Wed, 12 Feb 2020 07:55:02 -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=aAolVHgx; 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 S1728551AbgBLPxV (ORCPT + 99 others); Wed, 12 Feb 2020 10:53:21 -0500 Received: from merlin.infradead.org ([205.233.59.134]:34774 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727458AbgBLPxU (ORCPT ); Wed, 12 Feb 2020 10:53:20 -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=I78sEJ8+ptaFjhSR0f/UOcUJHo+xxWDSJ6PGpnWy2jA=; b=aAolVHgx06P+LyOsg4e1QFeLQO pEH2ZkVZkDAChnLpn2F7UjN+8aAl5G5iLMiQho18nhIs5C3ZGq5tuvYmG8c2I36BjVtN0BGFuK9Et kQBtDgqYPw5vx1rbOIxjoq0PBuDYEDZsMfdpHeJTy3SrQUUd+1tJPQzhzVj+jxb+h5iRxhJzukjUb 79+lHj+yHwA1dGqwDE7Y/Qum1Usy+OHYQsW3WL3F6iWSw/Y1WYShGh5+1yqVog6ZAWn4iYhOrPse0 i0UE878SuDcL1wrmejG7Bjyts2pD1slBEeq6cn1lV8BCvfP6VXSuRr3870DAD4JsPXtxsHl3Cdr+L VZPgbRHA==; 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 1j1uK7-0004NF-GR; Wed, 12 Feb 2020 15:53:11 +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 5E41E300E0C; Wed, 12 Feb 2020 16:51:20 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8C3EF203A89A7; Wed, 12 Feb 2020 16:53:09 +0100 (CET) Date: Wed, 12 Feb 2020 16:53:09 +0100 From: Peter Zijlstra To: Michal Simek Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu, git@xilinx.com, arnd@arndb.de, Stefan Asserhall , Greg Kroah-Hartman , Masahiro Yamada , Will Deacon Subject: Re: [PATCH 3/7] microblaze: Define SMP safe bit operations Message-ID: <20200212155309.GA14973@hirez.programming.kicks-ass.net> References: <6a052c943197ed33db09ad42877e8a2b7dad6b96.1581522136.git.michal.simek@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a052c943197ed33db09ad42877e8a2b7dad6b96.1581522136.git.michal.simek@xilinx.com> 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 Wed, Feb 12, 2020 at 04:42:25PM +0100, Michal Simek wrote: > From: Stefan Asserhall > > For SMP based system there is a need to have proper bit operations. > Microblaze is using exclusive load and store instructions. > > Signed-off-by: Stefan Asserhall > Signed-off-by: Michal Simek > +/* > + * clear_bit doesn't imply a memory barrier > + */ > +#define smp_mb__before_clear_bit() smp_mb() > +#define smp_mb__after_clear_bit() smp_mb() These macros no longer exist. Also, might I draw your attention to: include/asm-generic/bitops/atomic.h This being a ll/sc arch, I'm thinking that if you do your atomic_t implementation right, the generic atomic bitop code should be near optimal.