WSL2-Linux-Kernel/drivers
Muchun Song 57b2847d3c mm: memcontrol: convert NR_SHMEM_THPS account to pages
Currently we use struct per_cpu_nodestat to cache the vmstat counters,
which leads to inaccurate statistics especially THP vmstat counters.  In
the systems with hundreds of processors it can be GBs of memory.  For
example, for a 96 CPUs system, the threshold is the maximum number of 125.
And the per cpu counters can cache 23.4375 GB in total.

The THP page is already a form of batched addition (it will add 512 worth
of memory in one go) so skipping the batching seems like sensible.
Although every THP stats update overflows the per-cpu counter, resorting
to atomic global updates.  But it can make the statistics more accuracy
for the THP vmstat counters.

So we convert the NR_SHMEM_THPS account to pages.  This patch is
consistent with 8f182270df ("mm/swap.c: flush lru pvecs on compound page
arrival").  Doing this also can make the unit of vmstat counters more
unified.  Finally, the unit of the vmstat counters are pages, kB and
bytes.  The B/KB suffix can tell us that the unit is bytes or kB.  The
rest which is without suffix are pages.

Link: https://lkml.kernel.org/r/20201228164110.2838-5-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Cc: Rafael. J. Wysocki <rafael@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-02-24 13:38:29 -08:00
..
accessibility
acpi More ACPI updates for 5.12-rc1 2021-02-23 15:03:05 -08:00
amba
android
ata
atm atm: idt77252: fix build broken on amd64 2021-02-15 12:36:27 -08:00
auxdisplay
base mm: memcontrol: convert NR_SHMEM_THPS account to pages 2021-02-24 13:38:29 -08:00
bcma
block xen: branch for v5.12-rc1 2021-02-21 13:06:08 -08:00
bluetooth TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
bus ARM: SoC drivers for v5.12 2021-02-20 18:42:28 -08:00
cdrom
char Pull request for IPMI for 5.12 2021-02-22 18:35:18 -08:00
clk This is all driver updates, the majority of which is a bunch of new Qualcomm 2021-02-22 09:45:23 -08:00
clocksource A small set of clockevent fixes which fell through the cracks 2021-02-22 14:11:36 -08:00
connector
counter
cpufreq Merge branches 'pm-cpufreq' and 'pm-opp' 2021-02-23 19:47:03 +01:00
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-02-21 17:23:56 -08:00
dax
dca
devfreq Merge branches 'pm-devfreq' and 'pm-tools' 2021-02-15 17:02:04 +01:00
dio
dma dmaengine updates for v5.12-rc1 2021-02-23 15:05:10 -08:00
dma-buf
edac Merge branch 'edac-misc' into edac-updates-for-v5.12 2021-02-15 10:06:58 +01:00
eisa
extcon
firewire
firmware clang-lto series for v5.12-rc1 2021-02-23 09:28:51 -08:00
fpga
fsi
gnss
gpio gpio updates for v5.12 2021-02-22 10:00:46 -08:00
gpu Modules updates for v5.12 2021-02-23 10:15:33 -08:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2021-02-23 14:52:22 -08:00
hsi
hv Revert "Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer" 2021-02-15 10:49:11 +00:00
hwmon Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
hwspinlock
hwtracing ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
i2c ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
i3c I3C for 5.12 2021-02-22 09:52:55 -08:00
ide
idle
iio - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
infiniband Linux 5.11 2021-02-18 11:19:29 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-02-23 14:56:23 -08:00
interconnect
iommu IOMMU Updates for Linux v5.12 2021-02-22 10:31:29 -08:00
ipack
irqchip irqchip updates for Linux 5.12: 2021-02-15 15:41:56 +01:00
isdn
leds TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
lightnvm lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() 2021-02-14 21:27:24 -07:00
macintosh
mailbox
mcb
md - Fix DM integrity's HMAC support to provide enhanced security of 2021-02-22 10:22:54 -08:00
media Fixes around VM_FPNMAP and follow_pfn 2021-02-22 17:45:02 -08:00
memory ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
memstick
message
mfd - Core Frameworks 2021-02-22 09:29:42 -08:00
misc clang-lto series for v5.12-rc1 2021-02-23 09:28:51 -08:00
mmc ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
most
mtd This pull request contains changes (actually just fixes) for UBIFS 2021-02-21 13:57:08 -08:00
mux
net RDMA 5.12 merge window pull request 2021-02-22 10:27:48 -08:00
nfc
ntb
nubus
nvdimm for-5.12/block-2021-02-17 2021-02-21 11:02:48 -08:00
nvme for-5.12/drivers-2021-02-17 2021-02-21 11:06:54 -08:00
nvmem
of Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
opp opp: Don't skip freq update for different frequency 2021-02-18 12:31:08 +05:30
parisc
parport
pci Fixes around VM_FPNMAP and follow_pfn 2021-02-22 17:45:02 -08:00
pcmcia
perf IOMMU Updates for Linux v5.12 2021-02-22 10:31:29 -08:00
phy
pinctrl This is the bulk of pin control changes for the v5.12 kernel. 2021-02-22 18:39:11 -08:00
platform - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
pnp
power
powercap powercap: intel_rapl: Use topology interface in rapl_init_domains() 2021-02-12 16:53:01 +01:00
pps
ps3
ptp ptp: ptp_clockmatrix: clean-up - parenthesis around a == b are unnecessary 2021-02-17 13:49:26 -08:00
pwm
rapidio
ras
regulator - Core Frameworks 2021-02-22 09:29:42 -08:00
remoteproc
reset ARM: SoC drivers for v5.12 2021-02-20 18:42:28 -08:00
rpmsg
rtc ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
s390 SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
sbus
scsi SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
sfi
sh
siox
slimbus
soc This is all driver updates, the majority of which is a bunch of new Qualcomm 2021-02-22 09:45:23 -08:00
soundwire
spi powerpc updates for 5.12 2021-02-22 14:34:00 -08:00
spmi
ssb
staging media updates for v5.12-rc1 2021-02-21 14:10:36 -08:00
target SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
tc
tee
thermal - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
thunderbolt
tty ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
uio
usb ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
vdpa
vfio
vhost
video ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
xen xen: branch for v5.12-rc1 2021-02-21 13:06:08 -08:00
zorro
Kconfig
Makefile