Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp566234imm; Wed, 6 Jun 2018 02:14:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJhVSGxDZB2ZHoAmgyLNL0h+VuEeeQArAzEPYgbgbtdDYCTQFA62y2GvOCJY7kDa7MV3OXu X-Received: by 2002:a17:902:b706:: with SMTP id d6-v6mr2431668pls.105.1528276477981; Wed, 06 Jun 2018 02:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528276477; cv=none; d=google.com; s=arc-20160816; b=GSjp5BbcKdsd0Y2d7LOmVLCQNFEpGz6LfShXjkSiNNB7MGGKQD5tfeehZg1e/fX3t6 HCJkLMRWPPeNdzSkvN+nHd93h1NY66ye+T6fM8ROTOrVRuRVUg0pA0A8xI9Hzam5PDrK SstBZMwYMgYdVaVXqn/FOiMDT7yv7iukikPF+rf5AXSY0SwAcaZR/7ek/8cs9LmU4LZQ 0j+LlampXhftJ1C+qGpzQ97Wtr/d8V+I4pKK+aOdYAXgwYt4GuKQCAGOASWIaihvnuSq JoUwI2b3SP4CrWc2bStevI0jghV6m9UvV4v8qn9zEk+XMGwBTcgbxlo9xVZbJoVFxC7x aO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:user-agent :references:in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=Uftmu5jBUocg2So0OdVA0/ZuGxMkNbW6NtcshP5ZZKU=; b=xOYVv9IcHCZyjDtK3hZw5JF0fV0ML6mxR6ny5qUl+DyfT1hxkHOONqG8KbyVwAFQ7K BuA+tvdkphHXwv/kMS0LIc9iIS+kcClfkBS2PmhHCHv0gp3pLHmzAlH818HsLlTUWdR2 aAojCu++XkHDNwsXfY5Soz6ZO8ad80hhMR8/61COKfx8aZO0AWqHiK2/vOaTqpsplFTG iprtdG/yAa3ioqp3QAHEM/JSpEDedM1liAqu34FQDgiFC6wqcGAwZpxXNFC5DfJ7aanX 11cko+Ro92hTFv7NfVd27fQtx0GrkMRS9CeAbXltwF6m9ys5NRbIiTX8dHdC/8BMtEpj TNoQ== 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 p91-v6si50816056plb.457.2018.06.06.02.14.23; Wed, 06 Jun 2018 02:14:37 -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 S932369AbeFFJNu (ORCPT + 99 others); Wed, 6 Jun 2018 05:13:50 -0400 Received: from foss.arm.com ([217.140.101.70]:38226 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932265AbeFFJNt (ORCPT ); Wed, 6 Jun 2018 05:13:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4A4161435; Wed, 6 Jun 2018 02:13:49 -0700 (PDT) Received: from big-swifty.misterjones.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 098843F557; Wed, 6 Jun 2018 02:13:47 -0700 (PDT) Date: Wed, 06 Jun 2018 10:13:44 +0100 Message-ID: <86a7s89t13.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Yang Yingliang Cc: , , Subject: Re: [PATCH v2] irqchip/gic-v3-its: fix ITS queue timeout In-Reply-To: <1528252824-15144-1-git-send-email-yangyingliang@huawei.com> References: <1528252824-15144-1-git-send-email-yangyingliang@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 06 Jun 2018 03:40:24 +0100, Yang Yingliang wrote: [I'm travelling, so please do not expect any quick answer...] > > When the kernel booted with maxcpus=x, 'x' is smaller > than actual cpu numbers, the TAs of offline cpus won't TA? Target Address? Target Affinity? Timing Advance? Terrible Acronym? > be set to its->collection. > > If LPI is bind to offline cpu, sync cmd will use zero TA, > it leads to ITS queue timeout. Fix this by choosing a > online cpu, if there is no online cpu in cpu_mask. So instead of fixing the emission of a sync command on a non-mapped collection, you hack set_affinity? It doesn't feel like the right thing to do. It is also worth noticing that mapping an LPI to a collection that is not mapped yet is perfectly legal. > Signed-off-by: Yang Yingliang > --- > drivers/irqchip/irq-gic-v3-its.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index 5416f2b..d8b9539 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -2309,7 +2309,9 @@ static int its_irq_domain_activate(struct irq_domain *domain, > cpu_mask = cpumask_of_node(its_dev->its->numa_node); > > /* Bind the LPI to the first possible CPU */ > - cpu = cpumask_first(cpu_mask); > + cpu = cpumask_first_and(cpu_mask, cpu_online_mask); > + if (cpu >= nr_cpu_ids) > + cpu = cpumask_first(cpu_online_mask); Now you're completely ignoring cpu_mask which constraints the NUMA affinity. On some systems, this ends up with a deadlock (Cavium TX1, if I remember well). Wouldn't it be better to just return that the affinity setting request is impossible to satisfy? And more to the point, how comes we end-up in such a case? Thanks, M. -- Jazz is not dead, it just smell funny.