Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4992627ybe; Tue, 17 Sep 2019 00:19:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwn7NYULbQv5vMUKjfw/69BC75sIIHNhMqlfS9PAS64bybJsAqg2+EAST+PSYT1JiHGTC2 X-Received: by 2002:a05:6402:1299:: with SMTP id w25mr3171499edv.1.1568704779650; Tue, 17 Sep 2019 00:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568704779; cv=none; d=google.com; s=arc-20160816; b=D9Ef9H4VywcMfRhREnUoOA6HimgnCN+trsV/t8MjQNhkwtFx90yGsUQRqbgJUGHQER 95e73CTAocBANT7Gmfk+qg04ExB/q7ECZVYJYsRYxscSVNiFabIvhKVXdiZICNFlNrq2 1rBpHcAGFnm6NLg/rJOD9TG9bFaRPE7i8c0ZN5vnJSci1e3dLccaUILgpMxTrlsjK2xn t2C+g5FArQ+Q55NOLBevkpl+bZ2zMLkVvdNCEd3nK6F+U4oNB8WI4Ahf0OVZteULxFHL eqFKQm8cId8uQL+VcYkdL0co1+b8elCwxakcmeexo3VKMZlNjM/5uAA8AxP1aOwIcoOP ci8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=4Ydz0bs/k0m/4kd2Be3P89x9mBc1YxTepxn0l8YdMDY=; b=ahVtxapAJmvZGRhpMCMKG0lT4NdDGST/hyF/5tVpFaJd79Ars0NpPMSs5e7d0fsBPf PPizO5xNGxg0yLUCovSzUPF8cguVpaOn9dRJIPY4JT9mxZAxBZu1JFcUDu2Ii1/qEsQn hNCWUY81aVb/MXWvG+V+9Z4rlV11vAayWfKhV3JMP4OV4aVHzzPgXfpbYy7YmyLtYaSJ SXTqlUr5nXFYsTfzZY0hQmnXt0/h0GMDLK6hddyELC2DcQH4YVFBcn5UTznh9/UHrPsV UjGuR71MGSwxh+1CzxHeA2MwuXk2WpvckO1W+R2B7lHD1VjAZ71gFQ5kljdesEK1s503 2SiQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y49si829834edb.138.2019.09.17.00.19.16; Tue, 17 Sep 2019 00:19:39 -0700 (PDT) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391798AbfIPVVZ convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Sep 2019 17:21:25 -0400 Received: from mga04.intel.com ([192.55.52.120]:21872 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730662AbfIPVVZ (ORCPT ); Mon, 16 Sep 2019 17:21:25 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 14:21:24 -0700 X-IronPort-AV: E=Sophos;i="5.64,514,1559545200"; d="scan'208";a="191192461" Received: from jsanto5x-mobl.amr.corp.intel.com ([10.255.93.114]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 14:21:23 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PREEMPT_RT PATCH 2/3] i915: convert all irq_locks spinlocks to raw spinlocks From: Sean V Kelley In-Reply-To: <20190903080335.pe45dmgmjvdvbyd4@linutronix.de> Date: Mon, 16 Sep 2019 14:21:22 -0700 Cc: Clark Williams , bigeasy@linutronix.com, tglx@linutronix.com, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <9EF2695D-3FBD-40E0-BE8A-EB71AF4155A5@linux.intel.com> References: <20190820003319.24135-1-clark.williams@gmail.com> <20190820003319.24135-3-clark.williams@gmail.com> <20190903080335.pe45dmgmjvdvbyd4@linutronix.de> To: Sebastian Andrzej Siewior X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 3, 2019, at 1:03 AM, Sebastian Andrzej Siewior wrote: > > On 2019-08-19 19:33:18 [-0500], Clark Williams wrote: >> From: Clark Williams >> >> The following structures contain a member named 'irq_lock'. >> These three locks are of type spinlock_t and are used in >> multiple contexts including atomic: >> >> struct drm_i915_private >> struct intel_breadcrumbs >> strict intel_guc >> >> Convert them all to be raw_spinlock_t so that lockdep and the lock >> debugging code will be happy. > > What is your motivation to make the lock raw? > I did the following: > > void intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine) > { > - local_irq_disable(); > - intel_engine_breadcrumbs_irq(engine); > - local_irq_enable(); > + if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL)) { > + intel_engine_breadcrumbs_irq(engine); > + } else { > + local_irq_disable(); > + intel_engine_breadcrumbs_irq(engine); > + local_irq_enable(); > + } > } > > and lockdep was quiet (+ ignoring/patching the lockdep-irq-off-asserts). > The local_irq_disable() is here (my interpretation of the situation) > because that function is called from process context while the remaining > callers invoke intel_engine_breadcrumbs_irq() from the interrupt > handler and it acquires irq_lock via a plain spin_lock(). That > local_irq_disable() would be required if everyone did a _irqsave(). I’ve tested this also on the v5.2.14-rt7 and can confirm that it avoids the need for making the locks raw. Tested-by: Sean V Kelley Thanks, Sean > > I tried to check how much worse the latency gets here but I didn't see > anything in a brief test. What I saw however is that switching to > fullscreen while playing a video gives me ~0.5 to ~2ms latency. This is > has nothing to do with this change, I have to dig deeper… It might be > one of the preempt_disable() section I just noticed. > I would prefer to keep the lock non-raw unless there is actual need for > it. > > Sebastian