android_kernel_samsung_sm8650/drivers
Uladzislau Rezki 3751416eeb UPSTREAM: scsi/scsi_error: Use call_rcu_hurry() instead of call_rcu()
Earlier commits in this series allow battery-powered systems to build
their kernels with the default-disabled CONFIG_RCU_LAZY=y Kconfig option.
This Kconfig option causes call_rcu() to delay its callbacks in order
to batch them.  This means that a given RCU grace period covers more
callbacks, thus reducing the number of grace periods, in turn reducing
the amount of energy consumed, which increases battery lifetime which
can be a very good thing.  This is not a subtle effect: In some important
use cases, the battery lifetime is increased by more than 10%.

This CONFIG_RCU_LAZY=y option is available only for CPUs that offload
callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot
parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y.

Delaying callbacks is normally not a problem because most callbacks do
nothing but free memory.  If the system is short on memory, a shrinker
will kick all currently queued lazy callbacks out of their laziness,
thus freeing their memory in short order.  Similarly, the rcu_barrier()
function, which blocks until all currently queued callbacks are invoked,
will also kick lazy callbacks, thus enabling rcu_barrier() to complete
in a timely manner.

However, there are some cases where laziness is not a good option.
For example, synchronize_rcu() invokes call_rcu(), and blocks until
the newly queued callback is invoked.  It would not be a good for
synchronize_rcu() to block for ten seconds, even on an idle system.
Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of
call_rcu().  The arrival of a non-lazy call_rcu_hurry() callback on a
given CPU kicks any lazy callbacks that might be already queued on that
CPU.  After all, if there is going to be a grace period, all callbacks
might as well get full benefit from it.

Yes, this could be done the other way around by creating a
call_rcu_lazy(), but earlier experience with this approach and
feedback at the 2022 Linux Plumbers Conference shifted the approach
to call_rcu() being lazy with call_rcu_hurry() for the few places
where laziness is inappropriate.

And another call_rcu() instance that cannot be lazy is the one in the
scsi_eh_scmd_add() function.  Leaving this instance lazy results in
unacceptably slow boot times.

Therefore, make scsi_eh_scmd_add() use call_rcu_hurry() in order to
revert to the old behavior.

[ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ]

Tested-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Uladzislau Rezki <urezki@gmail.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: <linux-scsi@vger.kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 54d87b0a0c19bc3f740e4cd4b87ba14ce2e4ea73)

