Received: by 10.223.164.202 with SMTP id h10csp1873292wrb; Sat, 18 Nov 2017 07:57:54 -0800 (PST) X-Google-Smtp-Source: AGs4zMb+FMKanDLsEP3nd8ypttXdQS6bm7CbzrkDqX6h6wbnjq+t7r/VohuyJ4Dzeack/SsCuW2j X-Received: by 10.101.81.196 with SMTP id i4mr8342765pgq.54.1511020674398; Sat, 18 Nov 2017 07:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511020674; cv=none; d=google.com; s=arc-20160816; b=xy2qsg3mG0ycWyCfChgwwH797UsWgy6wB7300beP8Z2QRV+jShkUq6f2rNPrN47KUF 1BJD9lEtxM2jwHtmR/+PJeSsPvR+hP/G9g66p6Z+hA0xDnKSIo7BgeK8JQRS3qMYjN+j KvJoLPiPsVL602BlH0WFC0MjFima1JicotZNRr1x1oKKNPu1xea6fmpc9tPzmpG41md2 0AMWsnci7HPGXU5Wbctsu3C4yvkpaKTV+vv+xrUvA5UZQ+V0S9LXxdu8SdG1fKpCzZ3r Xtbi02GPIDb6/eRtlZUnQX1cvttJ9G5u50cKqUJKfQbAF/vmkN5aefpiAUGLYb348GvX +31Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:newsgroups:cc:to:subject :arc-authentication-results; bh=iixCPCdDqvZ1Tcm6grGDP7FZ8PoQUtZAU8tvqF/5KdE=; b=lVt9yidwSoQSBmYHtcNpOqHmoaAew6bl4dyZENYGWfnujnSqWAxbITHLyKhyXjbTjP bg9WK+GvOu0jCQgtcgcjXjT57KPNvc79frxTKekSrsHfU9+onwHd00EUA2KCow0V/BKc ylJUyZ6u+lPMgsH975RtxM3OlUq+5aIo5AcVgSwZJyq3D+w4RYng7fcZuXZJ3qj+sIZT RWy8vd0bI5yGl9jbpoFvVCiczKdwU82h1ak9f8fgAhBx4Pan6PPn+qv5YBVdFzNRegU5 unkZCxPXfw35vMvQDRFfCxTPHS9TEEaMUAz4/TTOM+quMZXawfaHB/OXfeXEd3XVor99 qjSg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si4659041plz.394.2017.11.18.07.57.40; Sat, 18 Nov 2017 07:57:54 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967033AbdKQXnH (ORCPT + 93 others); Fri, 17 Nov 2017 18:43:07 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:33117 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935350AbdKQXnB (ORCPT ); Fri, 17 Nov 2017 18:43:01 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id C503E10C0419; Fri, 17 Nov 2017 15:43:00 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 8F3DC90F; Fri, 17 Nov 2017 15:43:00 -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 7FAF890E; Fri, 17 Nov 2017 15:43:00 -0800 (PST) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 17 Nov 2017 15:43:00 -0800 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.266.1; Sat, 18 Nov 2017 05:12:57 +0530 Received: from [10.10.161.70] (10.10.161.70) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Sat, 18 Nov 2017 05:12:56 +0530 Subject: Re: [PATCH 4/4] ARCv2: entry: Reduce perf intr return path To: Peter Zijlstra CC: , Newsgroups: gmane.linux.kernel.arc,gmane.linux.kernel References: <1510092784-19942-1-git-send-email-vgupta@synopsys.com> <1510092784-19942-5-git-send-email-vgupta@synopsys.com> <20171114102802.GA3165@worktop.lehotels.local> <8b2c70f0-fc51-fb9b-b799-9b85a3d3403b@gmail.com> <20171115101853.mtpamwkc5z4ptw2h@hirez.programming.kicks-ass.net> From: Vineet Gupta Message-ID: <4a28d9dc-b322-1a79-b1d1-c13db2f01ee7@synopsys.com> Date: Fri, 17 Nov 2017 15:42:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171115101853.mtpamwkc5z4ptw2h@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.161.70] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> But I was choosing to ignore it mainly to reduce the overhead of a >> perf intr in general. A subsequent real interrupt could go thru thru >> the gyrations of preemption etc. > > So that's dangerous thinking... People that run a PREEMPT kernel > generally tend to care about latency (esp. when combined with > PREEMPT_RT). > > And ignoring a preemption point gets these people upset (and missed > preemptions are a royal friggin pain to debug). Which implies that this patch goes to trash ! Unless we think that running instrumentation (perf) on production systems will not yield the same behavior in general. >>> What do you (on ARC) do about irq_work ? >> >> Nothing ATM. What I meant was lack of support for arch_irq_work_raise(). But given that we don't have NMIs (yet), this need *not* be a must as things could actually be scheduled in the regular intr return path ? At any rate arch_irq_work_raise() is not relevant for this discussion since NMIs are not involved. > So the reason I'm asking is that some architectures that don't have NMIs > call irq_work_run() at the very end of their perf-interrupt handler (ARM > does this for instance). But on ARC, we don't call irq_work_run() in perf intr return path and that seem to imply it is broken - as in latency to service a perf induced preemption. > And the thing is, _that_ can and does do things like wakeups and will > thus require doing the PREEMPT thing. Reassures that this patch has to go to trash anyways, but I'm more worried about perf intr return for ARC in general. >> Although I'm sure it is, can you please explain how irq_work is relevant in >> the context of this patch. > > Since the perf interrupt (in general) cannot call a whole lot of things > for it needs to assume running from NMI context, it needs to defer > things to a more regular context. It does this with irq_work. And so do places such as flush_smp_call_function_queue() where the cross-core IPI could be an NMI. > So for instance, when the output buffer reaches its watermark, we'll > raise the irq_work to issue the wakeup of tasks that poll() on that. Cool, thx for the explanation. Perhaps I should put it in a Documentation/irq_work.txt pr some such ! Thx, -Vineet From 1584133581289283765@xxx Wed Nov 15 12:05:10 +0000 2017 X-GM-THRID: 1583482623170192100 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread