This is the start of the stable review cycle for the 6.1.114 release.
There are 91 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 23 Oct 2024 10:22:25 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.114-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 6.1.114-rc1
Vasiliy Kovalev <kovalev(a)altlinux.org>
ALSA: hda/conexant - Use cached pin control for Node 0x1d on HP EliteOne 1000 G2
Nicholas Piggin <npiggin(a)gmail.com>
powerpc/64: Add big-endian ELFv2 flavour to crypto VMX asm generation
Ryusuke Konishi <konishi.ryusuke(a)gmail.com>
nilfs2: propagate directory read errors from nilfs_find_entry()
Paolo Abeni <pabeni(a)redhat.com>
mptcp: prevent MPC handshake on port-based signal endpoints
Paolo Abeni <pabeni(a)redhat.com>
tcp: fix mptcp DSS corruption due to large pmtu xmit
Nam Cao <namcao(a)linutronix.de>
irqchip/sifive-plic: Unmask interrupt in plic_irq_enable()
Marc Zyngier <maz(a)kernel.org>
irqchip/gic-v4: Don't allow a VMOVP on a dying VPE
Ma Ke <make24(a)iscas.ac.cn>
pinctrl: apple: check devm_kasprintf() returned value
Sergey Matsievskiy <matsievskiysv(a)gmail.com>
pinctrl: ocelot: fix system hang on level based interrupts
Longlong Xia <xialonglong(a)kylinos.cn>
tty: n_gsm: Fix use-after-free in gsm_cleanup_mux
Pawan Gupta <pawan.kumar.gupta(a)linux.intel.com>
x86/entry_32: Clear CPU buffers after register restore in NMI return
Pawan Gupta <pawan.kumar.gupta(a)linux.intel.com>
x86/entry_32: Do not clobber user EFLAGS.ZF
Zhang Rui <rui.zhang(a)intel.com>
x86/apic: Always explicitly disarm TSC-deadline timer
Nathan Chancellor <nathan(a)kernel.org>
x86/resctrl: Annotate get_mem_config() functions as __init
Takashi Iwai <tiwai(a)suse.de>
parport: Proper fix for array out-of-bounds access
Prashanth K <quic_prashk(a)quicinc.com>
usb: dwc3: Wait for EndXfer completion before restoring GUSB2PHYCFG
Daniele Palmas <dnlplm(a)gmail.com>
USB: serial: option: add Telit FN920C04 MBIM compositions
Benjamin B. Frost <benjamin(a)geanix.com>
USB: serial: option: add support for Quectel EG916Q-GL
Mathias Nyman <mathias.nyman(a)linux.intel.com>
xhci: Mitigate failed set dequeue pointer commands
Mathias Nyman <mathias.nyman(a)linux.intel.com>
xhci: Fix incorrect stream context type macro
Luiz Augusto von Dentz <luiz.von.dentz(a)intel.com>
Bluetooth: btusb: Fix regression with fake CSR controllers 0a12:0001
Aaron Thompson <dev(a)aaront.org>
Bluetooth: ISO: Fix multiple init when debugfs is disabled
Aaron Thompson <dev(a)aaront.org>
Bluetooth: Remove debugfs directory on module init failure
Aaron Thompson <dev(a)aaront.org>
Bluetooth: Call iso_exit() on module unload
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: adc: ti-ads124s08: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: dac: ad3552r: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: proximity: mb1232: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: dac: ad5766: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: amplifiers: ada4250: add missing select REGMAP_SPI in Kconfig
Emil Gedenryd <emil.gedenryd(a)axis.com>
iio: light: opt3001: add missing full-scale range value
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: light: veml6030: fix IIO device retrieval from embedded device
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: light: veml6030: fix ALS sensor resolution
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency()
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: adc: ti-ads8688: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: dac: stm32-dac-core: add missing select REGMAP_MMIO in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: dac: ltc1660: add missing select REGMAP_SPI in Kconfig
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
iio: dac: ad5770r: add missing select REGMAP_SPI in Kconfig
Mohammed Anees <pvmohammedanees2003(a)gmail.com>
drm/amdgpu: prevent BO_HANDLES error from being overwritten
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu/swsmu: Only force workload setup on init
Nikolay Kuratov <kniv(a)yandex-team.ru>
drm/vmwgfx: Handle surface check failure correctly
Ville Syrjälä <ville.syrjala(a)linux.intel.com>
drm/radeon: Fix encoder->possible_clones
Seunghwan Baek <sh8267.baek(a)samsung.com>
scsi: ufs: core: Set SDEV_OFFLINE when UFS is shut down
Jens Axboe <axboe(a)kernel.dk>
io_uring/sqpoll: close race on waiting for sqring entries
Omar Sandoval <osandov(a)fb.com>
blk-rq-qos: fix crash on rq_qos_wait vs. rq_qos_wake_function race
Johannes Wikner <kwikner(a)ethz.ch>
x86/bugs: Do not use UNTRAIN_RET with IBPB on entry
Johannes Wikner <kwikner(a)ethz.ch>
x86/bugs: Skip RSB fill at VMEXIT
Johannes Wikner <kwikner(a)ethz.ch>
x86/entry: Have entry_ibpb() invalidate return predictions
Johannes Wikner <kwikner(a)ethz.ch>
x86/cpufeatures: Add a IBPB_NO_RET BUG flag
Jim Mattson <jmattson(a)google.com>
x86/cpufeatures: Define X86_FEATURE_AMD_IBPB_RET
Michael Mueller <mimu(a)linux.ibm.com>
KVM: s390: Change virtual to physical address access in diag 0x258 handler
Nico Boehr <nrb(a)linux.ibm.com>
KVM: s390: gaccess: Check if guest address is in memslot
Thomas Weißschuh <thomas.weissschuh(a)linutronix.de>
s390/sclp_vt220: Convert newlines to CRLF instead of LFCR
Thomas Weißschuh <thomas.weissschuh(a)linutronix.de>
s390/sclp: Deactivate sclp after all its users
Lu Baolu <baolu.lu(a)linux.intel.com>
iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices
Wachowski, Karol <karol.wachowski(a)intel.com>
drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE)
Lorenzo Stoakes <lorenzo.stoakes(a)oracle.com>
maple_tree: correct tree corruption on spanning store
Jakub Kicinski <kuba(a)kernel.org>
devlink: bump the instance index directly when iterating
Jakub Kicinski <kuba(a)kernel.org>
devlink: drop the filter argument from devlinks_xa_find_get
Liu Shixin <liushixin2(a)huawei.com>
mm/swapfile: skip HugeTLB pages for unuse_vma
OGAWA Hirofumi <hirofumi(a)mail.parknet.co.jp>
fat: fix uninitialized variable
Nianyao Tang <tangnianyao(a)huawei.com>
irqchip/gic-v3-its: Fix VSYNC referencing an unmapped VPE on GIC v4.1
Oleksij Rempel <linux(a)rempel-privat.de>
net: macb: Avoid 20s boot delay by skipping MDIO bus registration for fixed-link PHY
Mark Rutland <mark.rutland(a)arm.com>
arm64: probes: Fix simulate_ldr*_literal()
Mark Rutland <mark.rutland(a)arm.com>
arm64: probes: Remove broken LDR (literal) uprobe support
Jinjie Ruan <ruanjinjie(a)huawei.com>
posix-clock: Fix missing timespec64 check in pc_clock_settime()
Wei Fang <wei.fang(a)nxp.com>
net: enetc: add missing static descriptor and inline keyword
Wei Fang <wei.fang(a)nxp.com>
net: enetc: remove xdp_drops statistic from enetc_xdp_drop()
Jan Kara <jack(a)suse.cz>
udf: Don't return bh from udf_expand_dir_adinicb()
Jan Kara <jack(a)suse.cz>
udf: Handle error when expanding directory
Jan Kara <jack(a)suse.cz>
udf: Remove old directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_link() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_mkdir() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_add_nondir() to new directory iteration
Jan Kara <jack(a)suse.cz>
udf: Implement adding of dir entries using new iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_unlink() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_rmdir() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert empty_dir() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_get_parent() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_lookup() to use new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Convert udf_readdir() to new directory iteration
Jan Kara <jack(a)suse.cz>
udf: Convert udf_rename() to new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Provide function to mark entry as deleted using new directory iteration code
Jan Kara <jack(a)suse.cz>
udf: Implement searching for directory entry using new iteration code
Jan Kara <jack(a)suse.cz>
udf: Move udf_expand_dir_adinicb() to its callsite
Jan Kara <jack(a)suse.cz>
udf: Convert udf_expand_dir_adinicb() to new directory iteration
Jan Kara <jack(a)suse.cz>
udf: New directory iteration code
Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
mptcp: pm: fix UaF read in mptcp_pm_nl_rm_addr_or_subflow
Vasiliy Kovalev <kovalev(a)altlinux.org>
ALSA: hda/conexant - Fix audio routing for HP EliteOne 1000 G2
Namjae Jeon <linkinjeon(a)kernel.org>
ksmbd: fix user-after-free from session log off
Roi Martin <jroi.martin(a)gmail.com>
btrfs: fix uninitialized pointer free on read_alloc_one_name() error
Roi Martin <jroi.martin(a)gmail.com>
btrfs: fix uninitialized pointer free in add_inode_ref()
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/kernel/probes/decode-insn.c | 16 +-
arch/arm64/kernel/probes/simulate-insn.c | 18 +-
arch/s390/kvm/diag.c | 2 +-
arch/s390/kvm/gaccess.c | 4 +
arch/s390/kvm/gaccess.h | 14 +-
arch/x86/entry/entry.S | 5 +
arch/x86/entry/entry_32.S | 6 +-
arch/x86/include/asm/cpufeatures.h | 4 +-
arch/x86/kernel/apic/apic.c | 14 +-
arch/x86/kernel/cpu/bugs.c | 32 +
arch/x86/kernel/cpu/common.c | 3 +
arch/x86/kernel/cpu/resctrl/core.c | 4 +-
block/blk-rq-qos.c | 2 +-
drivers/bluetooth/btusb.c | 13 +-
drivers/crypto/vmx/Makefile | 12 +-
drivers/crypto/vmx/ppc-xlate.pl | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 +-
drivers/gpu/drm/drm_gem_shmem_helper.c | 3 +
drivers/gpu/drm/radeon/radeon_encoders.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 +
drivers/iio/adc/Kconfig | 4 +
drivers/iio/amplifiers/Kconfig | 1 +
.../iio/common/hid-sensors/hid-sensor-trigger.c | 2 +-
drivers/iio/dac/Kconfig | 7 +
drivers/iio/light/opt3001.c | 4 +
drivers/iio/light/veml6030.c | 5 +-
drivers/iio/proximity/Kconfig | 2 +
drivers/iommu/intel/iommu.c | 4 +-
drivers/irqchip/irq-gic-v3-its.c | 26 +-
drivers/irqchip/irq-sifive-plic.c | 21 +-
drivers/net/ethernet/cadence/macb_main.c | 14 +-
drivers/net/ethernet/freescale/enetc/enetc.c | 2 +-
drivers/parport/procfs.c | 22 +-
drivers/pinctrl/pinctrl-apple-gpio.c | 3 +
drivers/pinctrl/pinctrl-ocelot.c | 8 +-
drivers/s390/char/sclp.c | 3 +-
drivers/s390/char/sclp_vt220.c | 4 +-
drivers/tty/n_gsm.c | 2 +
drivers/ufs/core/ufshcd.c | 4 +-
drivers/usb/dwc3/gadget.c | 10 +-
drivers/usb/host/xhci-ring.c | 2 +-
drivers/usb/host/xhci.h | 2 +-
drivers/usb/serial/option.c | 8 +
fs/btrfs/tree-log.c | 6 +-
fs/fat/namei_vfat.c | 2 +-
fs/nilfs2/dir.c | 50 +-
fs/nilfs2/namei.c | 39 +-
fs/nilfs2/nilfs.h | 2 +-
fs/smb/server/mgmt/user_session.c | 26 +-
fs/smb/server/mgmt/user_session.h | 4 +
fs/smb/server/server.c | 2 +
fs/smb/server/smb2pdu.c | 8 +-
fs/udf/dir.c | 148 +--
fs/udf/directory.c | 594 ++++++++---
fs/udf/inode.c | 90 --
fs/udf/namei.c | 1037 +++++++-------------
fs/udf/udfdecl.h | 45 +-
include/linux/fsl/enetc_mdio.h | 3 +-
include/linux/irqchip/arm-gic-v4.h | 4 +-
io_uring/io_uring.h | 9 +-
kernel/time/posix-clock.c | 3 +
lib/maple_tree.c | 12 +-
mm/swapfile.c | 2 +-
net/bluetooth/af_bluetooth.c | 3 +
net/bluetooth/iso.c | 6 +-
net/devlink/leftover.c | 40 +-
net/ipv4/tcp_output.c | 4 +-
net/mptcp/mib.c | 1 +
net/mptcp/mib.h | 1 +
net/mptcp/pm_netlink.c | 3 +-
net/mptcp/protocol.h | 1 +
net/mptcp/subflow.c | 11 +
sound/pci/hda/patch_conexant.c | 19 +
75 files changed, 1237 insertions(+), 1275 deletions(-)
From: Chris Wilson <chris.p.wilson(a)intel.com>
commit 78a033433a5ae4fee85511ee075bc9a48312c79e upstream.
If we abort driver initialisation in the middle of gt/engine discovery,
some engines will be fully setup and some not. Those incompletely setup
engines only have 'engine->release == NULL' and so will leak any of the
common objects allocated.
v2:
- Drop the destroy_pinned_context() helper for now. It's not really
worth it with just a single callsite at the moment. (Janusz)
Signed-off-by: Chris Wilson <chris.p.wilson(a)intel.com>
Cc: Janusz Krzysztofik <janusz.krzysztofik(a)linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper(a)intel.com>
Reviewed-by: Janusz Krzysztofik <janusz.krzysztofik(a)linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220915232654.3283095-2-matt…
Cc: <stable(a)vger.kernel.org> # 5.10+
---
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index a19537706ed1..eb6f4d7f1e34 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -904,8 +904,13 @@ int intel_engines_init(struct intel_gt *gt)
return err;
err = setup(engine);
- if (err)
+ if (err) {
+ intel_engine_cleanup_common(engine);
return err;
+ }
+
+ /* The backend should now be responsible for cleanup */
+ GEM_BUG_ON(engine->release == NULL);
err = engine_init_common(engine);
if (err)
--
2.34.1
From: Johannes Berg <johannes.berg(a)intel.com>
If more than 255 colocated APs exist for the set of all
APs found during 2.5/5 GHz scanning, then the 6 GHz scan
construction will loop forever since the loop variable
has type u8, which can never reach the number found when
that's bigger than 255, and is stored in a u32 variable.
Also move it into the loops to have a smaller scope.
Using a u32 there is fine, we limit the number of APs in
the scan list and each has a limit on the number of RNR
entries due to the frame size. With a limit of 1000 scan
results, a frame size upper bound of 4096 (really it's
more like ~2300) and a TBTT entry size of at least 11,
we get an upper bound for the number of ~372k, well in
the bounds of a u32.
Cc: stable(a)vger.kernel.org
Fixes: eae94cf82d74 ("iwlwifi: mvm: add support for 6GHz")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219375
Signed-off-by: Johannes Berg <johannes.berg(a)intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 3ce9150213a7..ddcbd80a49fb 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -1774,7 +1774,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
&cp->channel_config[ch_cnt];
u32 s_ssid_bitmap = 0, bssid_bitmap = 0, flags = 0;
- u8 j, k, n_s_ssids = 0, n_bssids = 0;
+ u8 k, n_s_ssids = 0, n_bssids = 0;
u8 max_s_ssids, max_bssids;
bool force_passive = false, found = false, allow_passive = true,
unsolicited_probe_on_chan = false, psc_no_listen = false;
@@ -1799,7 +1799,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
cfg->v5.iter_count = 1;
cfg->v5.iter_interval = 0;
- for (j = 0; j < params->n_6ghz_params; j++) {
+ for (u32 j = 0; j < params->n_6ghz_params; j++) {
s8 tmp_psd_20;
if (!(scan_6ghz_params[j].channel_idx == i))
@@ -1873,7 +1873,7 @@ iwl_mvm_umac_scan_cfg_channels_v7_6g(struct iwl_mvm *mvm,
* SSID.
* TODO: improve this logic
*/
- for (j = 0; j < params->n_6ghz_params; j++) {
+ for (u32 j = 0; j < params->n_6ghz_params; j++) {
if (!(scan_6ghz_params[j].channel_idx == i))
continue;
--
2.47.0
On 22. 10. 24, 19:45, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
>
> xhci: dbgtty: remove kfifo_out() wrapper
This is a cleanup, not needed in stable.
--
js
suse labs
The comment before the config of the GPLL3 PLL says that the
PLL should run at 930 MHz. In contrary to this, calculating
the frequency from the current configuration values by using
19.2 MHz as input frequency defined in 'qcs404.dtsi', it gives
921.6 MHz:
$ xo=19200000; l=48; alpha=0x0; alpha_hi=0x0
$ echo "$xo * ($((l)) + $(((alpha_hi << 32 | alpha) >> 8)) / 2^32)" | bc -l
921600000.00000000000000000000
Set 'alpha_hi' in the configuration to a value used in downstream
kernels [1][2] in order to get the correct output rate:
$ xo=19200000; l=48; alpha=0x0; alpha_hi=0x70
$ echo "$xo * ($((l)) + $(((alpha_hi << 32 | alpha) >> 8)) / 2^32)" | bc -l
930000000.00000000000000000000
The change is based on static code analysis, compile tested only.
[1] https://git.codelinaro.org/clo/la/kernel/msm-5.4/-/blob/kernel.lnx.5.4.r56-…
[2} https://git.codelinaro.org/clo/la/kernel/msm-5.15/-/blob/kernel.lnx.5.15.r4…
Cc: stable(a)vger.kernel.org
Fixes: 652f1813c113 ("clk: qcom: gcc: Add global clock controller driver for QCS404")
Signed-off-by: Gabor Juhos <j4g8y7(a)gmail.com>
---
Note: due to a bug in the clk_alpha_pll_configure() function, the following
patch is also needed in order for this fix to take effect:
https://lore.kernel.org/all/20241019-qcs615-mm-clockcontroller-v1-1-4cfb96d…
---
drivers/clk/qcom/gcc-qcs404.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/qcom/gcc-qcs404.c b/drivers/clk/qcom/gcc-qcs404.c
index c3cfd572e7c1e0a987519be2cb2050c9bc7992c7..5ca003c9bfba89bee2e626b3c35936452cc02765 100644
--- a/drivers/clk/qcom/gcc-qcs404.c
+++ b/drivers/clk/qcom/gcc-qcs404.c
@@ -131,6 +131,7 @@ static struct clk_alpha_pll gpll1_out_main = {
/* 930MHz configuration */
static const struct alpha_pll_config gpll3_config = {
.l = 48,
+ .alpha_hi = 0x70,
.alpha = 0x0,
.alpha_en_mask = BIT(24),
.post_div_mask = 0xf << 8,
---
base-commit: 03dc72319cee7d0dfefee9ae7041b67732f6b8cd
change-id: 20241021-fix-gcc-qcs404-gpll3-f314335c8ecf
Best regards,
--
Gabor Juhos <j4g8y7(a)gmail.com>
From: Yu Kuai <yukuai3(a)huawei.com>
[ Upstream commit 73aeab373557fa6ee4ae0b742c6211ccd9859280 ]
Original state:
Process 1 Process 2 Process 3 Process 4
(BIC1) (BIC2) (BIC3) (BIC4)
Λ | | |
\--------------\ \-------------\ \-------------\|
V V V
bfqq1--------->bfqq2---------->bfqq3----------->bfqq4
ref 0 1 2 4
After commit 0e456dba86c7 ("block, bfq: choose the last bfqq from merge
chain in bfq_setup_cooperator()"), if P1 issues a new IO:
Without the patch:
Process 1 Process 2 Process 3 Process 4
(BIC1) (BIC2) (BIC3) (BIC4)
Λ | | |
\------------------------------\ \-------------\|
V V
bfqq1--------->bfqq2---------->bfqq3----------->bfqq4
ref 0 0 2 4
bfqq3 will be used to handle IO from P1, this is not expected, IO
should be redirected to bfqq4;
With the patch:
-------------------------------------------
| |
Process 1 Process 2 Process 3 | Process 4
(BIC1) (BIC2) (BIC3) | (BIC4)
| | | |
\-------------\ \-------------\|
V V
bfqq1--------->bfqq2---------->bfqq3----------->bfqq4
ref 0 0 2 4
IO is redirected to bfqq4, however, procress reference of bfqq3 is still
2, while there is only P2 using it.
Fix the problem by calling bfq_merge_bfqqs() for each bfqq in the merge
chain. Also change bfqq_merge_bfqqs() to return new_bfqq to simplify
code.
Fixes: 0e456dba86c7 ("block, bfq: choose the last bfqq from merge chain in bfq_setup_cooperator()")
Signed-off-by: Yu Kuai <yukuai3(a)huawei.com>
Link: https://lore.kernel.org/r/20240909134154.954924-3-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
---
block/bfq-iosched.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 515e3c1a5475..c1600e3ac333 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2774,10 +2774,12 @@ void bfq_release_process_ref(struct bfq_data *bfqd, struct bfq_queue *bfqq)
bfq_put_queue(bfqq);
}
-static void
-bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
- struct bfq_queue *bfqq, struct bfq_queue *new_bfqq)
+static struct bfq_queue *bfq_merge_bfqqs(struct bfq_data *bfqd,
+ struct bfq_io_cq *bic,
+ struct bfq_queue *bfqq)
{
+ struct bfq_queue *new_bfqq = bfqq->new_bfqq;
+
bfq_log_bfqq(bfqd, bfqq, "merging with queue %lu",
(unsigned long)new_bfqq->pid);
/* Save weight raising and idle window of the merged queues */
@@ -2845,6 +2847,8 @@ bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
new_bfqq->pid = -1;
bfqq->bic = NULL;
bfq_release_process_ref(bfqd, bfqq);
+
+ return new_bfqq;
}
static bool bfq_allow_bio_merge(struct request_queue *q, struct request *rq,
@@ -2880,14 +2884,8 @@ static bool bfq_allow_bio_merge(struct request_queue *q, struct request *rq,
* fulfilled, i.e., bic can be redirected to new_bfqq
* and bfqq can be put.
*/
- bfq_merge_bfqqs(bfqd, bfqd->bio_bic, bfqq,
- new_bfqq);
- /*
- * If we get here, bio will be queued into new_queue,
- * so use new_bfqq to decide whether bio and rq can be
- * merged.
- */
- bfqq = new_bfqq;
+ while (bfqq != new_bfqq)
+ bfqq = bfq_merge_bfqqs(bfqd, bfqd->bio_bic, bfqq);
/*
* Change also bqfd->bio_bfqq, as
@@ -5444,6 +5442,7 @@ static bool __bfq_insert_request(struct bfq_data *bfqd, struct request *rq)
bool waiting, idle_timer_disabled = false;
if (new_bfqq) {
+ struct bfq_queue *old_bfqq = bfqq;
/*
* Release the request's reference to the old bfqq
* and make sure one is taken to the shared queue.
@@ -5459,18 +5458,18 @@ static bool __bfq_insert_request(struct bfq_data *bfqd, struct request *rq)
* then complete the merge and redirect it to
* new_bfqq.
*/
- if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq)
- bfq_merge_bfqqs(bfqd, RQ_BIC(rq),
- bfqq, new_bfqq);
+ if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq) {
+ while (bfqq != new_bfqq)
+ bfqq = bfq_merge_bfqqs(bfqd, RQ_BIC(rq), bfqq);
+ }
- bfq_clear_bfqq_just_created(bfqq);
+ bfq_clear_bfqq_just_created(old_bfqq);
/*
* rq is about to be enqueued into new_bfqq,
* release rq reference on bfqq
*/
- bfq_put_queue(bfqq);
+ bfq_put_queue(old_bfqq);
rq->elv.priv[1] = new_bfqq;
- bfqq = new_bfqq;
}
bfq_update_io_thinktime(bfqd, bfqq);
--
2.39.2