Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1145580pxa; Thu, 13 Aug 2020 01:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBG5961v1dC2rzW6n3KyKb4ksDbksAWwoUQ1L3lqlRK1Z6SoritYC16QFvTl5qtpdvIL33 X-Received: by 2002:a50:af45:: with SMTP id g63mr3807421edd.52.1597307453071; Thu, 13 Aug 2020 01:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597307453; cv=none; d=google.com; s=arc-20160816; b=ceipaqKyPYBehxhGbpTtyySBDASvFpg9Udz3fMcH8Yt6KTgFPBMO8O04I5MYGKG0bd KyuPav/Qu0m9423/iY3K3ysTWseCp0l0UJ9yNXgc749s8/sffenRndrgWfn1E6oTIDR/ aVG+oo1rtroxcIGAvDr+jV5qVYVLz5g8d/VdlZEPShjOzK2fM2bMQuyK8JzPBBwdxje3 X3ttVAZ9TAJjN8D2kKSz8t4LRQjWkPNsMja2Wac0VIKiF8g1WjrRC9UFX/wSttzQ+Ni3 S4A6f0wYLZ0b6lzbPOValQTuWuOXkOvYCbMMOjVjRCTHjLPVi7W/0PYOPf8L18+6tMOX wmJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=fT7X9ZhAR4IRK5EDGx6IbEbzY/WmsbTkSLcWHW9/fnY=; b=WbPJFE/W/beKG1wr0r+kQ9+bRo41xwWWs2m9Doo4JZRc7dhB4Sq4ej5EpBtsFsqKOC je427X7bwQsCU7tN5Y+VqpdgYlZNxbUo/WJv2EoPo+mPoz+xpdwqcMxuM93YQlndEFBQ mnDNH1owc9WquWs+cTNW3jZvxK3x5Dpjc/gz9GA7wxDS1sj1McZ9NDe3kfSR5216fo2l 2YoRkbMi3eHHPim7U4C5wBdWeBb5ivX5HsDelY9OYiApB4dmcgh8khl/QwnFnYHMLyKi Kb5vvn+oeu7z4qphqlKhorUpXVfte9Wc8Gebfbr4E/5Abuf/SU9rrmmJhO5vJlZScN/e RPAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Iz3onmWG; dkim=neutral (no key) header.i=@linutronix.de header.b=uKvj7mWQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e12si2505161ejr.708.2020.08.13.01.30.29; Thu, 13 Aug 2020 01:30:53 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Iz3onmWG; dkim=neutral (no key) header.i=@linutronix.de header.b=uKvj7mWQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbgHMI1z (ORCPT + 99 others); Thu, 13 Aug 2020 04:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgHMI1z (ORCPT ); Thu, 13 Aug 2020 04:27:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C939C061757 for ; Thu, 13 Aug 2020 01:27:55 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1597307273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fT7X9ZhAR4IRK5EDGx6IbEbzY/WmsbTkSLcWHW9/fnY=; b=Iz3onmWGJ4OjBGECNnPH+/xegNFy5yaOVy7FzXyjfn0B4QyTf28Qu+aMdNSYCUFIdQt+Rv W5FwzBnJEBUp098sqqJrz4p49h52Ka08gNzZXc5vDjcGDM97Zpy38IDSQG0kYUOl/G7Qyx whRF1xCiLz7jq7ZTIkK6wfuGzpAzs6B8ODbM7nwaiLlmfb3gREpgtcwHKRSURWc7rWc7oB e/a7nR6HPfbl5AQC+MRwcdBERa3gv8cPXOceCGlZAoK5JpfgzALvlxVJWamSdrhc3ZCSm6 3xW/xZgZvtR6Irq3IunOCJf/fG7p2t6VgI166sdt/YlOQftqbP01pdIsHa2nyw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1597307273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fT7X9ZhAR4IRK5EDGx6IbEbzY/WmsbTkSLcWHW9/fnY=; b=uKvj7mWQrokhVZ6JFY8zJ6gQqtJK2m7N0xymYBiYPAwByePPM0GktnURa+KuIWiaVFQGuW 1BadGoYErg1xJmDQ== To: Yunfeng Ye Cc: linux-kernel@vger.kernel.org, Shiyuan Hu , Hewenliang Subject: Re: [PATCH] genirq/proc: Show percpu irq affinity In-Reply-To: References: Date: Thu, 13 Aug 2020 10:27:53 +0200 Message-ID: <874kp754s6.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. Thanks, tglx