lkml.org 
[lkml]   [2013]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: Add check for number of available vectors before CPU down


On 12/03/2013 06:42 PM, Yu, Fenghua wrote:
>
>
>> -----Original Message-----
>> From: Prarit Bhargava [mailto:prarit@redhat.com]
>>
>> Second try at this ...
>>
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64791
>>
>> When a cpu is downed on a system, the irqs on the cpu are assigned to
>> other cpus. It is possible, however, that when a cpu is downed there
>> aren't enough free vectors on the remaining cpus to account for the
>> vectors from the cpu that is being downed.
>>
>> This results in an interesting "overflow" condition where irqs are
>> "assigned" to a CPU but are not handled.
>>
>> For example, when downing cpus on a 1-64 logical processor system:
>>
>> + if (per_cpu(vector_irq, cpu)[vector] < 0)
>> + count++;
>
> But later on fixup_irqs will set some of vector_irq vector as -1 on this
> to-be-disabled cpu. That will release vectors assigned to this cpu. So
> checking vector_irq at this point before fixup_irqs doesn't make sense, right?
>

Fenghua, IIUC the purpose of fixup_irqs() is to migrate irqs from the
to-be-disabled cpu to other cpus by using affinity, etc.. The to-be-disabled
cpus' irqs are set to -1, however, only after they are migrated off to an
enabled cpu.

This check I'm introducing is well before that stage in effort to determine
whether or not the system has "room" for the irqs on the remaining cpus.

So I think that the check is in the right spot. We should do it early. I
suppose an argument could be made to do the check in fixup_irqs(), however, my
feeling is by then it is very late in the process of downing the cpu.

I noticed a subtle bug in my patch that I will send with a [v2]. I'm not taking
into account per-cpu interrupts in the check_vectors() function.

P.

> Thanks.
>
> -Fenghua
>


\
 
 \ /
  Last update: 2013-12-04 16:21    [W:0.139 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site