Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp861375ybl; Fri, 6 Dec 2019 07:25:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxpnjTY/5eV3FboRV0YnIuceO3OjPAwGUFAbCWzbkzk96uDijcE99OjT/P/zpv9QAYXkP4c X-Received: by 2002:a05:6830:4da:: with SMTP id s26mr10725042otd.141.1575645901465; Fri, 06 Dec 2019 07:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575645901; cv=none; d=google.com; s=arc-20160816; b=EXrKCIo117r5Cy/zbFQ+VlcEL0Cy4YytlJcRfVPPUnqd0sZB648Fy2o479iFTwgVtW W6y+AMEvG7oJbDKM2OwfIA4/5v5rGOnGbFHaZ+P3WdhZ905JfJsMEuNqXyN1uqsQZ5kG bZiA9ewjEnndtn4R7m6+wtFoaqVEVz/SgSqRbJQUDKqL6S5hLLzZIJGorBOSwxkMWG1f 4BR73JhkFVplKxP3hGYAGkfkYKd+zeUyhiKBJUlxlMADkas0tKKoVdZLv0gfxI5iulxL qsRg/KbAvFp3dHZvkbCA2VQJfMLlvkZBrRwW4aEE1e1VOZBKcfmVnEPO4MS/3Tv9bO7k P1zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=UUGDAVKFvBLyAPZRrBHBWhR51a/9rQ4cQQJmlpm58p4=; b=tBcOK1R+cvLxK1EUEzfPh7ZizrHSZp+fKmKNPV/SQ+edC+1EtNcejcY0LBbO2S4hcQ 1cfHduCV63J6e6rylbsoA7A4df0oHBIlH/kac5qVUdRL9wRr48k0xZZ0+x2P1EetBIqZ UPKflzdQtTs8EWpeaN9C6e+f0rPH0ceGcVoB8PhqENdISNKDg2IrOqFt2Yidkl8i6AIz y23pv9h9H2TvDmVI07vajtu4bBGnmEf/rP4QOwjSpLyvtRB/h1FukLkfEnkKoQYVkNMA eq+sqxZrh0yrrs0WBusdU+qgwhQzOBaPapcLbZY4/JfNNRiVAshJshvo7gGSHqDt3sm3 2UsQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f81si600275oig.110.2019.12.06.07.24.47; Fri, 06 Dec 2019 07:25:01 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726315AbfLFPXD (ORCPT + 99 others); Fri, 6 Dec 2019 10:23:03 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:33257 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbfLFPXD (ORCPT ); Fri, 6 Dec 2019 10:23:03 -0500 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1idFRX-0005L4-45; Fri, 06 Dec 2019 16:22:55 +0100 To: John Garry Subject: Re: [PATCH RFC 1/1] genirq: Make threaded handler use irq affinity for managed interrupt X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 06 Dec 2019 15:22:53 +0000 From: Marc Zyngier Cc: , , , , , , , , , , In-Reply-To: <1575642904-58295-2-git-send-email-john.garry@huawei.com> References: <1575642904-58295-1-git-send-email-john.garry@huawei.com> <1575642904-58295-2-git-send-email-john.garry@huawei.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: john.garry@huawei.com, tglx@linutronix.de, chenxiang66@hisilicon.com, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, hare@suse.com, ming.lei@redhat.com, hch@lst.de, axboe@kernel.dk, bvanassche@acm.org, peterz@infradead.org, mingo@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John, On 2019-12-06 14:35, John Garry wrote: > Currently the cpu allowed mask for the threaded part of a threaded > irq > handler will be set to the effective affinity of the hard irq. > > Typically the effective affinity of the hard irq will be for a single > cpu. As such, > the threaded handler would always run on the same cpu as the hard > irq. > > We have seen scenarios in high data-rate throughput testing that the > cpu > handling the interrupt can be totally saturated handling both the > hard > interrupt and threaded handler parts, limiting throughput. > > For when the interrupt is managed, allow the threaded part to run on > all > cpus in the irq affinity mask. > > Signed-off-by: John Garry > --- > kernel/irq/manage.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c > index 1753486b440c..8e7f8e758a88 100644 > --- a/kernel/irq/manage.c > +++ b/kernel/irq/manage.c > @@ -968,7 +968,11 @@ irq_thread_check_affinity(struct irq_desc *desc, > struct irqaction *action) > if (cpumask_available(desc->irq_common_data.affinity)) { > const struct cpumask *m; > > - m = irq_data_get_effective_affinity_mask(&desc->irq_data); > + if (irqd_affinity_is_managed(&desc->irq_data)) > + m = desc->irq_common_data.affinity; > + else > + m = irq_data_get_effective_affinity_mask( > + &desc->irq_data); > cpumask_copy(mask, m); > } else { > valid = false; Although I completely understand that there are cases where you really want to let your thread roam all CPUs, I feel like changing this based on a seemingly unrelated property is likely to trigger yet another whack-a-mole episode. I'd feel much more comfortable if there was a way to let the IRQ subsystem know about what is best. Shouldn't the endpoint driver know better about it? Note that I have no data supporting an approach or the other, hence playing the role of the village idiot here. Thanks, M. -- Jazz is not dead. It just smells funny...