Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp772733imm; Tue, 5 Jun 2018 04:21:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKNnNMo9ChFhWtfUcI/rZD9MKn81WEds6JOC+2uDFKpE3uDoLqX7+Xmd66Oq2jlOFtk5vUK X-Received: by 2002:a63:2bc4:: with SMTP id r187-v6mr20434142pgr.231.1528197687559; Tue, 05 Jun 2018 04:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528197687; cv=none; d=google.com; s=arc-20160816; b=OG1jEdFTEsr1wrIS8D9SFXfHNOhDHiJeyykLx5pTkll1jd4jbkc9IgH9xAv5YpZV7x WnsM+8bHzzMatfOz3AAvch5uxuED7ylrDMchor3rQM6yERzrym6c4obwzbUBbYuTIf8U fdwyXhFPRntxofI2wBR5gICT0Pr8aKzIC+nMdheDQSbH7cbi3/+KbliaXRJuQ7dui1Be olyXm711N1FEF0dALQSn/pzdqyba5/mFeaGfxVtOB7mpvla1Fngl/fQhwPWaXiq2qW4D +EFjxvvEv+Z+H/bv/G9zPePAZO+jQ9J0KWMzo81W/e95ILnSt/kkq3iDVSRRi2RvoZAK z3kg== 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:cc:to:subject:arc-authentication-results; bh=i3PvhoUov4h6G4eTas3PwSJo2yEO21M8dE5zUVIMcWA=; b=0Ncvt5u10pijvxwfJ/mhFWHJQhmxdM4zU8OLt9hSPWd52w9jf5bgDs0yA5Q1jXBn2j k8YDdivIUrsQPIDz9NdLxp+KNUoL1EW5iNGMPSNG4kCCZLYCFaxRjTjKIBB5Gqouzkrp fatOT2eNWRDREHRV+DRr49EccdxqWIr1S5kESBF0yjjOdNcC8QTnHiKJfk/LpKq+QfP/ Sm27wcRmetJ1/dkNNyTkGQYIcEZ29TpDB/WFP1a5cWElYS8BRBol6+hw6Hnbkzta7Nk3 +DFmWPW+lNIDhyoGzhUjOpYWm+oWpXREG0QddPHxsdbkkUavTzK2UMZKIcGq5GPFAPFu iB0g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13-v6si19969473pfh.282.2018.06.05.04.21.13; Tue, 05 Jun 2018 04:21:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbeFELUq (ORCPT + 99 others); Tue, 5 Jun 2018 07:20:46 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:33044 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751632AbeFELUp (ORCPT ); Tue, 5 Jun 2018 07:20:45 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="40758883" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 05 Jun 2018 19:20:41 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 561244B40410; Tue, 5 Jun 2018 19:20:36 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Tue, 5 Jun 2018 19:20:36 +0800 Subject: Re: [patch 2/8] genirq/generic_pending: Do not lose pending affinity update To: Thomas Gleixner , LKML CC: Ingo Molnar , Peter Zijlstra , Borislav Petkov , Dmitry Safonov <0x7f454c46@gmail.com>, Tariq Toukan , Song Liu , Joerg Roedel , Mike Travis , References: <20180604162224.386544292@linutronix.de> From: Dou Liyang Message-ID: <74a8cfe1-56e4-6082-1d53-a76faf5105eb@cn.fujitsu.com> Date: Tue, 5 Jun 2018 19:20:35 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180604162224.386544292@linutronix.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 561244B40410.A8475 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, At 06/04/2018 11:33 PM, Thomas Gleixner wrote: > The generic pending interrupt mechanism moves interrupts from the interrupt > handler on the original target CPU to the new destination CPU. This is > required for x86 and ia64 due to the way the interrupt delivery and > acknowledge works if the interrupts are not remapped. > > However that update can fail for various reasons. Some of them are valid > reasons to discard the pending update, but the case, when the previous move > has not been fully cleaned up is not a legit reason to fail. > > Check the return value of irq_do_set_affinity() for -EBUSY, which indicates > a pending cleanup, and rearm the pending move in the irq dexcriptor so it's s/dexcriptor/descriptor > tried again when the next interrupt arrives. > > Fixes: 996c591227d9 ("x86/irq: Plug vector cleanup race") > Signed-off-by: Thomas Gleixner > Cc:stable@vger.kernel.org > --- > kernel/irq/migration.c | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) > > --- a/kernel/irq/migration.c > +++ b/kernel/irq/migration.c > @@ -38,17 +38,18 @@ bool irq_fixup_move_pending(struct irq_d > void irq_move_masked_irq(struct irq_data *idata) > { > struct irq_desc *desc = irq_data_to_desc(idata); > - struct irq_chip *chip = desc->irq_data.chip; > + struct irq_data *data = &desc->irq_data; > + struct irq_chip *chip = data->chip; > > - if (likely(!irqd_is_setaffinity_pending(&desc->irq_data))) > + if (likely(!irqd_is_setaffinity_pending(data))) > return; > > - irqd_clr_move_pending(&desc->irq_data); > + irqd_clr_move_pending(data); > > /* > * Paranoia: cpu-local interrupts shouldn't be calling in here anyway. > */ > - if (irqd_is_per_cpu(&desc->irq_data)) { > + if (irqd_is_per_cpu(data)) { > WARN_ON(1); > return; > } > @@ -73,9 +74,20 @@ void irq_move_masked_irq(struct irq_data > * For correct operation this depends on the caller > * masking the irqs. > */ > - if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) > - irq_do_set_affinity(&desc->irq_data, desc->pending_mask, false); > + if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) { > + int ret; > > + ret = irq_do_set_affinity(data, desc->pending_mask, false); > + /* > + * If the there is a cleanup pending in the underlying s/If the there is/If there is/ Thanks, dou