Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1075671ybl; Wed, 29 Jan 2020 14:56:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzhn3sa2OwUG/Hl256etKBa/q7VH2JcGGUrrsI+FG1zk+ToDhFaC7QdV8Ap4SrriW3K3R3V X-Received: by 2002:a9d:5c1:: with SMTP id 59mr1314447otd.192.1580338568443; Wed, 29 Jan 2020 14:56:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580338568; cv=none; d=google.com; s=arc-20160816; b=i5MUfoz2XAeAq6d/v+TALJSh9QZ9vGn6XC/0+YXnDU6rTnV/dDyUGcUG4kWod5A5rX b1L/dsYVaPQl0ziwzV/opAD4g7mgitrCuwSeJEZnYuIN/5fhtYepocirk7tY2QIb5TP6 wpu/WQdUsJFdNy9NvJF44kzSWGzZOGi6ZnPr94q/zR96yIA+EilZGumC8b4+bmIsZE8v EOjRGZGAWchYIbnrUajFHqYeELafjmxew1gCiqVLPKGr+QJSlav9TixzSLMku+pBv0bW 545xEWIxv5k2iuFtFG7EgPmnLC0I4P6QQgAh6WmkJXeuTxTQYMH8IWJSOpiwQknhWagk L+bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uOj9kLL9OKVQ4bW9RaNCXxV8jEQPASFBUj6KpH5YEho=; b=JlktsdzHoRCvB47kUhMjP4sLFeSCy5yk2dietmiEmMhX3ymPec/QuigtIRKUnQ3q63 /9iHO9UkBpjfZ6wl3fJXSBJj/uGWZYSrjQXiu61ILUrN2O2LEfV1FGaWjm9aUgKpusvf YXdNz5PVeN6cQYMt/S6RiLUjG854VwFSmA9xZy9I8Z6N1A8HdBqYUL0op9RflpUaEi6L HYno/jqL7v2jO0bkaqaGyyjXP9lu6J1pZ4RUcuI0dNAn5Ib1zkWuEUKGc2bBKl0MmV/N +u1hGSdg7l+oZlVfYG8AgUUuHpuWaWSTzcqeSnTuciais/emVCbZL4YpcIG8bUBb6IB9 kGfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZhvTsaxy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q25si1779621otg.128.2020.01.29.14.55.56; Wed, 29 Jan 2020 14:56:08 -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=pass header.i=@chromium.org header.s=google header.b=ZhvTsaxy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbgA2Wx4 (ORCPT + 99 others); Wed, 29 Jan 2020 17:53:56 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:36544 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgA2Wx4 (ORCPT ); Wed, 29 Jan 2020 17:53:56 -0500 Received: by mail-lj1-f195.google.com with SMTP id r19so1227247ljg.3 for ; Wed, 29 Jan 2020 14:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uOj9kLL9OKVQ4bW9RaNCXxV8jEQPASFBUj6KpH5YEho=; b=ZhvTsaxyumUnK5Lu8sLn5DccXNEakQ95xz2a5jJgoALEIjbzYMz+4NuzN5D0bwSDAZ ZUxe18Sf15dIFiwptjxYt4tad25GXwWuCR0g5arQP9n5P5K+RmXgEeO23cOuZYzu2YBx 3B334rQ7Kc4A2unostW515ssokqI5D0CdGCL0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uOj9kLL9OKVQ4bW9RaNCXxV8jEQPASFBUj6KpH5YEho=; b=PWKGIztTqgH1rEznIHYvO4fj7wTEYz+VUEQswilQByx652R7e337JK8hV82vBSGKmF vKAaFEFPr1FBzTZ6MMzCXhGXAE7VOaxi6PDZuZb83Mii4ozA7mWEWrVO5jBHTYVm2zXH pmEbqwQ8LeOJapopmqwCL8jyZymDLLOj0Ffo7xEp+lYK4LgxDbT263J3kFlpdu20Rt// WoyiUUVuitc68I5lNqkD4gkiiJkP6KiFI6nbX5QeR/v4j+LGWBiO007rR70tAlN8WwNw fWdM8b03scRxG0Moa78rTUM9bt5nfjdrfh3a3vQ6+r3vF/Rdz2v1EjAS9Y7pCkf+/K0X QYDQ== X-Gm-Message-State: APjAAAXuZZIfwcL8hxjNo/tRAQanRFQF4SVvw86Xm0sB7eI8/1xhtMXX Dfnf7Fgut3g1eqnNa0eSdvynTsrYE5Y= X-Received: by 2002:a05:651c:111c:: with SMTP id d28mr846934ljo.32.1580338433828; Wed, 29 Jan 2020 14:53:53 -0800 (PST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id t9sm1719109lfl.51.2020.01.29.14.53.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jan 2020 14:53:52 -0800 (PST) Received: by mail-lj1-f182.google.com with SMTP id v17so1215226ljg.4 for ; Wed, 29 Jan 2020 14:53:52 -0800 (PST) X-Received: by 2002:a2e:8702:: with SMTP id m2mr596560lji.278.1580338432116; Wed, 29 Jan 2020 14:53:52 -0800 (PST) MIME-Version: 1.0 References: <20200117162444.v2.1.I9c7e72144ef639cc135ea33ef332852a6b33730f@changeid> <87y2tytv5i.fsf@nanos.tec.linutronix.de> <87eevqkpgn.fsf@nanos.tec.linutronix.de> <87d0b82a9o.fsf@nanos.tec.linutronix.de> <878slwmpu9.fsf@nanos.tec.linutronix.de> <87imkv63yf.fsf@nanos.tec.linutronix.de> <87pnf342pr.fsf@nanos.tec.linutronix.de> <877e1a2d11.fsf@nanos.tec.linutronix.de> In-Reply-To: <877e1a2d11.fsf@nanos.tec.linutronix.de> From: Evan Green Date: Wed, 29 Jan 2020 14:53:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] PCI/MSI: Avoid torn updates to MSI pairs To: Thomas Gleixner Cc: Rajat Jain , Bjorn Helgaas , linux-pci , Linux Kernel Mailing List , x86@kernel.org, Marc Zyngier Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 29, 2020 at 1:01 PM Thomas Gleixner wrote: > > Evan, > > Evan Green writes: > > On Tue, Jan 28, 2020 at 2:48 PM Thomas Gleixner wrote: > >> > >> Bah. I'm sure I looked at that call chain, noticed the double vector > >> lock and then forgot. Delta patch below. > > > > It's working well with the delta patch, been running for about an hour > > with no issues. > > thanks for the info and for testing! > > Could you please add some instrumentation to see how often this stuff > actually triggers spurious interrupts? In about 10 minutes of this script running, I got 142 hits. My script can toggle the HT cpus on and off about twice per second. Here's my diff (sorry it's mangled by gmail). If you're looking for something else, let me know, or I can run a patch. diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c index 90baf2c66bd40..f9c46fc30d658 100644 --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c @@ -61,6 +61,8 @@ static void irq_msi_update_msg(struct irq_data *irqd, struct irq_cfg *cfg) irq_data_get_irq_chip(irqd)->irq_write_msi_msg(irqd, msg); } +int evanpending; + static int msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force) { @@ -155,8 +157,10 @@ msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force) unlock_vector_lock(); - if (pending) + if (pending) { + printk("EVAN pending %d", ++evanpending); irq_data_get_irq_chip(irqd)->irq_retrigger(irqd); + } return ret; } -Evan