Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp180020pxa; Mon, 10 Aug 2020 23:20:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAEGQW6AbnZNDHJ43YUzybHh6/TLXKdO6eTuuwqw/Rp+4zpcm2JcPhlvbeGywCh/pgWgEF X-Received: by 2002:a17:906:7104:: with SMTP id x4mr26116399ejj.417.1597126848803; Mon, 10 Aug 2020 23:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597126848; cv=none; d=google.com; s=arc-20160816; b=TmBv21BYgaObiD4zEmNJy4vWXZtLzxiN7OS/d3SXV26bt/u6zjsKbVmBopXtd1eMaS DsqCJHTykM2ghzMf6WBTgIolJoBzERuAmWURawpdTAgR/jzDrvRasDqVPJbvoGLGDKUB NDBgbVEHlZBvhk4zqW1PLUTRFqQyn9WMPOwLU38HAZwZmbnhq0wDtKy5d+7AqgCDPFnB aG5JN/gckOe+/pA27DmBH6EGDUhSYkq3Hm5VE6KmB1mo/ijoTm7HHgAYGe5dcoSOzqOG iIeULKFBwfnF/VEdGNfESaJruwUDTs9FprolnW5K02Zxd1RiZ0HyJYKPdnSpsNElzv9o xwMg== 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:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=Z3fElnd+Y9FA4yZg8r1n7amfIdOvdQXf9aLhjI5oBQ4=; b=FU5m69sLADQEfnw2OtHtn3Sr19pBndSXivq1qebELVsPeNWgAUjs7DHQpVFNgxg/e/ D2RvemFxZvhTK7ZGxSyuWQUv7VaKu024y2HSmgcbGkTxK2xi0BzkYRhHKc1xemJKNYTj Wo3yd8oDmUhE3Unx8v6bxxCW1YwUoaq0uDZDYRLFjF9zG2ToXBjE0EFUI4E8qiZjaC7T fKXV1tbGXk5dgiabbZ01MQGuCbKvM63YDE+6UviuCVAlIJ4nd/zrdlozsiJm6zMdBto2 gxkYHLxV9LY4wdKaJ5ojkTfeZIWCHh6OL5z3DJehu/mJcP9SqGdAbuAsQxPtgLgaErbX 1UTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce15si13038629edb.201.2020.08.10.23.20.25; Mon, 10 Aug 2020 23:20:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727845AbgHKGSD (ORCPT + 99 others); Tue, 11 Aug 2020 02:18:03 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:34288 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726154AbgHKGSD (ORCPT ); Tue, 11 Aug 2020 02:18:03 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 63EBD988F5302519B287 for ; Tue, 11 Aug 2020 14:17:59 +0800 (CST) Received: from [127.0.0.1] (10.174.177.157) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Tue, 11 Aug 2020 14:17:49 +0800 To: CC: Shiyuan Hu , Hewenliang , From: Yunfeng Ye Subject: [PATCH] genirq/affinity: show managed irq affinity correctly Message-ID: Date: Tue, 11 Aug 2020 14:17:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.157] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "managed_irq" for isolcpus is supported after the commit 11ea68f553e2 ("genirq, sched/isolation: Isolate from handling managed interrupts"), but the interrupt affinity shown in proc directory is still the original affinity. So modify the interrupt affinity correctly for managed_irq. Signed-off-by: yeyunfeng --- kernel/irq/manage.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index d55ba625d426..6ad4fe01942a 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -218,8 +218,8 @@ static inline void irq_init_effective_affinity(struct irq_data *data, const struct cpumask *mask) { } #endif -int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, - bool force) +static int irq_chip_set_affinity(struct irq_data *data, + const struct cpumask *mask, bool force) { struct irq_desc *desc = irq_data_to_desc(data); struct irq_chip *chip = irq_data_get_irq_chip(data); @@ -228,6 +228,26 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, if (!chip || !chip->irq_set_affinity) return -EINVAL; + ret = chip->irq_set_affinity(data, mask, force); + switch (ret) { + case IRQ_SET_MASK_OK: + case IRQ_SET_MASK_OK_DONE: + cpumask_copy(desc->irq_common_data.affinity, mask); + /* fall through */ + case IRQ_SET_MASK_OK_NOCOPY: + irq_validate_effective_affinity(data); + irq_set_thread_affinity(desc); + ret = 0; + } + + return ret; +} + +int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, + bool force) +{ + int ret; + /* * If this is a managed interrupt and housekeeping is enabled on * it check whether the requested affinity mask intersects with @@ -262,20 +282,10 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, prog_mask = mask; else prog_mask = &tmp_mask; - ret = chip->irq_set_affinity(data, prog_mask, force); + ret = irq_chip_set_affinity(data, prog_mask, force); raw_spin_unlock(&tmp_mask_lock); } else { - ret = chip->irq_set_affinity(data, mask, force); - } - switch (ret) { - case IRQ_SET_MASK_OK: - case IRQ_SET_MASK_OK_DONE: - cpumask_copy(desc->irq_common_data.affinity, mask); - /* fall through */ - case IRQ_SET_MASK_OK_NOCOPY: - irq_validate_effective_affinity(data); - irq_set_thread_affinity(desc); - ret = 0; + ret = irq_chip_set_affinity(data, mask, force); } return ret; -- 1.8.3.1