[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 06/13] x86/IOMMU: don't restrict IRQ affinities to online CPUs


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Tue, 16 Jul 2019 10:20:10 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DrKGSeOMBO1ZuKim6vn2ns4nAPPBUJrNb6IriPm4+PY=; b=hPp58Qt1+YMiVgwbgp9qykse7pfu40lofVK6e82XG9D7SChVRHBAV8Ii+SmY4OCvQcahOpCKAKTPuAfQ16fRqVQvRCYVYu6A4es+C8qkTMe+Of4U7Dn9aSoECtDTRCysrkYhTNkicw4FmLyF/VhG+69+VcdYEQF6jz/neUWGihGVT3kwsbbNKiVsYJBeFRMc2hf61YyZ28czHaxL7ldabBW6K/3jeXl3C2ox44StJQmPrK2Ei35rPMyW5WLn14wrQwWZNwKtmq0836HOy/WMhrjZlU3VOZ0YAT7fB/oIGHWDouZc0bwnysamZ7Ejf0gqsrlgvRoAzvZtSHnYBET4dw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YoLcVMkO8HsgcsBCnVSRQZx9pT3S4z7mulGqHJUxqj/O1S5FDUlvvevEnxpDHw1fYmGrnz47Xxp/3c2Uz3f/9F4pwzBGgnBUDq0Fi3j+XiX99j68bt3fTA7aVq13iJxkiLE78CUGa/2vyh3GXfuqWMVKq7Xz7AIHzMhtznGh28sIGB6lOAL881G5aW4OPKyOiu7/zo74TG2FIr/WdQuywWOR3uUSDMe8G367PrFe1m/x52s7MwIwuyWPdgS1dEkDKsekeDXAAMgLQeeGE4iu7o34+2mN8AQDU3J/9JU9vZuPsAQ2xCLv8ZHSh9CyA2/v9AD//5A8Fe8FyQ0w6Ti8bw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: "kevin.tian@xxxxxxxxx" <kevin.tian@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, AndrewCooper <andrew.cooper3@xxxxxxxxxx>, Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Brian Woods <brian.woods@xxxxxxx>
  • Delivery-date: Tue, 16 Jul 2019 10:24:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO6nO1yIoPbw3sE+gj0c0leZLnabM9hDhgAASrIA=
  • Thread-topic: [PATCH v4 06/13] x86/IOMMU: don't restrict IRQ affinities to online CPUs

On 16.07.2019 11:12, Roger Pau Monné  wrote:
> On Tue, Jul 16, 2019 at 07:40:57AM +0000, Jan Beulich wrote:
>> In line with "x86/IRQ: desc->affinity should strictly represent the
>> requested value" the internally used IRQ(s) also shouldn't be restricted
>> to online ones. Make set_desc_affinity() (set_msi_affinity() then does
>> by implication) cope with a NULL mask being passed (just like
>> assign_irq_vector() does), and have IOMMU code pass NULL instead of
>> &cpu_online_map (when, for VT-d, there's no NUMA node information
>> available).
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> LGTM, just one patch style comment and one code comment:
> 
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.

>> --- a/xen/arch/x86/irq.c
>> +++ b/xen/arch/x86/irq.c
>> @@ -796,18 +796,26 @@ unsigned int set_desc_affinity(struct ir
>>        unsigned long flags;
>>        cpumask_t dest_mask;
>>    
>> -    if (!cpumask_intersects(mask, &cpu_online_map))
>> +    if ( mask && !cpumask_intersects(mask, &cpu_online_map) )
>>            return BAD_APICID;
>>    
>>        spin_lock_irqsave(&vector_lock, flags);
>> -    ret = _assign_irq_vector(desc, mask);
>> +    ret = _assign_irq_vector(desc, mask ?: TARGET_CPUS);
>>        spin_unlock_irqrestore(&vector_lock, flags);
> 
> I think the patch is somehow mangled at least on my end, there's one
> prepended extra space in the non-modified lines AFAICT.

Well, yes, hence the last sentence in the cover letter and the attached
patches there. It is the mail system (more likely server than client)
over here which causes this issue (everywhere for me).

>>    
>> -    if (ret < 0)
>> +    if ( ret < 0 )
>>            return BAD_APICID;
>>    
>> -    cpumask_copy(desc->affinity, mask);
> 
> AFAICT you could also avoid the if and just do the same as in the
> assign_irq_vector call above and pass TARGET_CPUS if mask is NULL?

Are you talking about the if() in context above, or the one you've
stripped (immediately following the last quoted line of the patch)?
For the one in context I don't see how the rest of your remark is
related. For the other one - no, strictly not, as that would be
against the purpose of this change: We specifically want to _not_
restrict desc->affinity to online CPUs only (yet that's what
TARGET_CPUS resolves to).

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.