From patchwork Tue Nov 17 11:37:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 545533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 23ACD1402D4 for ; Tue, 17 Nov 2015 22:38:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyeaq-00070Q-FB; Tue, 17 Nov 2015 11:38:36 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyeao-0006mn-CS for linux-snps-arc@lists.infradead.org; Tue, 17 Nov 2015 11:38:35 +0000 Received: from dc8secmta2.synopsys.com (dc8secmta2.synopsys.com [10.13.218.202]) by smtprelay.synopsys.com (Postfix) with ESMTP id 1BCA810C10D8; Tue, 17 Nov 2015 03:38:14 -0800 (PST) Received: from dc8secmta2.internal.synopsys.com (dc8secmta2.internal.synopsys.com [127.0.0.1]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id 023C5A4112; Tue, 17 Nov 2015 03:38:14 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id B792CA4102; Tue, 17 Nov 2015 03:38:13 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 9F2602AD; Tue, 17 Nov 2015 03:38:13 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2-vip.internal.synopsys.com [10.12.239.238]) by mailhost.synopsys.com (Postfix) with ESMTP id 8A7302AB; Tue, 17 Nov 2015 03:38:13 -0800 (PST) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 17 Nov 2015 03:38:01 -0800 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 17 Nov 2015 17:07:58 +0530 Received: from [10.12.197.182] (10.12.197.182) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 17 Nov 2015 17:07:57 +0530 Subject: Re: [PATCH v2 18/19] ARC: [plat-eznps] replace sync with proper cpu barrier To: Peter Zijlstra References: <1446297327-16298-1-git-send-email-noamc@ezchip.com> <1446893557-29748-19-git-send-email-noamc@ezchip.com> <564B0BB1.8080709@synopsys.com> <20151117112343.GW3816@twins.programming.kicks-ass.net> Newsgroups: gmane.linux.kernel.arc,gmane.linux.kernel From: Vineet Gupta Message-ID: <564B1182.7050107@synopsys.com> Date: Tue, 17 Nov 2015 17:07:38 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151117112343.GW3816@twins.programming.kicks-ass.net> X-Originating-IP: [10.12.197.182] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_033834_451289_2953584E X-CRM114-Status: GOOD ( 14.07 ) X-Spam-Score: -3.4 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [198.182.60.111 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [198.182.60.111 listed in wl.mailspike.net] -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gilf@ezchip.com, talz@ezchip.com, linux-kernel@vger.kernel.org, cmetcalf@ezchip.com, Noam Camus , linux-snps-arc@lists.infradead.org Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Tuesday 17 November 2015 04:53 PM, Peter Zijlstra wrote: > On Tue, Nov 17, 2015 at 04:42:49PM +0530, Vineet Gupta wrote: >> On Saturday 07 November 2015 04:22 PM, Noam Camus wrote: >>> From: Tal Zilcer >>> >>> In SMT system like we have the generic "sync" is not working with >>> HW threads. The replacement is "schd.rw" instruction that is served >>> as cpu barrier for HW threads. >> >> As discussed in v2 of this patch, SYNC or some such in __switch_to is completely >> superfluous. We don't need this patch, you may instead wanna submit a patch which >> removes the sync. Also please do that in assembler version of this file as well ! > > Do test it though; Certainly ! > as is ARC-SMP seems to have a _lot_ of superfluous > barriers many of which have no explanation yet (I'm thinking of those > extra smp_mb()s in the lock primitives). Other than the lock primitives can u think of any more. I verified that with llock/scond based spinlocks, those smp_mb() can be safely removed. I didn't send that patch over yet as part of puzzle is why removing them in EX based locks causes hackbench to jitter on quad core builds. This required some perf investigation but that seems to be causing some sort of livelock with callgraph profiling which is what I'm debugging currently :-) BTW since we are on the topic we have this loop in stack unwinder which can potentially cause RCU stalls, actual lockups etc. I was planning to add the following - does that seem fine to you. ------------------> diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c index 573ac469f68b..e887f6df7ac9 100644 --- a/arch/arc/kernel/stacktrace.c +++ b/arch/arc/kernel/stacktrace.c @@ -138,6 +138,10 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs, if (consumer_fn(address, arg) == -1) break; + cond_resched(); + if (fatal_signal_pending(current)) + return -ERESTARTNOHAND; + ret = arc_unwind(&frame_info); if (ret) break;