Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp810949ybl; Wed, 29 Jan 2020 10:04:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxZIMNkkUOkFwJz5iUVxW8PbNHDfH6u1nTF8OEqionlR5QWa0tI1po9peatdTWW9zC6jB34 X-Received: by 2002:a9d:76cb:: with SMTP id p11mr117760otl.7.1580321071221; Wed, 29 Jan 2020 10:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580321071; cv=none; d=google.com; s=arc-20160816; b=mn+Qwmih/Xn7gadx76cLs+Yi8ZtvWKke5JW0PdZZoMQtV8cjfu7tkQqbH04ot9u9H7 s6ESNCjOQlZR+T2lroW2nh58by/Vt3wHD2AtAgHMvKkOepyFcIk2+msgPrKcetCAzaHb ng3ad/iI+8CRa5jAnXRQ04NS3Y602rXpCbqfLZbNZvZZXP67GSYa05Gu3t2yGy9Vc39a 0kznY8Jsvo4xWOb6A67tIIWdrrc83pdEsmoiEY5LfR5WVvWOIov2aD8XrybZ3zSLqDgo IQpcV1aAbYbzWBl7IOdye4+JOxZS++W6jw3nCbNkZco4UTP7ss2lbaaJqlstEST4SKUX TOSA== 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=v49qSJDDhvOaRsBI9gc+tYZ4RfGmEGHF1xKb4v6wLhw=; b=WgUZh//ToFVNu0C/Nd7QH6HrifBjDYiha5maSeWLyS/Qe5i3YDgjkMk5D0FxFIZjtv h/DNCBco/w4YB9Zsv2b8zgjknYc1cVItt6MLFBHfcw/pSeEPhRZ0TWTZhJ5ZXIeJmYGO TFAds+ietZqswtgMDONOS0YrGDRa/ceV8ZCoO030bmgSEZXuMtyk5oXGo6mgYe1Dzup5 2YlEjxKeOPk6YiXqKT9ZD6r0urRvZhbqaM5CA7B9VHydhH9U8fmhzj7WEuAdDysJchgr W78/yGBDG+oNcPcRcg7N888qXtuyQTvrvAjznHuJTVdESpu36u3jvJfSAFa4t3UeBAcJ NdrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XIzrCznP; 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 m8si1349523oic.163.2020.01.29.10.04.17; Wed, 29 Jan 2020 10:04:31 -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=XIzrCznP; 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 S1727159AbgA2SBk (ORCPT + 99 others); Wed, 29 Jan 2020 13:01:40 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35949 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbgA2SBk (ORCPT ); Wed, 29 Jan 2020 13:01:40 -0500 Received: by mail-lf1-f68.google.com with SMTP id f24so337863lfh.3 for ; Wed, 29 Jan 2020 10:01:39 -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=v49qSJDDhvOaRsBI9gc+tYZ4RfGmEGHF1xKb4v6wLhw=; b=XIzrCznP9I3gq08sozdu3CWZBayLW7ZkHxJeQxM+XmEdLhqmWxUHfD3rocLMQ2MXdY XP89vxP5NvtBFfL7hPVxhlhj6bl9yyT13nUd5CkifWcfrpdgAF6+hihMrGBflE4yVM5k 2HJWDzCDAQp8LGiZCQ9KXSJ8hZULCEJiiM0ns= 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=v49qSJDDhvOaRsBI9gc+tYZ4RfGmEGHF1xKb4v6wLhw=; b=Nw/Wy1ikyP1InPLnpl7N9qyhQ2A5ERfIqRjbHGjpx0XM8mBIf/tYL+lVb5TWIwwCar hcGjj/29o9rq72OlOFRAoHGsxjLIoeWOeB34FOkn0fnXgQb2SvUQEJT0fFdNYAFzgzTy yF7Dyz3VLPH2+KTK9lt8xXMrTUN9eqtFtBuvRc09sKvay6GhEs0jgsLpBZ2SeX+5yThI rOzePqXujNaBFPOSA3f5yDNrjMxQuq/tk8mF0/XxvSVBVaJ62S8Ym5wFtf/oCacoaHVu 8lyF3URYMhVHMKzbMVrH+K4rf37XYhp9g0lEwi6smOOBI2kPw5nShNdI9ejSOA2knf9M 7btg== X-Gm-Message-State: APjAAAWPI838Am5ZNZTnQD4FQDb12mX8BXbt/KVz6JJ6wK9b9jUKYKDa MlJtlDoSQwZTwv2ILYMp+jQ6ni4HY24= X-Received: by 2002:a05:6512:2035:: with SMTP id s21mr252678lfs.99.1580320897901; Wed, 29 Jan 2020 10:01:37 -0800 (PST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id u13sm1432726lfq.19.2020.01.29.10.01.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jan 2020 10:01:36 -0800 (PST) Received: by mail-lf1-f43.google.com with SMTP id l18so349501lfc.1 for ; Wed, 29 Jan 2020 10:01:36 -0800 (PST) X-Received: by 2002:a19:c205:: with SMTP id l5mr259903lfc.159.1580320896113; Wed, 29 Jan 2020 10:01:36 -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> In-Reply-To: <87pnf342pr.fsf@nanos.tec.linutronix.de> From: Evan Green Date: Wed, 29 Jan 2020 10:00:59 -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 Tue, Jan 28, 2020 at 2:48 PM Thomas Gleixner wrote: > > Evan, > > Evan Green writes: > > On Tue, Jan 28, 2020 at 6:38 AM Thomas Gleixner wrote: > >> The patch is only lightly tested, but so far it survived. > >> > > > > Hi Thomas, > > Thanks for the patch, I gave it a try. I get the following splat, then a hang: > > > > [ 62.238406] CPU0 > > [ 62.241135] ---- > > [ 62.243863] lock(vector_lock); > > [ 62.247467] lock(vector_lock); > > [ 62.251071] > > [ 62.251071] *** DEADLOCK *** > > [ 62.251071] > > [ 62.257687] May be due to missing lock nesting notation > > [ 62.257687] > > [ 62.265274] 2 locks held by migration/1/17: > > [ 62.269946] #0: 00000000cfa9d8c3 (&irq_desc_lock_class){-.-.}, at: > > irq_migrate_all_off_this_cpu+0x44/0x28f > > [ 62.280846] #1: 000000006885da2d (vector_lock){-.-.}, at: > > msi_set_affinity+0x13c/0x27b > > [ 62.289801] > > [ 62.289801] stack backtrace: > > [ 62.294669] CPU: 1 PID: 17 Comm: migration/1 Not tainted 4.19.96 #2 > > [ 62.310713] Call Trace: > > [ 62.313446] dump_stack+0xac/0x11e > > [ 62.317255] __lock_acquire+0x64f/0x19bc > > [ 62.321646] ? find_held_lock+0x3d/0xb8 > > [ 62.325936] ? pci_conf1_write+0x4f/0xdf > > [ 62.330320] lock_acquire+0x1b2/0x1fa > > [ 62.334413] ? apic_retrigger_irq+0x31/0x63 > > [ 62.339097] _raw_spin_lock_irqsave+0x51/0x7d > > [ 62.343972] ? apic_retrigger_irq+0x31/0x63 > > [ 62.348646] apic_retrigger_irq+0x31/0x63 > > [ 62.353124] msi_set_affinity+0x25a/0x27b > > 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. -Evan