• Affinity broken due to vector space exhaustion 问题


    dmesg 中异常打印:

     kernel: irq 632: Affinity broken due to vector space exhaustion.
     kernel: irq 633: Affinity broken due to vector space exhaustion.
    

    这个打印并不是申请不到中断号,而是已经申请到了中断号,但是配置中断路由的时候,
    想要生效的中断绑核与预期不一致,代码为:

    commit 743dac494d61d991967ebcfab92e4f80dc7583b3
    Author: Neil Horman <nhorman@tuxdriver.com>
    Date:   Thu Aug 22 10:34:21 2019 -0400
    
        x86/apic/vector: Warn when vector space exhaustion breaks affinity
    
        On x86, CPUs are limited in the number of interrupts they can have affined
        to them as they only **support 256 interrupt** vectors per CPU. 32 vectors are
        reserved for the CPU and the kernel reserves another 22 for internal
        purposes. That leaves 202 vectors for assignement to devices.
    
        When an interrupt is set up or the affinity is changed by the kernel or the
        administrator, the vector assignment code attempts to honor the requested
        affinity mask. If the vector space on the CPUs in that affinity mask is
        exhausted the code falls back to a wider set of CPUs and assigns a vector
        on a CPU outside of the requested affinity mask silently.
    
        While the effective affinity is reflected in the corresponding
        /proc/irq/$N/effective_affinity* files the silent breakage of the requested
        affinity can lead to unexpected behaviour for administrators.
    
        Add a pr_warn() when this happens so that adminstrators get at least
        informed about it in the syslog.
    
        [ tglx: Massaged changelog and made the pr_warn() more informative ]
    
        Reported-by: djuran@redhat.com
        Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
        Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
        Tested-by: djuran@redhat.com
        Link: https://lkml.kernel.org/r/20190822143421.9535-1-nhorman@tuxdriver.com
    
    diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
    index fdacb864c3dd..2c5676b0a6e7 100644
    --- a/arch/x86/kernel/apic/vector.c
    +++ b/arch/x86/kernel/apic/vector.c
    @@ -398,6 +398,17 @@ static int activate_reserved(struct irq_data *irqd)
                    if (!irqd_can_reserve(irqd))
                            apicd->can_reserve = false;
            }
    +
    +       /*
    +        * Check to ensure that the effective affinity mask is a subset
    +        * the user supplied affinity mask, and warn the user if it is not
    +        */
    +       if (!cpumask_subset(irq_data_get_effective_affinity_mask(irqd),
    +                           irq_data_get_affinity_mask(irqd))) {
    +               pr_warn("irq %u: Affinity broken due to vector space exhaustion.\n",
    +                       irqd->irq);
    +       }
    +
            return ret;
     }
    
    

    原因作者也解释得很清楚,就是x86的cpu,各个核能够接收的中断个数是有限制的,在centos7中,我们经常遇到配置中断路由失败的情况,没有异常打印,
    所以针对这个问题,目前在内核中增加了这个打印。然后centos 8.3也移植了这个打印。

    遇到这个问题,由于我们0号核一般是重灾区,所以要尽量将中断不要路由到0号核。

    水平有限,如果有错误,请帮忙提醒我。如果您觉得本文对您有帮助,可以点击下面的 推荐 支持一下我。版权所有,需要转发请带上本文源地址,博客一直在更新,欢迎 关注 。
  • 相关阅读:
    数据同步之rsync
    unity中 ump打包后其他电脑运行摄像头无画面
    Unity中使用ini配置文件
    Unity云台控制大华摄像头
    unity中物体没有挂载任何脚本却可以运行
    Unity导入模型后没有颜色的问题
    Unity中人物靠近门时自动开门
    Unity测量周长小工具
    Unity 中System.Runtime.InteropServices读取配置文件
    unity C# 计算3D空间任意多边形面积,距离,角度测量工具
  • 原文地址:https://www.cnblogs.com/10087622blog/p/15703497.html
Copyright © 2020-2023  润新知