From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Wendy Wang <wendy.wang@intel.com>,
Chen Yu <yu.c.chen@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.4 002/119] genirq/matrix: Exclude managed interrupts in irq_matrix_allocated()
Date: Wed, 15 Nov 2023 16:59:52 -0500 [thread overview]
Message-ID: <20231115220132.688761195@linuxfoundation.org> (raw)
In-Reply-To: <20231115220132.607437515@linuxfoundation.org>
5.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Yu <yu.c.chen@intel.com>
[ Upstream commit a0b0bad10587ae2948a7c36ca4ffc206007fbcf3 ]
When a CPU is about to be offlined, x86 validates that all active
interrupts which are targeted to this CPU can be migrated to the remaining
online CPUs. If not, the offline operation is aborted.
The validation uses irq_matrix_allocated() to retrieve the number of
vectors which are allocated on the outgoing CPU. The returned number of
allocated vectors includes also vectors which are associated to managed
interrupts.
That's overaccounting because managed interrupts are:
- not migrated when the affinity mask of the interrupt targets only
the outgoing CPU
- migrated to another CPU, but in that case the vector is already
pre-allocated on the potential target CPUs and must not be taken into
account.
As a consequence the check whether the remaining online CPUs have enough
capacity for migrating the allocated vectors from the outgoing CPU might
fail incorrectly.
Let irq_matrix_allocated() return only the number of allocated non-managed
interrupts to make this validation check correct.
[ tglx: Amend changelog and fixup kernel-doc comment ]
Fixes: 2f75d9e1c905 ("genirq: Implement bitmap matrix allocator")
Reported-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20231020072522.557846-1-yu.c.chen@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/irq/matrix.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 8e586858bcf41..d25edbb87119f 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -466,16 +466,16 @@ unsigned int irq_matrix_reserved(struct irq_matrix *m)
}
/**
- * irq_matrix_allocated - Get the number of allocated irqs on the local cpu
+ * irq_matrix_allocated - Get the number of allocated non-managed irqs on the local CPU
* @m: Pointer to the matrix to search
*
- * This returns number of allocated irqs
+ * This returns number of allocated non-managed interrupts.
*/
unsigned int irq_matrix_allocated(struct irq_matrix *m)
{
struct cpumap *cm = this_cpu_ptr(m->maps);
- return cm->allocated;
+ return cm->allocated - cm->managed_allocated;
}
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
--
2.42.0
next prev parent reply other threads:[~2023-11-15 22:02 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 21:59 [PATCH 5.4 000/119] 5.4.261-rc1 review Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 001/119] vfs: fix readahead(2) on block devices Greg Kroah-Hartman
2023-11-15 21:59 ` Greg Kroah-Hartman [this message]
2023-11-15 21:59 ` [PATCH 5.4 003/119] i40e: fix potential memory leaks in i40e_remove() Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 004/119] tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 005/119] wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 006/119] wifi: mt76: mt7603: rework/fix rx pse hang check Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 007/119] tcp_metrics: add missing barriers on delete Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 008/119] tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() Greg Kroah-Hartman
2023-11-15 21:59 ` [PATCH 5.4 009/119] tcp_metrics: do not create an entry from tcp_init_metrics() Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 010/119] wifi: rtlwifi: fix EDCA limit set by BT coexistence Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 011/119] can: dev: can_restart(): dont crash kernel if carrier is OK Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 012/119] can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 013/119] thermal: core: prevent potential string overflow Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 014/119] r8169: use tp_to_dev instead of open code Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 015/119] r8169: fix rare issue with broken rx after link-down on RTL8125 Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 016/119] chtls: fix tp->rcv_tstamp initialization Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 017/119] tcp: Remove one extra ktime_get_ns() from cookie_init_timestamp Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 018/119] tcp: fix cookie_init_timestamp() overflows Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 019/119] ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 020/119] ipv6: avoid atomic fragment on GSO packets Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 021/119] net: add DEV_STATS_READ() helper Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 022/119] ipvlan: properly track tx_errors Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 023/119] regmap: debugfs: Fix a erroneous check after snprintf() Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 024/119] clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 025/119] clk: qcom: gcc-sm8150: use ARRAY_SIZE instead of specifying num_parents Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 026/119] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 027/119] clk: imx: Select MXC_CLK for CLK_IMX8QXP Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 028/119] clk: keystone: pll: fix a couple NULL vs IS_ERR() checks Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 029/119] clk: npcm7xx: Fix incorrect kfree Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 030/119] clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 031/119] clk: mediatek: clk-mt6797: " Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 032/119] clk: mediatek: clk-mt7629-eth: " Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 033/119] clk: mediatek: clk-mt7629: " Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 034/119] clk: mediatek: clk-mt2701: " Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 035/119] platform/x86: wmi: Fix probe failure when failing to register WMI devices Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 036/119] platform/x86: wmi: remove unnecessary initializations Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 037/119] platform/x86: wmi: Fix opening of char device Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 038/119] hwmon: (coretemp) Fix potentially truncated sysfs attribute name Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 039/119] drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 040/119] drm/rockchip: vop: Fix call to crtc reset helper Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 041/119] drm/radeon: possible buffer overflow Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 042/119] drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 043/119] arm64: dts: qcom: sdm845-mtp: fix WiFi configuration Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 044/119] ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 045/119] soc: qcom: llcc cleanup to get rid of sdm845 specific driver file Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 046/119] soc: qcom: Rename llcc-slice to llcc-qcom Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 047/119] soc: qcom: llcc: Handle a second device without data corruption Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 048/119] firmware: ti_sci: Replace HTTP links with HTTPS ones Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 049/119] firmware: ti_sci: Mark driver as non removable Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 050/119] clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 051/119] hwrng: geode - fix accessing registers Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 052/119] libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 053/119] sched/rt: Provide migrate_disable/enable() inlines Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 054/119] nd_btt: Make BTT lanes preemptible Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 055/119] crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 056/119] crypto: caam/jr " Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 057/119] HID: cp2112: Use irqchip template Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 058/119] hid: cp2112: Fix duplicate workqueue initialization Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 059/119] ARM: 9321/1: memset: cast the constant byte to unsigned char Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 060/119] ext4: move ix sanity check to corrent position Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 061/119] scsi: ufs: core: Leave space for \0 in utf8 desc string Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 062/119] RDMA/hfi1: Workaround truncation compilation error Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 063/119] sh: bios: Revive earlyprintk support Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 064/119] ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 065/119] ASoC: ams-delta.c: use component after check Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 066/119] mfd: dln2: Fix double put in dln2_probe Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 067/119] leds: pwm: simplify if condition Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 068/119] leds: pwm: convert to atomic PWM API Greg Kroah-Hartman
2023-11-15 22:00 ` [PATCH 5.4 069/119] leds: pwm: Dont disable the PWM when the LED should be off Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 070/119] ledtrig-cpu: Limit to 8 CPUs Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 071/119] leds: trigger: ledtrig-cpu:: Fix output may be truncated issue for cpu Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 072/119] tty: tty_jobctrl: fix pid memleak in disassociate_ctty() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 073/119] usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 074/119] dmaengine: ti: edma: handle irq_of_parse_and_map() errors Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 075/119] misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 076/119] tools: iio: privatize globals and functions in iio_generic_buffer.c file Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 077/119] tools: iio: iio_generic_buffer: Fix some integer type and calculation Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 078/119] tools: iio: iio_generic_buffer ensure alignment Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 079/119] USB: usbip: fix stub_dev hub disconnect Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 080/119] dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 081/119] f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 082/119] modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 083/119] powerpc/xive: Fix endian conversion size Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 084/119] powerpc/imc-pmu: Use the correct spinlock initializer Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 085/119] powerpc/pseries: fix potential memory leak in init_cpu_associativity() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 086/119] i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 087/119] rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 088/119] pcmcia: cs: fix possible hung task and memory leak pccardd() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 089/119] pcmcia: ds: fix refcount leak in pcmcia_device_add() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 090/119] pcmcia: ds: fix possible name leak in error path " Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 091/119] media: bttv: fix use after free error due to btv->timeout timer Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 092/119] media: s3c-camif: Avoid inappropriate kfree() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 093/119] media: dvb-usb-v2: af9035: fix missing unlock Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 094/119] regmap: prevent noinc writes from clobbering cache Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 095/119] pwm: sti: Avoid conditional gotos Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 096/119] pwm: sti: Reduce number of allocations and drop usage of chip_data Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 097/119] pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 098/119] Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 099/119] llc: verify mac len before reading mac header Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 100/119] tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 101/119] inet: shrink struct flowi_common Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 102/119] dccp: Call security_inet_conn_request() after setting IPv4 addresses Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 103/119] dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 104/119] net: r8169: Disable multicast filter for RTL8168H and RTL8107E Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 105/119] Fix termination state for idr_for_each_entry_ul() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 106/119] net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 107/119] net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 108/119] tg3: power down device only on SYSTEM_POWER_OFF Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 109/119] r8169: respect userspace disabling IFF_MULTICAST Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 110/119] netfilter: xt_recent: fix (increase) ipv6 literal buffer length Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 111/119] netfilter: nft_redir: use `struct nf_nat_range2` throughout and deduplicate eval call-backs Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 112/119] netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 113/119] drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 114/119] spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 115/119] fbdev: imsttfb: Fix error path of imsttfb_probe() Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 116/119] fbdev: imsttfb: fix a resource leak in probe Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 117/119] fbdev: fsl-diu-fb: mark wr_reg_wa() static Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 118/119] Revert "mmc: core: Capture correct oemid-bits for eMMC cards" Greg Kroah-Hartman
2023-11-15 22:01 ` [PATCH 5.4 119/119] btrfs: use u64 for buffer sizes in the tree search ioctls Greg Kroah-Hartman
2023-11-16 12:47 ` [PATCH 5.4 000/119] 5.4.261-rc1 review Harshit Mogalapalli
2023-11-16 18:16 ` Naresh Kamboju
2023-11-16 19:12 ` Florian Fainelli
2023-11-16 23:42 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231115220132.688761195@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=patches@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=wendy.wang@intel.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).