Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752624AbbKBJ1D (ORCPT ); Mon, 2 Nov 2015 04:27:03 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:59095 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbbKBJ06 (ORCPT ); Mon, 2 Nov 2015 04:26:58 -0500 Date: Mon, 2 Nov 2015 10:26:54 +0100 From: Peter Zijlstra To: Vineet Gupta Cc: Noam Camus , "linux-snps-arc@lists.infradead.org" , "cmetcalf@ezchip.com" , "gilf@ezchip.com" , "talz@ezchip.com" , "linux-kernel@vger.kernel.org" , Gilad Ben Yossef Subject: Re: [PATCH v1 19/20] ARC: [plat-eznps] replace sync with proper cpu barrier Message-ID: <20151102092654.GM17308@twins.programming.kicks-ass.net> References: <1446297327-16298-1-git-send-email-noamc@ezchip.com> <1446297327-16298-20-git-send-email-noamc@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1506 Lines: 34 On Mon, Nov 02, 2015 at 07:48:54AM +0000, Vineet Gupta wrote: > Since u bring this up - I think we don't need the original SYNC and/or > SMT thread schedule at all. The SYNC here is a historic relic at best > and we can get rid of it per reasoning below: > > In UP context it is obviously useless, why would we want to stall the > core for all updates to stack memory of t0 to complete before loading > kernel ode callee registers from t1 stack's memory. > > In SMP, we could have a potential race in which outdoing task could be > concurrently picked for running, thus the writes to stack here need to > be visible before the reads from stack on other core. But I think > since this is the same rq, there would be a taken spinlock and once a > core gives it up, an smp barrier would come naturally. > > Peter do u concur ? I'm still somewhat jet-lagged, but I think the below reference should answer your question: lkml.kernel.org/r/20150917130125.GL3816@twins.programming.kicks-ass.net I (still) need to update that patch and send it out again. But I think it answers your question; we do not rely on arch code to provide barriers for the generic code. Now, if for some reason the arch code has further constraints, then maybe, but I don't think so. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/