Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp857315pxa; Sat, 22 Aug 2020 02:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9F2rHkpGvTijDgOsAmg4f3eH5IAmF0HIoGsveSSHwvXBNEhWJiuploElu1EVfF9yDw+Sq X-Received: by 2002:a50:8f85:: with SMTP id y5mr6639797edy.233.1598089020165; Sat, 22 Aug 2020 02:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598089020; cv=none; d=google.com; s=arc-20160816; b=qNM6G5qiBgi4siX3gtpRZFHVbmqy4MLDEMUuJ1/3uA9yp4RUQuZDkplunjy5sv1Pq0 jAhHineH9bAWCfoe/zy/c/Mbyhb5RgPePut3XsnU2rNb3Foll5dgjJvIYtVSRr+rZaeS EGSINKPMsZPHzuCwCYFId103sPgHYVNeBV1aXRHcyaiyOX7xaasax17n/x4zGfBZ4n4/ yKKFIUH+XNFAUeR1+RRgDX1j2Kh5rcb2cgy2dD3jDowbm/o1MUf+cPId/n5i2LuKMTJG z6ZLYRidtwW+vXNDI0xoqYO3HZH01BI2Woi7/jkpi7NPC5kVwZJqErR/6Xvmr+zV0apI 6fwg== 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; bh=cYG6AOk92lVJRZjwDnDxOD424Ee0JDfTAv25vFtu37c=; b=M/bnowI9QIyV5pg7vufc29L0+fzPQNkSzivvopuY6NyOM/2by6BGmZR9FFG0lsJhkX 9GdEgJsaq/IjZbmw1YhDf1huSrP1WK7t6BFgb1aSMgDuDvIccHBkgWOEKhXqbTdkrGZu +CxHSaNgCAncM4KqVgASkh0Feey3wgGfL5+fojo6yZUf8oE2JqJDzvUzItfQzhG6Xf14 9Jnq49IcwYla1WFAaOrHncngk4058+LRQ307wSDRL5554Ty6GD56mSv+DnE09TZ3E0gp XC3zZS0N8T3Auq/cw0DL9xq2ozahtm+hsGj5zVSnhB8YJG35ti3lNvJphTYYZB1Nyzvp ZfTA== 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 ch10si2882622edb.28.2020.08.22.02.36.36; Sat, 22 Aug 2020 02:37:00 -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 S1726534AbgHVJdw (ORCPT + 99 others); Sat, 22 Aug 2020 05:33:52 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55860 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725864AbgHVJdv (ORCPT ); Sat, 22 Aug 2020 05:33:51 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 08303A10FBACB14A5A30 for ; Sat, 22 Aug 2020 17:33:50 +0800 (CST) Received: from [127.0.0.1] (10.174.177.157) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Sat, 22 Aug 2020 17:33:40 +0800 Subject: Re: [PATCH] genirq/proc: Show percpu irq affinity To: Thomas Gleixner CC: , Shiyuan Hu , Hewenliang References: <874kp754s6.fsf@nanos.tec.linutronix.de> From: Yunfeng Ye Message-ID: Date: Sat, 22 Aug 2020 17:33:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <874kp754s6.fsf@nanos.tec.linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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 On 2020/8/13 16:27, Thomas Gleixner wrote: > Yunfeng Ye writes: > >> When the "affinity=" cmdline parameter is configured, > > There is no such parameter. > >> the interrupt affinity displayed in the proc directory does not match >> with that of the the percu interrupt, and the percu interrupt uses >> desc->percu_affinity. > > And when the non-existing parameter is not on the command line then > irq->affinity is showing the correct value magically? > > Definitely not: It's unconditionally showing irq->affinity and that is > pretty unlikely to match irq->percpu_affinity in any case. > Sorry,it is "irqaffinity=" cmdline parameter. it will set irq_default_affinity mask. if the interrupt is not the managed irq, the irq_desc will use irq_default_affinity as default affinity. For example, the cmdline "irqaffinity=0,1,126,127" on the 128 cores system: [root@localhost ~]# cat /proc/irq/4/smp_affinity_list 0-1,126-127 The irq 4 is "arch_timer" interrupt, which is a percpu interrupt. So is it necessary to show the percpu irq affinity correct? thanks. >> diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c >> index 32c071d7bc03..b9d0fa87b4b4 100644 >> --- a/kernel/irq/proc.c >> +++ b/kernel/irq/proc.c >> @@ -52,6 +52,8 @@ static int show_irq_affinity(int type, struct seq_file *m) >> case AFFINITY: >> case AFFINITY_LIST: >> mask = desc->irq_common_data.affinity; >> + if (irqd_is_per_cpu(&desc->irq_data)) >> + mask = desc->percpu_affinity; > > This breaks all architecture which mark interrupts as per CPU without > using the partition mechanism resulting in a NULL pointer dereference. > Yes, it is a problem. > Thanks, > > tglx > > . >