Rokudo Yan
d72be3a8e5
zsmalloc: account the number of compacted pages correctly
...
commit 2395928158059b8f9858365fce7713ce7fef62e4 upstream.
There exists multiple path may do zram compaction concurrently.
1. auto-compaction triggered during memory reclaim
2. userspace utils write zram<id>/compaction node
So, multiple threads may call zs_shrinker_scan/zs_compact concurrently.
But pages_compacted is a per zsmalloc pool variable and modification
of the variable is not serialized(through under class->lock).
There are two issues here:
1. the pages_compacted may not equal to total number of pages
freed(due to concurrently add).
2. zs_shrinker_scan may not return the correct number of pages
freed(issued by current shrinker).
The fix is simple:
1. account the number of pages freed in zs_compact locally.
2. use actomic variable pages_compacted to accumulate total number.
Link: https://lkml.kernel.org/r/20210202122235.26885-1-wu-yan@tcl.com
Fixes: 860c707dca ("zsmalloc: account the number of compacted pages")
Signed-off-by: Rokudo Yan <wu-yan@tcl.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-07 11:25:59 +01:00
..
accessibility
acpi
ACPI: configfs: add missing check after configfs_register_default_group()
2021-03-03 17:44:41 +01:00
amba
amba: Fix resource leak for drivers without .remove
2021-03-03 17:44:38 +01:00
android
binder: Prevent context manager from incrementing ref 0
2020-08-21 11:01:55 +02:00
ata
ata: ahci_brcm: Add back regulators management
2021-03-03 17:44:35 +01:00
atm
atm: idt77252: call pci_disable_device() on error path
2021-01-12 19:49:01 +01:00
auxdisplay
base
Revert "device property: Keep secondary firmware node secondary by type"
2021-01-12 19:49:05 +01:00
bcma
bcma: fix incorrect update of BCMA_CORE_PCI_MDIO_DATA
2020-01-29 10:24:31 +01:00
block
zsmalloc: account the number of compacted pages correctly
2021-03-07 11:25:59 +01:00
bluetooth
Bluetooth: btusb: fix PM leak in error case of setup
2020-01-12 11:24:16 +01:00
bus
mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
2020-12-29 13:44:56 +01:00
cdrom
cdrom: respect device capabilities during opening action
2020-01-04 13:41:02 +01:00
char
random: fix the RNDRESEEDCRNG ioctl
2021-03-03 17:44:32 +01:00
clk
clk: meson: clk-pll: fix initializing the old rate (fallback) for a PLL
2021-03-03 17:44:36 +01:00
clocksource
clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined
2021-03-03 17:44:37 +01:00
connector
cpufreq
cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()
2021-01-17 13:57:54 +01:00
cpuidle
cpuidle: Fix three reference count leaks
2020-06-20 10:24:18 +02:00
crypto
crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
2020-12-29 13:44:55 +01:00
dax
dca
devfreq
PM / devfreq: tegra30: Fix integer overflow on CPU's freq max out
2020-10-01 20:40:02 +02:00
dio
dma
dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function
2021-03-03 17:44:36 +01:00
dma-buf
dma-buf: Fix memory leak in sync_file_merge()
2019-12-21 10:42:32 +01:00
edac
EDAC/i5100: Fix error handling order in i5100_init_one()
2020-10-29 09:05:32 +01:00
eisa
extcon
extcon: max77693: Fix modalias string
2020-12-29 13:45:00 +01:00
firewire
net: add annotations on hh->hh_len lockless accesses
2020-01-12 11:24:19 +01:00
firmware
efi: Make it possible to disable efivar_ssdt entirely
2020-07-09 09:35:57 +02:00
fmc
fpga
gpio
gpio: pcf857x: Fix missing first interrupt
2021-03-03 17:44:44 +01:00
gpu
drm/msm/dsi: Correct io_start for MSM8994 (20nm PHY)
2021-03-03 17:44:39 +01:00
hid
HID: core: detect and skip invalid inputs to snto32()
2021-03-03 17:44:36 +01:00
hsi
HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
2020-12-29 13:44:56 +01:00
hv
Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload
2020-09-23 08:46:15 +02:00
hwmon
hwmon: (applesmc) check status earlier.
2020-09-12 11:47:32 +02:00
hwspinlock
hwtracing
stm class: Fix module init return on allocation failure
2021-01-30 13:27:14 +01:00
i2c
i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
2021-03-03 17:44:40 +01:00
ide
block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h>
2020-09-12 11:47:36 +02:00
idle
iio
iio: ad5504: Fix setting power-down state
2021-01-30 13:27:14 +01:00
infiniband
RDMA/rxe: Fix coding error in rxe_recv.c
2021-03-03 17:44:38 +01:00
input
Input: i8042 - add ASUS Zenbook Flip to noselftest list
2021-03-03 17:44:41 +01:00
iommu
iommu/vt-d: Do not use flush-queue when caching-mode is on
2021-02-10 09:09:27 +01:00
ipack
irqchip
irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
2020-12-29 13:45:00 +01:00
isdn
misdn: dsp: select CONFIG_BITREVERSE
2021-01-23 15:38:17 +01:00
leds
leds: trigger: fix potential deadlock with libata
2021-02-03 23:19:50 +01:00
lguest
lightnvm
macintosh
drivers/macintosh: Fix memleak in windfarm_pm112 driver
2020-06-20 10:24:21 +02:00
mailbox
mcb
md
dm era: Update in-core bitset after committing the metadata
2021-03-03 17:44:46 +01:00
media
media: uvcvideo: Allow entities with no pads
2021-03-07 11:25:58 +01:00
memory
memory: emif: Remove bogus debugfs error handling
2020-11-10 10:23:55 +01:00
memstick
memstick: r592: Fix error return in r592_probe()
2020-12-29 13:44:58 +01:00
message
scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
2020-11-10 10:23:57 +01:00
mfd
mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq()
2021-03-03 17:44:38 +01:00
misc
drivers/misc/vmw_vmci: restrict too big queue size in qp_host_alloc_queue
2021-03-03 17:44:43 +01:00
mmc
mmc: sdhci-esdhc-imx: fix kernel panic when remove module
2021-03-03 17:44:44 +01:00
mtd
mtd: spi-nor: hisi-sfc: Put child node np on error path
2021-03-03 17:44:43 +01:00
net
xen-netback: respect gnttab_map_refs()'s return value
2021-03-07 11:25:58 +01:00
nfc
nfc: s3fwrn5: Release the nfc firmware
2020-12-29 13:45:00 +01:00
ntb
NTB: hw: amd: fix an issue about leak system resources
2020-10-29 09:05:41 +01:00
nubus
nvdimm
libnvdimm/dimm: Avoid race between probe and available_slots_show()
2021-03-03 17:44:44 +01:00
nvme
nvmet: fix uninitialized work for zero kato
2020-10-29 09:05:41 +01:00
nvmem
nvmem: qfprom: remove incorrect write support
2020-06-11 09:22:22 +02:00
of
of/fdt: Make sure no-map does not remove already reserved regions
2021-03-03 17:44:37 +01:00
oprofile
parisc
parisc: mask out enable and reserved bits from sba imask
2020-08-21 11:02:06 +02:00
parport
parport: load lowlevel driver if ports not found
2020-01-04 13:39:55 +01:00
pci
PCI: Align checking of syscall user config accessors
2021-03-03 17:44:39 +01:00
pcmcia
perf
phy
phy: tegra: xusb: Fix dangling pointer on probe failure
2020-12-02 08:31:27 +01:00
pinctrl
pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
2020-12-29 13:44:58 +01:00
platform
platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
2020-12-29 13:44:47 +01:00
pnp
power
power: reset: at91-sama5d2_shdwc: fix wkupdbc mask
2021-03-03 17:44:37 +01:00
powercap
powercap: restrict energy meter to root access
2020-11-10 21:04:57 +01:00
pps
ps3
powerpc/ps3: use dma_mapping_error()
2020-12-29 13:45:00 +01:00
ptp
ptp: free ptp device pin descriptors properly
2020-05-20 08:15:33 +02:00
pwm
pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()
2021-03-03 17:44:39 +01:00
rapidio
rapidio: fix the missed put_device() for rio_mport_add_riodev
2020-10-29 09:05:39 +01:00
ras
regulator
regulator: axp20x: Fix reference cout leak
2021-03-03 17:44:37 +01:00
remoteproc
remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load
2021-02-23 13:59:14 +01:00
reset
reset: Fix potential use-after-free in __of_reset_control_get()
2019-11-25 09:53:42 +01:00
rpmsg
rtc
rtc: rx8010: don't modify the global rtc ops
2020-11-10 10:23:59 +01:00
s390
s390/dasd: fix hanging device offline processing
2021-01-09 13:35:49 +01:00
sbus
scsi
scsi: iscsi: Verify lengths on passthrough PDUs
2021-03-07 11:25:58 +01:00
sfi
sh
sn
soc
soc: qcom: smp2p: Safely acquire spinlock without IRQs
2020-12-29 13:45:07 +01:00
spi
spi: pxa2xx: Fix the controller numbering for Wildcat Point
2021-03-03 17:44:38 +01:00
spmi
ssb
staging
staging: most: sound: add sanity check for function argument
2021-03-07 11:25:58 +01:00
target
target: add XCOPY target/segment desc sense codes
2021-01-17 13:57:53 +01:00
tc
thermal
thermal: ti-soc-thermal: Fix bogus thermal shutdowns for omap4430
2020-09-12 11:47:34 +02:00
thunderbolt
tty
vt/consolemap: do font sum unsigned
2021-03-07 11:25:57 +01:00
uio
uio_pdrv_genirq: fix use without device tree and no interrupt
2020-07-22 09:10:53 +02:00
usb
usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop()
2021-03-03 17:44:43 +01:00
uwb
vfio
vfio/pci: Move dummy_resources_list init in vfio_pci_probe()
2021-01-09 13:35:48 +01:00
vhost
vhost_net: fix ubuf refcount incorrectly when sendmsg fails
2021-01-12 19:49:02 +01:00
video
fbdev: aty: SPARC64 requires FB_ATY_CT
2021-03-03 17:44:34 +01:00
virt
drivers/virt/fsl_hypervisor: Fix error handling path
2020-10-29 09:05:35 +01:00
virtio
virtio_ring: Avoid loop when vq is broken in virtqueue_poll
2020-08-26 10:29:05 +02:00
vlynq
vme
vme: bridges: reduce stack usage
2020-02-28 15:42:33 +01:00
w1
w1: mxc_w1: Fix timeout resolution problem leading to bus error
2020-11-10 10:23:57 +01:00
watchdog
watchdog: qcom: Avoid context switch in restart handler
2020-12-29 13:45:01 +01:00
xen
xen-scsiback: don't "handle" error by BUG()
2021-02-23 13:59:17 +01:00
zorro
Kconfig
Makefile