Bug: 258241771
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909036
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: I95bba865e582b0a12b1c09ba1f0bd4f897401c07
2024-01-19 00:10:44 +00:00
..
accessibility
acpi Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
amba amba: bus: fix refcount leak 2023-09-13 09:42:56 +02:00
android ANDROID: vendor_hooks: add hooks in driver/android/binder.c 2024-01-17 02:22:48 +00:00
ata Revert "ata,scsi: do not issue START STOP UNIT on resume" 2023-11-02 07:06:05 +00:00
atm
auxdisplay
base Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
bcma
block This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
bluetooth This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
bus bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up 2023-10-06 14:56:48 +02:00
cdrom
char Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
clk Merge branch 'android14-6.1' into branch 'android14-6.1-lts' 2023-10-31 17:20:05 +00:00
clocksource This is the 6.1.54 stable release 2023-10-17 12:03:09 +00:00
comedi
connector
counter
cpufreq This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
cpuidle Merge branch 'android14-6.1' into branch 'android14-6.1-lts' 2023-10-31 17:20:05 +00:00
crypto This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
cxl cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws() 2023-08-03 10:24:04 +02:00
dax This is the 6.1.39 stable release 2023-09-02 19:41:42 +00:00
dca
devfreq FROMGIT: PM / devfreq: Synchronize devfreq_monitor_[start/stop] 2024-01-03 23:14:47 +00:00
dio
dma This is the 6.1.54 stable release 2023-10-17 12:03:09 +00:00
dma-buf ANDROID: dma-buf: don't re-purpose kobject as work_struct 2024-01-09 17:43:59 +00:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-13 09:42:45 +02:00
eisa
extcon extcon: cht_wc: add POWER_SUPPLY dependency 2023-09-13 09:42:53 +02:00
firewire Revert "scsi: sd: Differentiate system and runtime start/stop management" 2023-11-02 07:06:05 +00:00
firmware Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
fpga
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-13 09:42:54 +02:00
gnss
gpio This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
gpu Merge "Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1'" into android14-6.1 2023-11-30 10:20:44 +00:00
greybus
hid BACKPORT: HID: input: map battery system charging 2023-12-01 19:04:48 +00:00
hsi
hte
hv This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
hwmon This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
hwspinlock hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation 2023-09-19 12:28:05 +02:00
hwtracing UPSTREAM: coresight: tmc: Don't enable TMC when it's not ready. 2024-01-17 15:07:33 -08:00
i2c Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
i3c i3c: master: svc: fix probe failure when no i3c device exist 2023-09-13 09:43:01 +02:00
idle intel_idle: add Emerald Rapids Xeon support 2023-10-10 22:00:44 +02:00
iio iio: accel: adxl313: Fix adxl313_i2c_id[] table 2023-09-13 09:42:52 +02:00
infiniband This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
input Merge "Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1'" into android14-6.1 2023-11-30 10:20:44 +00:00
interconnect interconnect: Teach lockdep about icc_bw_lock order 2023-09-23 11:11:13 +02:00
iommu Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
ipack
irqchip This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:27:26 +02:00
leds leds: Drop BUG_ON check for LED_COLOR_ID_MULTI 2023-10-10 22:00:40 +02:00
macintosh
mailbox This is the 6.1.54 stable release 2023-10-17 12:03:09 +00:00
mcb
md UPSTREAM: dm verity: don't perform FEC for failed readahead IO 2023-12-21 22:46:28 +00:00
media Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
memory memory: brcmstb_dpfe: fix testing array offset after use 2023-07-19 16:21:24 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-07-19 16:21:08 +02:00
message
mfd Merge 6.1.40 into android14-6.1-lts 2023-09-05 16:35:01 +00:00
misc Merge branch 'android14-6.1' into branch 'android14-6.1-lts' 2023-10-31 17:20:05 +00:00
mmc Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
most
mtd ubi: Refuse attaching if mtd's erasesize is 0 2023-10-10 22:00:39 +02:00
mux
net This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
nfc
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-13 09:43:02 +02:00
nubus
nvdimm nvdimm: Fix dereference after free in register_nvdimm_pmu() 2023-09-13 09:42:47 +02:00
nvme UPSTREAM: nvmet-tcp: Fix a possible UAF in queue intialization setup 2024-01-09 11:42:31 +00:00
nvmem nvmem: rmem: Use NVMEM_DEVID_AUTO 2023-07-19 16:21:57 +02:00
of This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-13 09:42:28 +02:00
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-06 14:56:51 +02:00
parport
pci This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-23 17:52:24 +02:00
peci
perf perf/imx_ddr: speed up overflow frequency of cycle 2023-09-23 11:11:00 +02:00
phy BACKPORT: UPSTREAM: phy: qcom-qmp: Introduce Kconfig symbols for discrete drivers 2024-01-12 22:16:42 +00:00
pinctrl pinctrl: cherryview: fix address_space_handler() argument 2023-09-19 12:27:57 +02:00
platform platform/x86: asus-wmi: Support 2023 ROG X16 tablet mode 2023-10-06 14:56:53 +02:00
pnp
power Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
powercap
pps
ps3
ptp ptp: ocp: Fix error handling in ptp_ocp_device_init 2023-10-10 22:00:42 +02:00
pwm pwm: lpc32xx: Remove handling of PWM channels 2023-09-19 12:28:00 +02:00
rapidio
ras
regulator regulator/core: regulator_register: set device->class earlier 2023-10-10 22:00:41 +02:00
remoteproc
reset
rpmsg rpmsg: glink: Add check for kstrdup 2023-09-13 09:42:58 +02:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-06 21:27:00 +01:00
s390 scsi: zfcp: Fix a double put in zfcp_port_enqueue() 2023-10-10 22:00:38 +02:00
sbus
scsi UPSTREAM: scsi/scsi_error: Use call_rcu_hurry() instead of call_rcu() 2024-01-19 00:10:44 +00:00
sh
siox
slimbus
soc Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
soundwire soundwire: fix enumeration completion 2023-08-03 10:24:15 +02:00
spi This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
spmi
ssb
staging This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
target This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
tc
tee
thermal Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
thunderbolt thunderbolt: Fix a backport error for display flickering issue 2023-09-02 09:16:20 +02:00
tty UPSTREAM: serial: 8250_port: Check IRQ data before use 2023-11-16 21:07:48 +00:00
ufs FROMLIST: scsi: ufs: Remove the ufshcd_hba_exit() call from ufshcd_async_scan() 2024-01-10 23:15:00 +00:00
uio
usb FROMGIT: usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart 2024-01-16 19:39:36 +00:00
vdpa Merge 6.1.47 into android14-6.1-lts 2023-09-13 19:35:46 +00:00
vfio Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
vhost This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
video Revert "video/aperture: Only remove sysfb on the default vga pci device" 2023-11-01 14:38:59 +00:00
virt ANDROID: virt: gunyah: Zero state_data after vcpu_run 2023-12-14 15:39:09 -08:00
virtio This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
vlynq
w1 w1: fix loop in w1_fini() 2023-07-19 16:21:48 +02:00
watchdog watchdog: intel-mid_wdt: add MODULE_ALIAS() to allow auto-load 2023-09-19 12:28:00 +02:00
xen This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
zorro
Kconfig
Makefile