/usr/src/linux-headers-5.15.0-181/include/linux
NameSizeModeActions
amba/-0755rm
atomic/-0755rm
avf/-0755rm
bcma/-0755rm
byteorder/-0755rm
can/-0755rm
ceph/-0755rm
clk/-0755rm
crush/-0755rm
decompress/-0755rm
device/-0755rm
dma/-0755rm
dsa/-0755rm
extcon/-0755rm
firmware/-0755rm
fpga/-0755rm
fsl/-0755rm
gpio/-0755rm
greybus/-0755rm
hsi/-0755rm
i3c/-0755rm
iio/-0755rm
input/-0755rm
irqchip/-0755rm
isdn/-0755rm
lockd/-0755rm
mailbox/-0755rm
mdio/-0755rm
mfd/-0755rm
mlx4/-0755rm
mlx5/-0755rm
mmc/-0755rm
mtd/-0755rm
mux/-0755rm
net/-0755rm
netfilter/-0755rm
netfilter_arp/-0755rm
netfilter_bridge/-0755rm
netfilter_ipv4/-0755rm
netfilter_ipv6/-0755rm
pcs/-0755rm
perf/-0755rm
phy/-0755rm
pinctrl/-0755rm
platform_data/-0755rm
power/-0755rm
qed/-0755rm
raid/-0755rm
regulator/-0755rm
remoteproc/-0755rm
reset/-0755rm
rpmsg/-0755rm
rtc/-0755rm
sched/-0755rm
soc/-0755rm
soundwire/-0755rm
spi/-0755rm
ssb/-0755rm
sunrpc/-0755rm
surface_aggregator/-0755rm
ulpi/-0755rm
unaligned/-0755rm
usb/-0755rm
8250_pci.h10380644editdlrm
a.out.h3540644editdlrm
acct.h25510644editdlrm
acpi.h409020644editdlrm
acpi_dma.h31540644editdlrm
acpi_iort.h24030644editdlrm
acpi_mdio.h8190644editdlrm
acpi_pmtmr.h6740644editdlrm
acpi_viot.h4780644editdlrm
adb.h18320644editdlrm
adfs_fs.h5740644editdlrm
adreno-smmu-priv.h28070644editdlrm
adxl.h3100644editdlrm
aer.h18220644editdlrm
agpgart.h38810644editdlrm
agp_backend.h35340644editdlrm
ahci-remap.h6070644editdlrm
ahci_platform.h17470644editdlrm
aio.h6510644editdlrm
alarmtimer.h19900644editdlrm
alcor_pci.h90430644editdlrm
align.h5520644editdlrm
altera_jtaguart.h3790644editdlrm
altera_uart.h3970644editdlrm
amd-iommu.h63250644editdlrm
anon_inodes.h6700644editdlrm
apm-emulation.h15990644editdlrm
apm_bios.h23050644editdlrm
apple-gmux.h9180644editdlrm
apple_bl.h4980644editdlrm
arch_topology.h25510644editdlrm
arm-cci.h13900644editdlrm
arm-smccc.h173820644editdlrm
armada-37xx-rwtm-mailbox.h4310644editdlrm
arm_ffa.h75450644editdlrm
arm_sdei.h27300644editdlrm
array_size.h3320644editdlrm
ascii85.h5550644editdlrm
asn1.h18320644editdlrm
asn1_ber_bytecode.h25760644editdlrm
asn1_decoder.h4680644editdlrm
asn1_encoder.h10060644editdlrm
assoc_array.h29490644editdlrm
assoc_array_priv.h54230644editdlrm
async.h44390644editdlrm
async_tx.h68600644editdlrm
ata.h337990644editdlrm
atalk.h45860644editdlrm
ata_platform.h7490644editdlrm
ath9k_platform.h14770644editdlrm
atm.h2870644editdlrm
atmdev.h104770644editdlrm
atmel-isc-media.h21150644editdlrm
atmel-mci.h14290644editdlrm
atmel-ssc.h99710644editdlrm
atmel_pdc.h12950644editdlrm
atm_tcp.h5110644editdlrm
atomic.h26440644editdlrm
attribute_container.h28030644editdlrm
audit.h199210644editdlrm
auto_dev-ioctl.h2960644editdlrm
auto_fs.h2780644editdlrm
auxiliary_bus.h25390644editdlrm
auxvec.h3040644editdlrm
average.h24810644editdlrm
backing-dev-defs.h87530644editdlrm
backing-dev.h121890644editdlrm
backlight.h134470644editdlrm
badblocks.h21880644editdlrm
balloon_compaction.h58920644editdlrm
bcd.h5590644editdlrm
bch.h21520644editdlrm
bcm47xx_nvram.h10330644editdlrm
bcm47xx_sprom.h6160644editdlrm
bcm47xx_wdt.h5550644editdlrm
bcm963xx_nvram.h30360644editdlrm
bcm963xx_tag.h36850644editdlrm
binfmts.h46830644editdlrm
bio.h201080644editdlrm
bitfield.h54600644editdlrm
bitmap.h226640644editdlrm
bitops.h87330644editdlrm
bitrev.h25940644editdlrm
bits.h13870644editdlrm
bit_spinlock.h23600644editdlrm
blk-cgroup.h226480644editdlrm
blk-crypto.h41170644editdlrm
blk-mq-pci.h2690644editdlrm
blk-mq-rdma.h2730644editdlrm
blk-mq-virtio.h2930644editdlrm
blk-mq.h198340644editdlrm
blk-pm.h7080644editdlrm
blkdev.h580410644editdlrm
blkpg.h4360644editdlrm
blktrace_api.h38580644editdlrm
blk_types.h156690644editdlrm
blockgroup_lock.h8100644editdlrm
bma150.h12860644editdlrm
bootconfig.h87120644editdlrm
bootmem_info.h17330644editdlrm
bottom_half.h9740644editdlrm
bpf-cgroup.h187960644editdlrm
bpf-netns.h15590644editdlrm
bpf.h762120644editdlrm
bpfilter.h7910644editdlrm
bpfptr.h20290644editdlrm
bpf_lirc.h6980644editdlrm
bpf_local_storage.h53590644editdlrm
bpf_lsm.h14560644editdlrm
bpf_trace.h1660644editdlrm
bpf_types.h55360644editdlrm
bpf_verifier.h208650644editdlrm
brcmphy.h139940644editdlrm
bsearch.h6240644editdlrm
bsg-lib.h17590644editdlrm
bsg.h4920644editdlrm
btf.h74320644editdlrm
btf_ids.h54630644editdlrm
btree-128.h27370644editdlrm
btree-type.h39910644editdlrm
btree.h70000644editdlrm
btrfs.h1450644editdlrm
buffer_head.h148140644editdlrm
bug.h22200644editdlrm
build-salt.h3750644editdlrm
buildid.h5610644editdlrm
build_bug.h28230644editdlrm
bvec.h63190644editdlrm
c2port.h13840644editdlrm
cache.h26160644editdlrm
cacheinfo.h38370644editdlrm
capability.h84860644editdlrm
cb710.h54900644editdlrm
cciss_ioctl.h10530644editdlrm
ccp.h185770644editdlrm
cc_platform.h23780644editdlrm
cdev.h8450644editdlrm
cdrom.h91970644editdlrm
cfag12864b.h15090644editdlrm
cfi.h11520644editdlrm
cgroup-defs.h248150644editdlrm
cgroup.h288400644editdlrm
cgroup_rdma.h12060644editdlrm
cgroup_subsys.h12590644editdlrm
circ_buf.h11200644editdlrm
cleancache.h39820644editdlrm
cleanup.h49860644editdlrm
clk-provider.h593300644editdlrm
clk.h344180644editdlrm
clkdev.h13220644editdlrm
clockchips.h74450644editdlrm
clocksource.h102270644editdlrm
clocksource_ids.h2470644editdlrm
cm4000_cs.h1990644editdlrm
cma.h20040644editdlrm
cnt32_to_63.h35450644editdlrm
cn_proc.h18900644editdlrm
coda.h22150644editdlrm
compaction.h73190644editdlrm
compat.h321220644editdlrm
compiler-clang.h41500644editdlrm
compiler-gcc.h50210644editdlrm
compiler-intel.h9490644editdlrm
compiler-version.h5170644editdlrm
compiler.h85530644editdlrm
compiler_attributes.h135570644editdlrm
compiler_types.h110230644editdlrm
completion.h41010644editdlrm
component.h41630644editdlrm
configfs.h86830644editdlrm
connector.h39270644editdlrm
console.h77580644editdlrm
consolemap.h10760644editdlrm
console_struct.h72530644editdlrm
const.h4210644editdlrm
container.h6100644editdlrm
context_tracking.h33620644editdlrm
context_tracking_state.h16160644editdlrm
cookie.h12540644editdlrm
cordic.h21320644editdlrm
coredump.h11540644editdlrm
coresight-pmu.h13550644editdlrm
coresight-stm.h1520644editdlrm
coresight.h184490644editdlrm
counter.h153180644editdlrm
count_zeros.h14530644editdlrm
cper.h169470644editdlrm
cpu.h84850644editdlrm
cpufeature.h17510644editdlrm
cpufreq.h335510644editdlrm
cpuhotplug.h169490644editdlrm
cpuidle.h105160644editdlrm
cpuidle_haltpoll.h3120644editdlrm
cpumask.h300890644editdlrm
cpuset.h83510644editdlrm
cpu_cooling.h19010644editdlrm
cpu_pm.h24330644editdlrm
cpu_rmap.h17210644editdlrm
crash_core.h34650644editdlrm
crash_dump.h41490644editdlrm
crc-ccitt.h6090644editdlrm
crc-itu-t.h5310644editdlrm
crc-t10dif.h4530644editdlrm
crc4.h1920644editdlrm
crc7.h3160644editdlrm
crc8.h37470644editdlrm
crc16.h5400644editdlrm
crc32.h28940644editdlrm
crc32c.h3310644editdlrm
crc32poly.h6100644editdlrm
crc64.h2800644editdlrm
cred.h128040644editdlrm
crypto.h278900644editdlrm
cs5535.h62770644editdlrm
ctype.h19120644editdlrm
cuda.h6130644editdlrm
damon.h106010644editdlrm
dasd_mod.h2040644editdlrm
davinci_emac.h10800644editdlrm
dax.h67190644editdlrm
dca.h19220644editdlrm
dcache.h190760644editdlrm
dccp.h109880644editdlrm
debugfs.h122530644editdlrm
debugobjects.h40850644editdlrm
debug_locks.h16270644editdlrm
delay.h24900644editdlrm
delayacct.h55840644editdlrm
delayed_call.h7090644editdlrm
devcoredump.h22660644editdlrm
devfreq-event.h60950644editdlrm
devfreq.h143700644editdlrm
devfreq_cooling.h27630644editdlrm
device-mapper.h193710644editdlrm
device.h339970644editdlrm
device_cgroup.h16090644editdlrm
devm-helpers.h27400644editdlrm
devpts_fs.h11560644editdlrm
dev_printk.h94060644editdlrm
dfl.h24350644editdlrm
digsig.h12120644editdlrm
dim.h94210644editdlrm
dio.h110190644editdlrm
dirent.h2150644editdlrm
dlm.h60050644editdlrm
dlm_plock.h5320644editdlrm
dm-bufio.h49920644editdlrm
dm-dirty-log.h40380644editdlrm
dm-io.h19800644editdlrm
dm-kcopyd.h30130644editdlrm
dm-region-hash.h31820644editdlrm
dm9000.h9870644editdlrm
dma-buf-map.h83180644editdlrm
dma-buf.h209620644editdlrm
dma-direct.h36810644editdlrm
dma-direction.h4070644editdlrm
dma-fence-array.h21910644editdlrm
dma-fence-chain.h31440644editdlrm
dma-fence.h213570644editdlrm
dma-heap.h16160644editdlrm
dma-iommu.h22650644editdlrm
dma-map-ops.h131970644editdlrm
dma-mapping.h205890644editdlrm
dma-resv.h122360644editdlrm
dmaengine.h548510644editdlrm
dmapool.h18320644editdlrm
dmar.h79290644editdlrm
dmi.h43720644editdlrm
dnotify.h10440644editdlrm
dns_resolver.h13900644editdlrm
dqblk_qtree.h22380644editdlrm
dqblk_v1.h3270644editdlrm
dqblk_v2.h4060644editdlrm
drbd.h103110644editdlrm
drbd_genl.h220100644editdlrm
drbd_genl_api.h18080644editdlrm
drbd_limits.h80030644editdlrm
ds2782_battery.h1580644editdlrm
dtlk.h35840644editdlrm
dtpm.h16840644editdlrm
dw_apb_timer.h15660644editdlrm
dynamic_debug.h64710644editdlrm
dynamic_queue_limits.h38120644editdlrm
earlycpio.h3590644editdlrm
ecryptfs.h39150644editdlrm
edac.h199240644editdlrm
edd.h10770644editdlrm
eeprom_93cx6.h27070644editdlrm
eeprom_93xx46.h10620644editdlrm
efi-bgrt.h6440644editdlrm
efi.h430380644editdlrm
efi_embedded_fw.h10600644editdlrm
efs_vh.h15850644editdlrm
eisa.h30310644editdlrm
elevator.h56530644editdlrm
elf-fdpic.h20300644editdlrm
elf-randomize.h5830644editdlrm
elf.h30300644editdlrm
elfcore-compat.h13020644editdlrm
elfcore.h42090644editdlrm
elfnote-lto.h3140644editdlrm
elfnote.h36260644editdlrm
enclosure.h41120644editdlrm
energy_model.h83610644editdlrm
entry-common.h173590644editdlrm
entry-kvm.h28000644editdlrm
err.h15270644editdlrm
errname.h2830644editdlrm
errno.h14810644editdlrm
error-injection.h6070644editdlrm
errqueue.h5240644editdlrm
errseq.h3820644editdlrm
etherdevice.h176070644editdlrm
ethtool.h325050644editdlrm
ethtool_netlink.h20290644editdlrm
eventfd.h23360644editdlrm
eventpoll.h24720644editdlrm
evm.h35000644editdlrm
export.h53940644editdlrm
exportfs.h84210644editdlrm
ext2_fs.h9670644editdlrm
extable.h13090644editdlrm
extcon-provider.h39190644editdlrm
extcon.h103990644editdlrm
f2fs_fs.h194710644editdlrm
f75375s.h5410644editdlrm
falloc.h16240644editdlrm
fanotify.h45470644editdlrm
fault-inject-usercopy.h4960644editdlrm
fault-inject.h19750644editdlrm
fb.h289580644editdlrm
fbcon.h21360644editdlrm
fcdevice.h7740644editdlrm
fcntl.h16980644editdlrm
fd.h4900644editdlrm
fddidevice.h8330644editdlrm
fdtable.h35710644editdlrm
fec.h4630644editdlrm
fiemap.h7130644editdlrm
file.h31580644editdlrm
fileattr.h19520644editdlrm
filter.h439950644editdlrm
fips.h3030644editdlrm
firewire.h137180644editdlrm
firmware-map.h9590644editdlrm
firmware.h33480644editdlrm
fixp-arith.h42900644editdlrm
flat.h26290644editdlrm
flex_proportions.h28810644editdlrm
font.h17140644editdlrm
fortify-string.h93290644editdlrm
freelist.h38900644editdlrm
freezer.h91930644editdlrm
frontswap.h31180644editdlrm
fs.h1255060644editdlrm
fscache-cache.h190250644editdlrm
fscache.h303030644editdlrm
fscrypt.h306220644editdlrm
fsi-occ.h6810644editdlrm
fsi-sbefifo.h6290644editdlrm
fsi.h23180644editdlrm
fsl-diu-fb.h39630644editdlrm
fsldma.h2020644editdlrm
fsl_devices.h42610644editdlrm
fsl_hypervisor.h28240644editdlrm
fsl_ifc.h250630644editdlrm
fsnotify.h102870644editdlrm
fsnotify_backend.h300060644editdlrm
fsverity.h69140644editdlrm
fs_context.h88180644editdlrm
fs_enet_pd.h34570644editdlrm
fs_parser.h45430644editdlrm
fs_pin.h5390644editdlrm
fs_stack.h8110644editdlrm
fs_struct.h10660644editdlrm
fs_types.h20710644editdlrm
fs_uart_pd.h15230644editdlrm
ftrace.h355970644editdlrm
ftrace_irq.h8840644editdlrm
futex.h24970644editdlrm
fwnode.h69890644editdlrm
fwnode_mdio.h8580644editdlrm
gameport.h55490644editdlrm
gcd.h1930644editdlrm
genalloc.h79120644editdlrm
generic-radix-tree.h65040644editdlrm
genetlink.h5890644editdlrm
genhd.h90550644editdlrm
genl_magic_func.h118090644editdlrm
genl_magic_struct.h77930644editdlrm
getcpu.h6410644editdlrm
gfp.h268920644editdlrm
glob.h2560644editdlrm
gnss.h16010644editdlrm
goldfish.h8780644editdlrm
gpio-pxa.h5710644editdlrm
gpio.h54230644editdlrm
gpio_keys.h17820644editdlrm
greybus.h42400644editdlrm
hardirq.h35160644editdlrm
hash.h30710644editdlrm
hashtable.h68270644editdlrm
hdlc.h32670644editdlrm
hdlcdrv.h64680644editdlrm
hdmi.h127050644editdlrm
hid-debug.h14580644editdlrm
hid-roccat.h4840644editdlrm
hid-sensor-hub.h91900644editdlrm
hid-sensor-ids.h76170644editdlrm
hid.h389230644editdlrm
hidden.h9660644editdlrm
hiddev.h14580644editdlrm
hidraw.h11460644editdlrm
highmem-internal.h52390644editdlrm
highmem.h97310644editdlrm
highuid.h31940644editdlrm
hil.h188570644editdlrm
hil_mlc.h52480644editdlrm
hippidevice.h10520644editdlrm
hmm.h41680644editdlrm
host1x.h109930644editdlrm
hpet.h26150644editdlrm
hp_sdc.h143520644editdlrm
hrtimer.h165150644editdlrm
hrtimer_defs.h6600644editdlrm
htcpld.h6170644editdlrm
hugetlb.h304160644editdlrm
hugetlb_cgroup.h72410644editdlrm
hugetlb_inline.h3740644editdlrm
huge_mm.h135930644editdlrm
hwmon-sysfs.h28400644editdlrm
hwmon-vid.h8620644editdlrm
hwmon.h151310644editdlrm
hwspinlock.h161740644editdlrm
hw_breakpoint.h42480644editdlrm
hw_random.h21680644editdlrm
hyperv.h502180644editdlrm
hypervisor.h6080644editdlrm
i2c-algo-bit.h14360644editdlrm
i2c-algo-pca.h29560644editdlrm
i2c-algo-pcf.h12360644editdlrm
i2c-dev.h3710644editdlrm
i2c-mux.h16670644editdlrm
i2c-smbus.h17400644editdlrm
i2c.h395260644editdlrm
i8042.h20410644editdlrm
i8253.h8080644editdlrm
icmp.h10290644editdlrm
icmpv6.h27610644editdlrm
idle_inject.h9320644editdlrm
idr.h99350644editdlrm
ieee80211.h1271320644editdlrm
ieee802154.h113850644editdlrm
if_arp.h18580644editdlrm
if_bridge.h49190644editdlrm
if_eql.h11000644editdlrm
if_ether.h12950644editdlrm
if_fddi.h33150644editdlrm
if_hsr.h5860644editdlrm
if_link.h5920644editdlrm
if_ltalk.h1880644editdlrm
if_macvlan.h27570644editdlrm
if_phonet.h3190644editdlrm
if_pppol2tp.h5160644editdlrm
if_pppox.h29130644editdlrm
if_rmnet.h20840644editdlrm
if_tap.h22660644editdlrm
if_team.h80890644editdlrm
if_tun.h15870644editdlrm
if_tunnel.h4090644editdlrm
if_vlan.h216930644editdlrm
igmp.h44130644editdlrm
ihex.h22060644editdlrm
ima.h59340644editdlrm
imx-media.h6050644editdlrm
in.h23450644editdlrm
in6.h16710644editdlrm
indirect_call_wrapper.h22800644editdlrm
inet.h27070644editdlrm
inetdevice.h90850644editdlrm
inet_diag.h28010644editdlrm
init.h116630644editdlrm
initrd.h10440644editdlrm
init_ohci1394_dma.h1960644editdlrm
init_syscalls.h10370644editdlrm
init_task.h13310644editdlrm
inotify.h7130644editdlrm
input.h203620644editdlrm
instrumentation.h19720644editdlrm
instrumented.h36850644editdlrm
integrity.h11790644editdlrm
intel-iommu.h279340644editdlrm
intel-ish-client-if.h40660644editdlrm
intel-svm.h15810644editdlrm
intel_rapl.h42390644editdlrm
intel_th.h25010644editdlrm
interconnect-provider.h56390644editdlrm
interconnect.h29510644editdlrm
interrupt.h258330644editdlrm
interval_tree.h8310644editdlrm
interval_tree_generic.h68630644editdlrm
io-64-nonatomic-hi-lo.h24680644editdlrm
io-64-nonatomic-lo-hi.h24680644editdlrm
io-mapping.h47570644editdlrm
io-pgtable.h88570644editdlrm
io.h51410644editdlrm
ioam6.h2260644editdlrm
ioam6_genl.h2660644editdlrm
ioam6_iptunnel.h2850644editdlrm
ioasid.h21190644editdlrm
iocontext.h46990644editdlrm
iomap.h121980644editdlrm
iommu-helper.h11460644editdlrm
iommu.h348730644editdlrm
iopoll.h77950644editdlrm
ioport.h125770644editdlrm
ioprio.h17720644editdlrm
iova.h63420644editdlrm
io_uring.h8810644editdlrm
ip.h10240644editdlrm
ipack.h89000644editdlrm
ipc.h6130644editdlrm
ipc_namespace.h57640644editdlrm
ipmi.h111460644editdlrm
ipmi_smi.h81690644editdlrm
ipv6.h89120644editdlrm
ipv6_route.h3720644editdlrm
irq.h427640644editdlrm
irqbypass.h35350644editdlrm
irqchip.h23870644editdlrm
irqdesc.h79320644editdlrm
irqdomain.h207270644editdlrm
irqflags.h81000644editdlrm
irqhandler.h3000644editdlrm
irqnr.h8560644editdlrm
irqreturn.h5030644editdlrm
irq_poll.h5750644editdlrm
irq_sim.h7890644editdlrm
irq_work.h18620644editdlrm
isa.h21670644editdlrm
isapnp.h29440644editdlrm
iscsi_boot_sysfs.h37960644editdlrm
iscsi_ibft.h8470644editdlrm
iversion.h126700644editdlrm
jbd2.h524330644editdlrm
jhash.h46730644editdlrm
jiffies.h154300644editdlrm
journal-head.h29840644editdlrm
joystick.h4370644editdlrm
jump_label.h164360644editdlrm
jump_label_ratelimit.h28410644editdlrm
jz4740-adc.h10230644editdlrm
jz4780-nemc.h9760644editdlrm
kallsyms.h47570644editdlrm
kasan-checks.h14950644editdlrm
kasan-tags.h4870644editdlrm
kasan.h137180644editdlrm
kbd_diacr.h1980644editdlrm
kbd_kern.h36870644editdlrm
kbuild.h3800644editdlrm
kconfig.h26910644editdlrm
kcore.h8910644editdlrm
kcov.h25350644editdlrm
kcsan-checks.h162450644editdlrm
kcsan.h19300644editdlrm
kdb.h75080644editdlrm
kdebug.h4870644editdlrm
kdev_t.h18430644editdlrm
kernel-page-flags.h5280644editdlrm
kernel.h174180644editdlrm
kernelcapi.h14850644editdlrm
kernel_read_file.h16760644editdlrm
kernel_stat.h30450644editdlrm
kernfs.h186840644editdlrm
kern_levels.h16110644editdlrm
kexec.h127420644editdlrm
key-type.h67880644editdlrm
key.h161280644editdlrm
keyboard.h6650644editdlrm
keyctl.h12760644editdlrm
keyslot-manager.h38680644editdlrm
kfence.h87680644editdlrm
kfifo.h268040644editdlrm
kgdb.h123420644editdlrm
khugepaged.h28100644editdlrm
klist.h19220644editdlrm
kmemleak.h33490644editdlrm
kmod.h10450644editdlrm
kmsg_dump.h27720644editdlrm
kobject.h78830644editdlrm
kobject_ns.h19430644editdlrm
kobj_map.h5450644editdlrm
kprobes.h150740644editdlrm
kref.h31550644editdlrm
ks0108.h9700644editdlrm
ks8842.h6320644editdlrm
ks8851_mll.h4720644editdlrm
ksm.h25330644editdlrm
kstrtox.h67510644editdlrm
kthread.h78720644editdlrm
ktime.h55120644editdlrm
kvm_dirty_ring.h27940644editdlrm
kvm_host.h600200644editdlrm
kvm_irqfd.h20430644editdlrm
kvm_para.h4020644editdlrm
kvm_types.h22220644editdlrm
l2tp.h2610644editdlrm
lantiq.h3650644editdlrm
lapb.h17520644editdlrm
latencytop.h11920644editdlrm
lcd.h38670644editdlrm
lcm.h2750644editdlrm
led-class-flash.h69000644editdlrm
led-class-multicolor.h33380644editdlrm
led-lm3530.h37860644editdlrm
leds-bd2802.h4760644editdlrm
leds-lp3944.h9500644editdlrm
leds-lp3952.h24100644editdlrm
leds-pca9532.h8660644editdlrm
leds-regulator.h11680644editdlrm
leds-ti-lmu-common.h11490644editdlrm
leds.h184920644editdlrm
libata.h690460644editdlrm
libfdt.h2020644editdlrm
libfdt_env.h4910644editdlrm
libgcc.h4630644editdlrm
libnvdimm.h106240644editdlrm
libps2.h19310644editdlrm
license.h4180644editdlrm
limits.h7150644editdlrm
linear_range.h17660644editdlrm
linkage.h98260644editdlrm
linkmode.h25590644editdlrm
linux_logo.h19560644editdlrm
lis3lv02d.h51250644editdlrm
list.h312000644editdlrm
list_bl.h49050644editdlrm
list_lru.h74630644editdlrm
list_nulls.h43220644editdlrm
list_sort.h3740644editdlrm
litex.h21070644editdlrm
livepatch.h84190644editdlrm
llc.h7490644editdlrm
llist.h92800644editdlrm
local_lock.h13620644editdlrm
local_lock_internal.h34990644editdlrm
lockdep.h220030644editdlrm
lockdep_types.h53080644editdlrm
lockref.h15410644editdlrm
log2.h63660644editdlrm
logic_iomem.h21240644editdlrm
logic_pio.h33100644editdlrm
lp.h28270644editdlrm
lru_cache.h121110644editdlrm
lsm_audit.h28730644editdlrm
lsm_hooks.h761740644editdlrm
lsm_hook_defs.h215110644editdlrm
lz4.h270750644editdlrm
lzo.h19800644editdlrm
mailbox_client.h17540644editdlrm
mailbox_controller.h58350644editdlrm
maple.h27750644editdlrm
marvell_phy.h17340644editdlrm
math.h51850644editdlrm
math64.h76560644editdlrm
mbcache.h22080644editdlrm
mbus.h31680644editdlrm
mc6821.h12090644editdlrm
mc146818rtc.h48000644editdlrm
mcb.h37960644editdlrm
mdev.h60810644editdlrm
mdio-bitbang.h13380644editdlrm
mdio-gpio.h1770644editdlrm
mdio-mux.h10210644editdlrm
mdio.h129900644editdlrm
mei_cl_bus.h38430644editdlrm
memblock.h203530644editdlrm
memcontrol.h446280644editdlrm
memfd.h7190644editdlrm
memory.h61320644editdlrm
memory_hotplug.h116890644editdlrm
mempolicy.h75480644editdlrm
mempool.h34300644editdlrm
memregion.h4170644editdlrm
memremap.h57490644editdlrm
memstick.h98320644editdlrm
mem_encrypt.h8850644editdlrm
mhi.h266640644editdlrm
micrel_phy.h18800644editdlrm
microchipphy.h27100644editdlrm
migrate.h55370644editdlrm
migrate_mode.h7580644editdlrm
mii.h167260644editdlrm
mii_timestamper.h36530644editdlrm
minmax.h102420644editdlrm
min_heap.h33770644editdlrm
miscdevice.h32780644editdlrm
misc_cgroup.h30210644editdlrm
mISDNdsp.h12170644editdlrm
mISDNhw.h55230644editdlrm
mISDNif.h152500644editdlrm
mm.h1082270644editdlrm
mman.h40530644editdlrm
mmap_lock.h43530644editdlrm
mmdebug.h23080644editdlrm
mmiotrace.h31220644editdlrm
mmu_context.h8550644editdlrm
mmu_notifier.h252290644editdlrm
mmzone.h485300644editdlrm
mm_inline.h29860644editdlrm
mm_types.h257340644editdlrm
mm_types_task.h25550644editdlrm
mnt_idmapping.h78380644editdlrm
mnt_namespace.h6970644editdlrm
module.h245400644editdlrm
moduleloader.h34980644editdlrm
moduleparam.h228910644editdlrm
module_signature.h12500644editdlrm
mod_devicetable.h240640644editdlrm
most.h124910644editdlrm
mount.h40230644editdlrm
moxtet.h24210644editdlrm
mpage.h7370644editdlrm
mpi.h86120644editdlrm
mpls.h3940644editdlrm
mpls_iptunnel.h1780644editdlrm
mroute.h20040644editdlrm
mroute6.h24660644editdlrm
mroute_base.h124630644editdlrm
msdos_fs.h2730644editdlrm
msdos_partition.h16550644editdlrm
msg.h3950644editdlrm
msi.h157270644editdlrm
mtio.h13170644editdlrm
mutex.h74830644editdlrm
mv643xx.h522710644editdlrm
mv643xx_eth.h20010644editdlrm
mv643xx_i2c.h3350644editdlrm
mvebu-pmsu.h5200644editdlrm
mxm-wmi.h3990644editdlrm
namei.h46830644editdlrm
nd.h56850644editdlrm
ndctl.h6740644editdlrm
net.h117490644editdlrm
netdevice.h1727810644editdlrm
netdev_features.h110100644editdlrm
netfilter.h138860644editdlrm
netfilter_bridge.h21280644editdlrm
netfilter_defs.h2420644editdlrm
netfilter_ingress.h14740644editdlrm
netfilter_ipv4.h10770644editdlrm
netfilter_ipv6.h59880644editdlrm
netfs.h81250644editdlrm
netlink.h80700644editdlrm
netpoll.h24730644editdlrm
nfs.h15020644editdlrm
nfs3.h2600644editdlrm
nfs4.h198360644editdlrm
nfsacl.h14350644editdlrm
nfs_common.h4020644editdlrm
nfs_fs.h208790644editdlrm
nfs_fs_i.h3080644editdlrm
nfs_fs_sb.h104950644editdlrm
nfs_iostat.h42850644editdlrm
nfs_page.h69640644editdlrm
nfs_ssc.h20610644editdlrm
nfs_xdr.h432720644editdlrm
nitro_enclaves.h2670644editdlrm
nl802154.h39380644editdlrm
nls.h31620644editdlrm
nmi.h69260644editdlrm
node.h47870644editdlrm
nodemask.h175770644editdlrm
nospec.h22900644editdlrm
notifier.h80320644editdlrm
nsc_gpio.h14590644editdlrm
nsproxy.h31650644editdlrm
ns_common.h2830644editdlrm
ntb.h536910644editdlrm
ntb_transport.h38920644editdlrm
nubus.h56750644editdlrm
numa.h12780644editdlrm
nvme-fc-driver.h469580644editdlrm
nvme-fc.h99550644editdlrm
nvme-rdma.h20850644editdlrm
nvme-tcp.h45220644editdlrm
nvme.h392350644editdlrm
nvmem-consumer.h69420644editdlrm
nvmem-provider.h47720644editdlrm
nvram.h35500644editdlrm
objagg.h19830644editdlrm
objtool.h53680644editdlrm
of.h444460644editdlrm
of_address.h42700644editdlrm
of_clk.h8190644editdlrm
of_device.h30350644editdlrm
of_dma.h23530644editdlrm
of_fdt.h37330644editdlrm
of_gpio.h41700644editdlrm
of_graph.h36360644editdlrm
of_iommu.h5050644editdlrm
of_irq.h38430644editdlrm
of_mdio.h39990644editdlrm
of_net.h10090644editdlrm
of_pci.h9150644editdlrm
of_pdt.h11630644editdlrm
of_platform.h39740644editdlrm
of_reserved_mem.h22980644editdlrm
oid_registry.h57670644editdlrm
olpc-ec.h20000644editdlrm
omap-dma.h100210644editdlrm
omap-gpmc.h27040644editdlrm
omap-iommu.h8800644editdlrm
omap-mailbox.h6890644editdlrm
omapfb.h5760644editdlrm
once.h28650644editdlrm
once_lite.h9250644editdlrm
oom.h33410644editdlrm
openvswitch.h4030644editdlrm
osq_lock.h10660644editdlrm
overflow.h80070644editdlrm
packing.h18030644editdlrm
padata.h61040644editdlrm
page-flags-layout.h32870644editdlrm
page-flags.h286730644editdlrm
page-isolation.h16800644editdlrm
pageblock-flags.h23630644editdlrm
pagemap.h312340644editdlrm
pagevec.h20900644editdlrm
pagewalk.h43170644editdlrm
page_counter.h23590644editdlrm
page_ext.h18770644editdlrm
page_idle.h26710644editdlrm
page_owner.h23610644editdlrm
page_ref.h50730644editdlrm
page_reporting.h8950644editdlrm
panic.h26560644editdlrm
panic_notifier.h2960644editdlrm
parman.h29340644editdlrm
parport.h195440644editdlrm
parport_pc.h67130644editdlrm
parser.h11950644editdlrm
part_stat.h24330644editdlrm
pata_arasan_cf_data.h12500644editdlrm
patchkey.h7570644editdlrm
path.h5720644editdlrm
pch_dma.h4080644editdlrm
pci-acpi.h39440644editdlrm
pci-ats.h18020644editdlrm
pci-dma-compat.h37490644editdlrm
pci-ecam.h32800644editdlrm
pci-ep-cfs.h9560644editdlrm
pci-epc.h96980644editdlrm
pci-epf.h72270644editdlrm
pci-p2pdma.h40490644editdlrm
pci.h928510644editdlrm
pci_hotplug.h44580644editdlrm
pci_ids.h1241410644editdlrm
pcs-lynx.h4250644editdlrm
pda_power.h10050644editdlrm
pe.h165540644editdlrm
percpu-defs.h185580644editdlrm
percpu-refcount.h111020644editdlrm
percpu-rwsem.h42570644editdlrm
percpu.h48500644editdlrm
percpu_counter.h56090644editdlrm
perf_event.h483650644editdlrm
perf_regs.h10760644editdlrm
personality.h3930644editdlrm
pfn.h6660644editdlrm
pfn_t.h32870644editdlrm
pgalloc.h9480644editdlrm
pgtable.h455000644editdlrm
phonet.h5370644editdlrm
phy.h594750644editdlrm
phylink.h199390644editdlrm
phy_fixed.h18140644editdlrm
phy_led_triggers.h10350644editdlrm
pid.h65210644editdlrm
pid_namespace.h21330644editdlrm
pim.h27370644editdlrm
pipe_fs_i.h94330644editdlrm
pkeys.h9900644editdlrm
pktcdvd.h60110644editdlrm
pl320-ipc.h2090644editdlrm
platform_device.h130740644editdlrm
platform_profile.h11500644editdlrm
pldmfw.h48790644editdlrm
plist.h88720644editdlrm
pm-trace.h9400644editdlrm
pm.h357090644editdlrm
pmbus.h25430644editdlrm
pmu.h25020644editdlrm
pm_clock.h26370644editdlrm
pm_domain.h135010644editdlrm
pm_opp.h154660644editdlrm
pm_qos.h106630644editdlrm
pm_runtime.h201650644editdlrm
pm_wakeirq.h15180644editdlrm
pm_wakeup.h64270644editdlrm
pnfs_osd_xdr.h94900644editdlrm
pnp.h152530644editdlrm
poison.h25400644editdlrm
poll.h43700644editdlrm
posix-clock.h48080644editdlrm
posix-timers.h73860644editdlrm
posix_acl.h33470644editdlrm
posix_acl_xattr.h19090644editdlrm
powercap.h122630644editdlrm
power_supply.h182270644editdlrm
ppp-comp.h30230644editdlrm
ppp_channel.h30640644editdlrm
ppp_defs.h3050644editdlrm
pps_kernel.h30100644editdlrm
pr.h5660644editdlrm
prandom.h34580644editdlrm
preempt.h150480644editdlrm
prefetch.h17400644editdlrm
prime_numbers.h13840644editdlrm
printk.h227250644editdlrm
prmt.h1430644editdlrm
processor.h18890644editdlrm
proc_fs.h88110644editdlrm
proc_ns.h26270644editdlrm
profile.h26840644editdlrm
projid.h22690644editdlrm
property.h180690644editdlrm
pruss_driver.h12970644editdlrm
psci.h15590644editdlrm
pseudo_fs.h3550644editdlrm
psi.h15960644editdlrm
psi_types.h44160644editdlrm
psp-sev.h181880644editdlrm
psp-tee.h27160644editdlrm
pstore.h78080644editdlrm
pstore_blk.h15670644editdlrm
pstore_ram.h39070644editdlrm
pstore_zone.h23360644editdlrm
ptdump.h5670644editdlrm
pti.h2400644editdlrm
ptp_classify.h49650644editdlrm
ptp_clock_kernel.h124900644editdlrm
ptp_kvm.h4600644editdlrm
ptp_pch.h6230644editdlrm
ptrace.h150010644editdlrm
ptr_ring.h166790644editdlrm
purgatory.h5900644editdlrm
pvclock_gtod.h5480644editdlrm
pwm.h168510644editdlrm
pwm_backlight.h7220644editdlrm
pxa2xx_ssp.h113920644editdlrm
pxa168_eth.h7280644editdlrm
qcom-geni-se.h140650644editdlrm
qcom_scm.h39000644editdlrm
qnx6_fs.h33490644editdlrm
quota.h192170644editdlrm
quotaops.h105230644editdlrm
radix-tree.h160080644editdlrm
raid_class.h20480644editdlrm
ramfs.h7460644editdlrm
random.h40730644editdlrm
randomize_kstack.h25220644editdlrm
range.h7750644editdlrm
ras.h10440644editdlrm
ratelimit.h17610644editdlrm
ratelimit_types.h13570644editdlrm
rational.h6390644editdlrm
rbtree.h91480644editdlrm
rbtree_augmented.h97560644editdlrm
rbtree_latch.h68190644editdlrm
rbtree_types.h9460644editdlrm
rculist.h292420644editdlrm
rculist_bl.h33740644editdlrm
rculist_nulls.h88880644editdlrm
rcupdate.h396200644editdlrm
rcupdate_trace.h31580644editdlrm
rcupdate_wait.h17690644editdlrm
rcutiny.h33970644editdlrm
rcutree.h24010644editdlrm
rcuwait.h18840644editdlrm
rcu_node_tree.h38180644editdlrm
rcu_segcblist.h102730644editdlrm
rcu_sync.h14940644editdlrm
reboot-mode.h6000644editdlrm
reboot.h22350644editdlrm
reciprocal_div.h33560644editdlrm
refcount.h123050644editdlrm
regmap.h655030644editdlrm
regset.h116260644editdlrm
relay.h86690644editdlrm
remoteproc.h253600644editdlrm
resctrl.h66510644editdlrm
reset-controller.h36550644editdlrm
reset.h309640644editdlrm
resource.h3390644editdlrm
resource_ext.h21350644editdlrm
restart_block.h11380644editdlrm
rfkill.h107750644editdlrm
rhashtable-types.h35360644editdlrm
rhashtable.h384920644editdlrm
ring_buffer.h77390644editdlrm
rio.h194720644editdlrm
rio_drv.h146600644editdlrm
rio_ids.h11040644editdlrm
rio_regs.h195240644editdlrm
rmap.h93460644editdlrm
rmi.h123300644editdlrm
rndis.h172690644editdlrm
rodata_test.h3940644editdlrm
root_dev.h6190644editdlrm
rpmsg.h89780644editdlrm
rslib.h37530644editdlrm
rtc.h88610644editdlrm
rtmutex.h30370644editdlrm
rtnetlink.h45620644editdlrm
rtsx_common.h8900644editdlrm
rtsx_pci.h407740644editdlrm
rtsx_usb.h157470644editdlrm
rwbase_rt.h8760644editdlrm
rwlock.h46640644editdlrm
rwlock_api_smp.h78290644editdlrm
rwlock_rt.h30530644editdlrm
rwlock_types.h18140644editdlrm
rwsem.h78100644editdlrm
s3c_adc_battery.h9230644editdlrm
sbitmap.h173060644editdlrm
scatterlist.h179810644editdlrm
scc.h29050644editdlrm
sched.h662820644editdlrm
sched_clock.h14720644editdlrm
scmi_protocol.h266810644editdlrm
scpi_protocol.h27290644editdlrm
screen_info.h1910644editdlrm
scs.h18690644editdlrm
sctp.h234310644editdlrm
scx200.h18630644editdlrm
scx200_gpio.h24380644editdlrm
sdb.h42700644editdlrm
seccomp.h35330644editdlrm
secretmem.h11690644editdlrm
securebits.h2390644editdlrm
security.h603380644editdlrm
sed-opal.h16960644editdlrm
seg6.h1210644editdlrm
seg6_genl.h1360644editdlrm
seg6_hmac.h1360644editdlrm
seg6_iptunnel.h1480644editdlrm
seg6_local.h1000644editdlrm
selection.h18540644editdlrm
sem.h5990644editdlrm
semaphore.h13840644editdlrm
seqlock.h404550644editdlrm
seqno-fence.h36550644editdlrm
seq_buf.h40300644editdlrm
seq_file.h92200644editdlrm
seq_file_net.h7300644editdlrm
serdev.h100510644editdlrm
serial.h6300644editdlrm
serial_8250.h67280644editdlrm
serial_bcm63xx.h48430644editdlrm
serial_core.h209500644editdlrm
serial_max3100.h12160644editdlrm
serial_s3c.h96490644editdlrm
serial_sci.h16350644editdlrm
serio.h43830644editdlrm
set_memory.h16980644editdlrm
sfp.h162530644editdlrm
shdma-base.h43700644editdlrm
shm.h9680644editdlrm
shmem_fs.h59540644editdlrm
shrinker.h33280644editdlrm
sh_clk.h60980644editdlrm
sh_dma.h35500644editdlrm
sh_eth.h3690644editdlrm
sh_intc.h36790644editdlrm
sh_timer.h1720644editdlrm
signal.h140830644editdlrm
signalfd.h8170644editdlrm
signal_types.h17250644editdlrm
siox.h23130644editdlrm
siphash.h57250644editdlrm
sizes.h13050644editdlrm
skbuff.h1411470644editdlrm
skb_array.h53050644editdlrm
skmsg.h137620644editdlrm
slab.h243130644editdlrm
slab_def.h30910644editdlrm
slimbus.h70960644editdlrm
slub_def.h63670644editdlrm
sm501-regs.h119000644editdlrm
sm501.h41140644editdlrm
smc91x.h16040644editdlrm
smc911x.h2940644editdlrm
smp.h78180644editdlrm
smpboot.h17250644editdlrm
smp_types.h13820644editdlrm
smsc911x.h16700644editdlrm
smscphy.h12830644editdlrm
socket.h154600644editdlrm
sockptr.h24140644editdlrm
sock_diag.h23700644editdlrm
sonet.h4690644editdlrm
sony-laptop.h14400644editdlrm
sonypi.h17550644editdlrm
sort.h3460644editdlrm
sound.h6850644editdlrm
soundcard.h16310644editdlrm
spinlock.h154370644editdlrm
spinlock_api_smp.h56050644editdlrm
spinlock_api_up.h33940644editdlrm
spinlock_rt.h42090644editdlrm
spinlock_types.h18260644editdlrm
spinlock_types_raw.h17260644editdlrm
spinlock_types_up.h7260644editdlrm
spinlock_up.h22110644editdlrm
splice.h33900644editdlrm
spmi.h57250644editdlrm
sram.h8440644editdlrm
srcu.h72430644editdlrm
srcutiny.h28130644editdlrm
srcutree.h49160644editdlrm
ssbi.h7260644editdlrm
stackdepot.h6860644editdlrm
stackleak.h9020644editdlrm
stackprotector.h3610644editdlrm
stacktrace.h40660644editdlrm
start_kernel.h4150644editdlrm
stat.h13660644editdlrm
statfs.h18270644editdlrm
static_call.h105000644editdlrm
static_call_types.h28090644editdlrm
static_key.h300644editdlrm
stdarg.h3130644editdlrm
stddef.h32760644editdlrm
stm.h44490644editdlrm
stmmac.h70290644editdlrm
stmp3xxx_rtc_wdt.h3310644editdlrm
stmp_device.h4120644editdlrm
stop_machine.h45170644editdlrm
string.h99890644editdlrm
stringhash.h27150644editdlrm
stringify.h3410644editdlrm
string_helpers.h27580644editdlrm
sungem_phy.h40310644editdlrm
sunserialcore.h11020644editdlrm
sunxi-rsb.h29560644editdlrm
superhyway.h28780644editdlrm
surface_acpi_notify.h10910644editdlrm
suspend.h204960644editdlrm
svga.h38370644editdlrm
sw842.h3280644editdlrm
swab.h5690644editdlrm
swait.h96780644editdlrm
swap.h239920644editdlrm
swapfile.h5560644editdlrm
swapops.h98390644editdlrm
swap_cgroup.h9710644editdlrm
swap_slots.h8410644editdlrm
swiotlb.h54900644editdlrm
switchtec.h111580644editdlrm
sxgbe_platform.h12610644editdlrm
synclink.h9890644editdlrm
sync_core.h5810644editdlrm
sync_file.h16060644editdlrm
sys.h9600644editdlrm
syscalls.h568930644editdlrm
syscall_user_dispatch.h9300644editdlrm
syscore_ops.h6330644editdlrm
sysctl.h88000644editdlrm
sysfb.h27390644editdlrm
sysfs.h180600644editdlrm
syslog.h12660644editdlrm
sysrq.h20020644editdlrm
sysv_fs.h92500644editdlrm
sys_soc.h12940644editdlrm
t10-pi.h15380644editdlrm
taskstats_kern.h9570644editdlrm
task_io_accounting.h11590644editdlrm
task_io_accounting_ops.h26100644editdlrm
task_work.h9340644editdlrm
tboot.h34070644editdlrm
tc.h35340644editdlrm
tca6416_keypad.h6830644editdlrm
tcp.h175530644editdlrm
tee_drv.h187910644editdlrm
textsearch.h48670644editdlrm
textsearch_fsm.h12140644editdlrm
tfrc.h17220644editdlrm
thermal.h158090644editdlrm
threads.h13140644editdlrm
thread_info.h70560644editdlrm
thunderbolt.h212790644editdlrm
ti-emif-sram.h52700644editdlrm
tick.h102880644editdlrm
tifm.h47700644editdlrm
timb_dma.h11930644editdlrm
timb_gpio.h7170644editdlrm
time.h32160644editdlrm
time32.h17950644editdlrm
time64.h45960644editdlrm
timecounter.h42430644editdlrm
timekeeper_internal.h54550644editdlrm
timekeeping.h77890644editdlrm
timer.h81460644editdlrm
timerfd.h5080644editdlrm
timeriomem-rng.h4320644editdlrm
timerqueue.h14300644editdlrm
timex.h68260644editdlrm
time_namespace.h39070644editdlrm
ti_wilink_st.h137810644editdlrm
tnum.h34670644editdlrm
topology.h53770644editdlrm
torture.h45840644editdlrm
toshiba.h4600644editdlrm
tpm.h113400644editdlrm
tpm_command.h8470644editdlrm
tpm_eventlog.h66860644editdlrm
trace.h27900644editdlrm
tracefs.h10180644editdlrm
tracehook.h81580644editdlrm
tracepoint-defs.h23950644editdlrm
tracepoint.h184320644editdlrm
trace_clock.h6670644editdlrm
trace_events.h283420644editdlrm
trace_recursion.h56180644editdlrm
trace_seq.h40390644editdlrm
transport_class.h26410644editdlrm
ts-nbus.h5320644editdlrm
tsacct_kern.h12300644editdlrm
tty.h148690644editdlrm
tty_buffer.h13080644editdlrm
tty_driver.h160620644editdlrm
tty_flip.h17340644editdlrm
tty_ldisc.h86650644editdlrm
tty_port.h74130644editdlrm
typecheck.h7820644editdlrm
types.h58130644editdlrm
u64_stats_sync.h65630644editdlrm
uacce.h38770644editdlrm
uaccess.h133780644editdlrm
ucb1400.h42210644editdlrm
ucs2_string.h6620644editdlrm
udp.h54280644editdlrm
uidgid.h41710644editdlrm
uio.h93190644editdlrm
uio_driver.h48220644editdlrm
umh.h18370644editdlrm
unicode.h10460644editdlrm
units.h26540644editdlrm
uprobes.h61430644editdlrm
usb.h796270644editdlrm
usbdevice_fs.h22340644editdlrm
usb_usual.h36710644editdlrm
user-return-notifier.h12050644editdlrm
user.h220644editdlrm
userfaultfd_k.h65900644editdlrm
usermode_driver.h5150644editdlrm
user_namespace.h61790644editdlrm
util_macros.h25480644editdlrm
uts.h3880644editdlrm
utsname.h18270644editdlrm
uuid.h24000644editdlrm
vbox_utils.h17900644editdlrm
vdpa.h147230644editdlrm
verification.h18150644editdlrm
vermagic.h13080644editdlrm
vexpress.h2970644editdlrm
vfio.h84970644editdlrm
vfio_pci_core.h82660644editdlrm
vfs.h1160644editdlrm
vgaarb.h39720644editdlrm
vga_switcheroo.h88280644editdlrm
vhost_iotlb.h13690644editdlrm
via-core.h67230644editdlrm
via-gpio.h3100644editdlrm
via.h9320644editdlrm
via_i2c.h8440644editdlrm
videodev2.h27690644editdlrm
virtio.h68570644editdlrm
virtio_byteorder.h14910644editdlrm
virtio_caif.h5130644editdlrm
virtio_config.h166430644editdlrm
virtio_console.h19740644editdlrm
virtio_dma_buf.h11470644editdlrm
virtio_net.h61530644editdlrm
virtio_pci_modern.h33310644editdlrm
virtio_ring.h30200644editdlrm
virtio_vsock.h49070644editdlrm
visorbus.h125250644editdlrm
vlynq.h33000644editdlrm
vmacache.h7220644editdlrm
vmalloc.h85970644editdlrm
vme.h57950644editdlrm
vmpressure.h17240644editdlrm
vmstat.h151400644editdlrm
vmw_vmci_api.h29540644editdlrm
vmw_vmci_defs.h307510644editdlrm
vm_event_item.h35380644editdlrm
vringh.h88300644editdlrm
vsc.h19190644editdlrm
vt.h6110644editdlrm
vtime.h47090644editdlrm
vt_buffer.h15300644editdlrm
vt_kern.h54330644editdlrm
w1-gpio.h4930644editdlrm
w1.h91400644editdlrm
wait.h430530644editdlrm
wait_bit.h114680644editdlrm
watchdog.h84090644editdlrm
watch_queue.h39150644editdlrm
win_minmax.h8320644editdlrm
wireless.h16070644editdlrm
wkup_m3_ipc.h17950644editdlrm
wl12xx.h8100644editdlrm
wm97xx.h108420644editdlrm
wmi.h15980644editdlrm
workqueue.h229770644editdlrm
writeback.h131380644editdlrm
wwan.h52550644editdlrm
ww_mutex.h134260644editdlrm
xarray.h578090644editdlrm
xattr.h39770644editdlrm
xxhash.h84730644editdlrm
xz.h114270644editdlrm
yam.h22300644editdlrm
z2_battery.h2990644editdlrm
zconf.h17700644editdlrm
zlib.h287850644editdlrm
zorro.h36530644editdlrm
zpool.h33180644editdlrm
zsmalloc.h16680644editdlrm
zstd.h497460644editdlrm
zutil.h27930644editdlrm
Edit: /usr/src/linux-headers-5.15.0-181/include/linux/mm.h (108227B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_MM_H #define _LINUX_MM_H #include #ifdef __KERNEL__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct mempolicy; struct anon_vma; struct anon_vma_chain; struct file_ra_state; struct user_struct; struct writeback_control; struct bdi_writeback; struct pt_regs; extern int sysctl_page_lock_unfairness; void init_mm_internals(void); #ifndef CONFIG_NUMA /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr; static inline void set_max_mapnr(unsigned long limit) { max_mapnr = limit; } #else static inline void set_max_mapnr(unsigned long limit) { } #endif extern atomic_long_t _totalram_pages; static inline unsigned long totalram_pages(void) { return (unsigned long)atomic_long_read(&_totalram_pages); } static inline void totalram_pages_inc(void) { atomic_long_inc(&_totalram_pages); } static inline void totalram_pages_dec(void) { atomic_long_dec(&_totalram_pages); } static inline void totalram_pages_add(long count) { atomic_long_add(count, &_totalram_pages); } extern void * high_memory; extern int page_cluster; #ifdef CONFIG_SYSCTL extern int sysctl_legacy_va_layout; #else #define sysctl_legacy_va_layout 0 #endif #ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS extern const int mmap_rnd_bits_min; extern const int mmap_rnd_bits_max; extern int mmap_rnd_bits __read_mostly; #endif #ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS extern const int mmap_rnd_compat_bits_min; extern const int mmap_rnd_compat_bits_max; extern int mmap_rnd_compat_bits __read_mostly; #endif #include #include /* * Architectures that support memory tagging (assigning tags to memory regions, * embedding these tags into addresses that point to these memory regions, and * checking that the memory and the pointer tags match on memory accesses) * redefine this macro to strip tags from pointers. * It's defined as noop for architectures that don't support memory tagging. */ #ifndef untagged_addr #define untagged_addr(addr) (addr) #endif #ifndef __pa_symbol #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) #endif #ifndef page_to_virt #define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x))) #endif #ifndef lm_alias #define lm_alias(x) __va(__pa_symbol(x)) #endif /* * To prevent common memory management code establishing * a zero page mapping on a read fault. * This macro should be defined within . * s390 does this to prevent multiplexing of hardware bits * related to the physical page in case of virtualization. */ #ifndef mm_forbids_zeropage #define mm_forbids_zeropage(X) (0) #endif /* * On some architectures it is expensive to call memset() for small sizes. * If an architecture decides to implement their own version of * mm_zero_struct_page they should wrap the defines below in a #ifndef and * define their own version of this macro in */ #if BITS_PER_LONG == 64 /* This function must be updated when the size of struct page grows above 80 * or reduces below 56. The idea that compiler optimizes out switch() * statement, and only leaves move/store instructions. Also the compiler can * combine write statements if they are both assignments and can be reordered, * this can result in several of the writes here being dropped. */ #define mm_zero_struct_page(pp) __mm_zero_struct_page(pp) static inline void __mm_zero_struct_page(struct page *page) { unsigned long *_pp = (void *)page; /* Check that struct page is either 56, 64, 72, or 80 bytes */ BUILD_BUG_ON(sizeof(struct page) & 7); BUILD_BUG_ON(sizeof(struct page) < 56); BUILD_BUG_ON(sizeof(struct page) > 80); switch (sizeof(struct page)) { case 80: _pp[9] = 0; fallthrough; case 72: _pp[8] = 0; fallthrough; case 64: _pp[7] = 0; fallthrough; case 56: _pp[6] = 0; _pp[5] = 0; _pp[4] = 0; _pp[3] = 0; _pp[2] = 0; _pp[1] = 0; _pp[0] = 0; } } #else #define mm_zero_struct_page(pp) ((void)memset((pp), 0, sizeof(struct page))) #endif /* * Default maximum number of active map areas, this limits the number of vmas * per mm struct. Users can overwrite this number by sysctl but there is a * problem. * * When a program's coredump is generated as ELF format, a section is created * per a vma. In ELF, the number of sections is represented in unsigned short. * This means the number of sections should be smaller than 65535 at coredump. * Because the kernel adds some informative sections to a image of program at * generating coredump, we need some margin. The number of extra sections is * 1-3 now and depends on arch. We use "5" as safe margin, here. * * ELF extended numbering allows more than 65535 sections, so 16-bit bound is * not a hard limit any more. Although some userspace tools can be surprised by * that. */ #define MAPCOUNT_ELF_CORE_MARGIN (5) #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) extern int sysctl_max_map_count; extern unsigned long sysctl_user_reserve_kbytes; extern unsigned long sysctl_admin_reserve_kbytes; extern int sysctl_overcommit_memory; extern int sysctl_overcommit_ratio; extern unsigned long sysctl_overcommit_kbytes; int overcommit_ratio_handler(struct ctl_table *, int, void *, size_t *, loff_t *); int overcommit_kbytes_handler(struct ctl_table *, int, void *, size_t *, loff_t *); int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *, loff_t *); /* * Any attempt to mark this function as static leads to build failure * when CONFIG_DEBUG_INFO_BTF is enabled because __add_to_page_cache_locked() * is referred to by BPF code. This must be visible for error injection. */ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping, pgoff_t index, gfp_t gfp, void **shadowp); #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) #else #define nth_page(page,n) ((page) + (n)) #endif /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) /* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */ #define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)(addr), PAGE_SIZE) #define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) void setup_initial_init_mm(void *start_code, void *end_code, void *end_data, void *brk); /* * Linux kernel virtual memory manager primitives. * The idea being to have a "virtual" mm in the same way * we have a virtual fs - giving a cleaner interface to the * mm details, and allowing different kinds of memory mappings * (from shared memory to executable loading to arbitrary * mmap() functions). */ struct vm_area_struct *vm_area_alloc(struct mm_struct *); struct vm_area_struct *vm_area_dup(struct vm_area_struct *); void vm_area_free(struct vm_area_struct *); #ifndef CONFIG_MMU extern struct rb_root nommu_region_tree; extern struct rw_semaphore nommu_region_sem; extern unsigned int kobjsize(const void *objp); #endif /* * vm_flags in vm_area_struct, see mm_types.h. * When changing, update also include/trace/events/mmflags.h */ #define VM_NONE 0x00000000 #define VM_READ 0x00000001 /* currently active flags */ #define VM_WRITE 0x00000002 #define VM_EXEC 0x00000004 #define VM_SHARED 0x00000008 /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */ #define VM_MAYREAD 0x00000010 /* limits for mprotect() etc */ #define VM_MAYWRITE 0x00000020 #define VM_MAYEXEC 0x00000040 #define VM_MAYSHARE 0x00000080 #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ #define VM_UFFD_MISSING 0x00000200 /* missing pages tracking */ #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ #define VM_UFFD_WP 0x00001000 /* wrprotect pages tracking */ #define VM_LOCKED 0x00002000 #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ /* Used by sys_madvise() */ #define VM_SEQ_READ 0x00008000 /* App will access data sequentially */ #define VM_RAND_READ 0x00010000 /* App will not benefit from clustered reads */ #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ #define VM_LOCKONFAULT 0x00080000 /* Lock the pages covered when they are faulted in */ #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ #define VM_SYNC 0x00800000 /* Synchronous page faults */ #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ #define VM_WIPEONFORK 0x02000000 /* Wipe VMA contents in child. */ #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ #ifdef CONFIG_MEM_SOFT_DIRTY # define VM_SOFTDIRTY 0x08000000 /* Not soft dirty clean area */ #else # define VM_SOFTDIRTY 0 #endif #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ #define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */ #define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */ #define VM_MERGEABLE BIT(31) /* KSM may merge identical pages */ #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS #define VM_HIGH_ARCH_BIT_0 32 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_1 33 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_2 34 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_3 35 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_4 36 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_0 BIT(VM_HIGH_ARCH_BIT_0) #define VM_HIGH_ARCH_1 BIT(VM_HIGH_ARCH_BIT_1) #define VM_HIGH_ARCH_2 BIT(VM_HIGH_ARCH_BIT_2) #define VM_HIGH_ARCH_3 BIT(VM_HIGH_ARCH_BIT_3) #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ #ifdef CONFIG_ARCH_HAS_PKEYS # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 # define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */ # define VM_PKEY_BIT1 VM_HIGH_ARCH_1 /* on x86 and 5-bit value on ppc64 */ # define VM_PKEY_BIT2 VM_HIGH_ARCH_2 # define VM_PKEY_BIT3 VM_HIGH_ARCH_3 #ifdef CONFIG_PPC # define VM_PKEY_BIT4 VM_HIGH_ARCH_4 #else # define VM_PKEY_BIT4 0 #endif #endif /* CONFIG_ARCH_HAS_PKEYS */ #if defined(CONFIG_X86) # define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */ #elif defined(CONFIG_PPC) # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ #elif defined(CONFIG_PARISC) # define VM_GROWSUP VM_ARCH_1 #elif defined(CONFIG_IA64) # define VM_GROWSUP VM_ARCH_1 #elif defined(CONFIG_SPARC64) # define VM_SPARC_ADI VM_ARCH_1 /* Uses ADI tag for access control */ # define VM_ARCH_CLEAR VM_SPARC_ADI #elif defined(CONFIG_ARM64) # define VM_ARM64_BTI VM_ARCH_1 /* BTI guarded page, a.k.a. GP bit */ # define VM_ARCH_CLEAR VM_ARM64_BTI #elif !defined(CONFIG_MMU) # define VM_MAPPED_COPY VM_ARCH_1 /* T if mapped copy of data (nommu mmap) */ #endif #if defined(CONFIG_ARM64_MTE) # define VM_MTE VM_HIGH_ARCH_0 /* Use Tagged memory for access control */ # define VM_MTE_ALLOWED VM_HIGH_ARCH_1 /* Tagged memory permitted */ #else # define VM_MTE VM_NONE # define VM_MTE_ALLOWED VM_NONE #endif #ifndef VM_GROWSUP # define VM_GROWSUP VM_NONE #endif #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR # define VM_UFFD_MINOR_BIT 37 # define VM_UFFD_MINOR BIT(VM_UFFD_MINOR_BIT) /* UFFD minor faults */ #else /* !CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ # define VM_UFFD_MINOR VM_NONE #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ /* Bits set in the VMA until the stack is in its final location */ #define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ) #define TASK_EXEC ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) /* Common data flag combinations */ #define VM_DATA_FLAGS_TSK_EXEC (VM_READ | VM_WRITE | TASK_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #define VM_DATA_FLAGS_NON_EXEC (VM_READ | VM_WRITE | VM_MAYREAD | \ VM_MAYWRITE | VM_MAYEXEC) #define VM_DATA_FLAGS_EXEC (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #ifndef VM_DATA_DEFAULT_FLAGS /* arch can override this */ #define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_EXEC #endif #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS #endif #ifdef CONFIG_STACK_GROWSUP #define VM_STACK VM_GROWSUP #else #define VM_STACK VM_GROWSDOWN #endif #define VM_STACK_FLAGS (VM_STACK | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) /* VMA basic access permission flags */ #define VM_ACCESS_FLAGS (VM_READ | VM_WRITE | VM_EXEC) /* * Special vmas that are non-mergable, non-mlock()able. */ #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP) /* This mask prevents VMA from being scanned with khugepaged */ #define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB) /* This mask defines which mm->def_flags a process can inherit its parent */ #define VM_INIT_DEF_MASK VM_NOHUGEPAGE /* This mask is used to clear all the VMA flags used by mlock */ #define VM_LOCKED_CLEAR_MASK (~(VM_LOCKED | VM_LOCKONFAULT)) /* Arch-specific flags to clear when updating VM flags on protection change */ #ifndef VM_ARCH_CLEAR # define VM_ARCH_CLEAR VM_NONE #endif #define VM_FLAGS_CLEAR (ARCH_VM_PKEY_FLAGS | VM_ARCH_CLEAR) /* * mapping from the currently active vm_flags protection bits (the * low four bits) to a page protection mask.. */ extern pgprot_t protection_map[16]; /** * enum fault_flag - Fault flag definitions. * @FAULT_FLAG_WRITE: Fault was a write fault. * @FAULT_FLAG_MKWRITE: Fault was mkwrite of existing PTE. * @FAULT_FLAG_ALLOW_RETRY: Allow to retry the fault if blocked. * @FAULT_FLAG_RETRY_NOWAIT: Don't drop mmap_lock and wait when retrying. * @FAULT_FLAG_KILLABLE: The fault task is in SIGKILL killable region. * @FAULT_FLAG_TRIED: The fault has been tried once. * @FAULT_FLAG_USER: The fault originated in userspace. * @FAULT_FLAG_REMOTE: The fault is not for current task/mm. * @FAULT_FLAG_INSTRUCTION: The fault was during an instruction fetch. * @FAULT_FLAG_INTERRUPTIBLE: The fault can be interrupted by non-fatal signals. * * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify * whether we would allow page faults to retry by specifying these two * fault flags correctly. Currently there can be three legal combinations: * * (a) ALLOW_RETRY and !TRIED: this means the page fault allows retry, and * this is the first try * * (b) ALLOW_RETRY and TRIED: this means the page fault allows retry, and * we've already tried at least once * * (c) !ALLOW_RETRY and !TRIED: this means the page fault does not allow retry * * The unlisted combination (!ALLOW_RETRY && TRIED) is illegal and should never * be used. Note that page faults can be allowed to retry for multiple times, * in which case we'll have an initial fault with flags (a) then later on * continuous faults with flags (b). We should always try to detect pending * signals before a retry to make sure the continuous page faults can still be * interrupted if necessary. */ enum fault_flag { FAULT_FLAG_WRITE = 1 << 0, FAULT_FLAG_MKWRITE = 1 << 1, FAULT_FLAG_ALLOW_RETRY = 1 << 2, FAULT_FLAG_RETRY_NOWAIT = 1 << 3, FAULT_FLAG_KILLABLE = 1 << 4, FAULT_FLAG_TRIED = 1 << 5, FAULT_FLAG_USER = 1 << 6, FAULT_FLAG_REMOTE = 1 << 7, FAULT_FLAG_INSTRUCTION = 1 << 8, FAULT_FLAG_INTERRUPTIBLE = 1 << 9, }; /* * The default fault flags that should be used by most of the * arch-specific page fault handlers. */ #define FAULT_FLAG_DEFAULT (FAULT_FLAG_ALLOW_RETRY | \ FAULT_FLAG_KILLABLE | \ FAULT_FLAG_INTERRUPTIBLE) /** * fault_flag_allow_retry_first - check ALLOW_RETRY the first time * @flags: Fault flags. * * This is mostly used for places where we want to try to avoid taking * the mmap_lock for too long a time when waiting for another condition * to change, in which case we can try to be polite to release the * mmap_lock in the first round to avoid potential starvation of other * processes that would also want the mmap_lock. * * Return: true if the page fault allows retry and this is the first * attempt of the fault handling; false otherwise. */ static inline bool fault_flag_allow_retry_first(enum fault_flag flags) { return (flags & FAULT_FLAG_ALLOW_RETRY) && (!(flags & FAULT_FLAG_TRIED)); } #define FAULT_FLAG_TRACE \ { FAULT_FLAG_WRITE, "WRITE" }, \ { FAULT_FLAG_MKWRITE, "MKWRITE" }, \ { FAULT_FLAG_ALLOW_RETRY, "ALLOW_RETRY" }, \ { FAULT_FLAG_RETRY_NOWAIT, "RETRY_NOWAIT" }, \ { FAULT_FLAG_KILLABLE, "KILLABLE" }, \ { FAULT_FLAG_TRIED, "TRIED" }, \ { FAULT_FLAG_USER, "USER" }, \ { FAULT_FLAG_REMOTE, "REMOTE" }, \ { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } /* * vm_fault is filled by the pagefault handler and passed to the vma's * ->fault function. The vma's ->fault is responsible for returning a bitmask * of VM_FAULT_xxx flags that give details about how the fault was handled. * * MM layer fills up gfp_mask for page allocations but fault handler might * alter it if its implementation requires a different allocation context. * * pgoff should be used in favour of virtual_address, if possible. */ struct vm_fault { const struct { struct vm_area_struct *vma; /* Target VMA */ gfp_t gfp_mask; /* gfp mask to be used for allocations */ pgoff_t pgoff; /* Logical page offset based on vma */ unsigned long address; /* Faulting virtual address */ }; enum fault_flag flags; /* FAULT_FLAG_xxx flags * XXX: should really be 'const' */ pmd_t *pmd; /* Pointer to pmd entry matching * the 'address' */ pud_t *pud; /* Pointer to pud entry matching * the 'address' */ union { pte_t orig_pte; /* Value of PTE at the time of fault */ pmd_t orig_pmd; /* Value of PMD at the time of fault, * used by PMD fault only. */ }; struct page *cow_page; /* Page handler may use for COW fault */ struct page *page; /* ->fault handlers should return a * page here, unless VM_FAULT_NOPAGE * is set (which is also implied by * VM_FAULT_ERROR). */ /* These three entries are valid only while holding ptl lock */ pte_t *pte; /* Pointer to pte entry matching * the 'address'. NULL if the page * table hasn't been allocated. */ spinlock_t *ptl; /* Page table lock. * Protects pte page table if 'pte' * is not NULL, otherwise pmd. */ pgtable_t prealloc_pte; /* Pre-allocated pte page table. * vm_ops->map_pages() sets up a page * table from atomic context. * do_fault_around() pre-allocates * page table to avoid allocation from * atomic context. */ }; /* page entry size for vm->huge_fault() */ enum page_entry_size { PE_SIZE_PTE = 0, PE_SIZE_PMD, PE_SIZE_PUD, }; /* * These are the virtual MM functions - opening of an area, closing and * unmapping it (needed to keep files on disk up-to-date etc), pointer * to the functions called when a no-page or a wp-page exception occurs. */ struct vm_operations_struct { void (*open)(struct vm_area_struct * area); void (*close)(struct vm_area_struct * area); /* Called any time before splitting to check if it's allowed */ int (*may_split)(struct vm_area_struct *area, unsigned long addr); int (*mremap)(struct vm_area_struct *area); /* * Called by mprotect() to make driver-specific permission * checks before mprotect() is finalised. The VMA must not * be modified. Returns 0 if eprotect() can proceed. */ int (*mprotect)(struct vm_area_struct *vma, unsigned long start, unsigned long end, unsigned long newflags); vm_fault_t (*fault)(struct vm_fault *vmf); vm_fault_t (*huge_fault)(struct vm_fault *vmf, enum page_entry_size pe_size); vm_fault_t (*map_pages)(struct vm_fault *vmf, pgoff_t start_pgoff, pgoff_t end_pgoff); unsigned long (*pagesize)(struct vm_area_struct * area); /* notification that a previously read-only page is about to become * writable, if an error is returned it will cause a SIGBUS */ vm_fault_t (*page_mkwrite)(struct vm_fault *vmf); /* same as page_mkwrite when using VM_PFNMAP|VM_MIXEDMAP */ vm_fault_t (*pfn_mkwrite)(struct vm_fault *vmf); /* called by access_process_vm when get_user_pages() fails, typically * for use by special VMAs. See also generic_access_phys() for a generic * implementation useful for any iomem mapping. */ int (*access)(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write); /* Called by the /proc/PID/maps code to ask the vma whether it * has a special name. Returning non-NULL will also cause this * vma to be dumped unconditionally. */ const char *(*name)(struct vm_area_struct *vma); #ifdef CONFIG_NUMA /* * set_policy() op must add a reference to any non-NULL @new mempolicy * to hold the policy upon return. Caller should pass NULL @new to * remove a policy and fall back to surrounding context--i.e. do not * install a MPOL_DEFAULT policy, nor the task or system default * mempolicy. */ int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); /* * get_policy() op must add reference [mpol_get()] to any policy at * (vma,addr) marked as MPOL_SHARED. The shared policy infrastructure * in mm/mempolicy.c will do this automatically. * get_policy() must NOT add a ref if the policy at (vma,addr) is not * marked as MPOL_SHARED. vma policies are protected by the mmap_lock. * If no [shared/vma] mempolicy exists at the addr, get_policy() op * must return NULL--i.e., do not "fallback" to task or system default * policy. */ struct mempolicy *(*get_policy)(struct vm_area_struct *vma, unsigned long addr); #endif /* * Called by vm_normal_page() for special PTEs to find the * page for @addr. This is useful if the default behavior * (using pte_page()) would not find the correct page. */ struct page *(*find_special_page)(struct vm_area_struct *vma, unsigned long addr); }; static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm) { static const struct vm_operations_struct dummy_vm_ops = {}; memset(vma, 0, sizeof(*vma)); vma->vm_mm = mm; vma->vm_ops = &dummy_vm_ops; INIT_LIST_HEAD(&vma->anon_vma_chain); } static inline void vma_set_anonymous(struct vm_area_struct *vma) { vma->vm_ops = NULL; } static inline bool vma_is_anonymous(struct vm_area_struct *vma) { return !vma->vm_ops; } static inline bool vma_is_temporary_stack(struct vm_area_struct *vma) { int maybe_stack = vma->vm_flags & (VM_GROWSDOWN | VM_GROWSUP); if (!maybe_stack) return false; if ((vma->vm_flags & VM_STACK_INCOMPLETE_SETUP) == VM_STACK_INCOMPLETE_SETUP) return true; return false; } static inline bool vma_is_foreign(struct vm_area_struct *vma) { if (!current->mm) return true; if (current->mm != vma->vm_mm) return true; return false; } static inline bool vma_is_accessible(struct vm_area_struct *vma) { return vma->vm_flags & VM_ACCESS_FLAGS; } static inline bool is_shared_maywrite(vm_flags_t vm_flags) { return (vm_flags & (VM_SHARED | VM_MAYWRITE)) == (VM_SHARED | VM_MAYWRITE); } static inline bool vma_is_shared_maywrite(struct vm_area_struct *vma) { return is_shared_maywrite(vma->vm_flags); } #ifdef CONFIG_SHMEM /* * The vma_is_shmem is not inline because it is used only by slow * paths in userfault. */ bool vma_is_shmem(struct vm_area_struct *vma); #else static inline bool vma_is_shmem(struct vm_area_struct *vma) { return false; } #endif int vma_is_stack_for_current(struct vm_area_struct *vma); /* flush_tlb_range() takes a vma, not a mm, and can care about flags */ #define TLB_FLUSH_VMA(mm,flags) { .vm_mm = (mm), .vm_flags = (flags) } struct mmu_gather; struct inode; #include /* * Methods to modify the page usage count. * * What counts for a page usage: * - cache mapping (page->mapping) * - private data (page->private) * - page mapped in a task's page tables, each mapping * is counted separately * * Also, many kernel routines increase the page count before a critical * routine so they can be sure the page doesn't go away from under them. */ /* * Drop a ref, return true if the refcount fell to zero (the page has no users) */ static inline int put_page_testzero(struct page *page) { VM_BUG_ON_PAGE(page_ref_count(page) == 0, page); return page_ref_dec_and_test(page); } /* * Try to grab a ref unless the page has a refcount of zero, return false if * that is the case. * This can be called when MMU is off so it must not access * any of the virtual mappings. */ static inline int get_page_unless_zero(struct page *page) { return page_ref_add_unless(page, 1, 0); } extern int page_is_ram(unsigned long pfn); enum { REGION_INTERSECTS, REGION_DISJOINT, REGION_MIXED, }; int region_intersects(resource_size_t offset, size_t size, unsigned long flags, unsigned long desc); /* Support for virtually mapped pages */ struct page *vmalloc_to_page(const void *addr); unsigned long vmalloc_to_pfn(const void *addr); /* * Determine if an address is within the vmalloc range * * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there * is no special casing required. */ #ifndef is_ioremap_addr #define is_ioremap_addr(x) is_vmalloc_addr(x) #endif #ifdef CONFIG_MMU extern bool is_vmalloc_addr(const void *x); extern int is_vmalloc_or_module_addr(const void *x); #else static inline bool is_vmalloc_addr(const void *x) { return false; } static inline int is_vmalloc_or_module_addr(const void *x) { return 0; } #endif extern void *kvmalloc_node(size_t size, gfp_t flags, int node); static inline void *kvmalloc(size_t size, gfp_t flags) { return kvmalloc_node(size, flags, NUMA_NO_NODE); } static inline void *kvzalloc_node(size_t size, gfp_t flags, int node) { return kvmalloc_node(size, flags | __GFP_ZERO, node); } static inline void *kvzalloc(size_t size, gfp_t flags) { return kvmalloc(size, flags | __GFP_ZERO); } static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags) { size_t bytes; if (unlikely(check_mul_overflow(n, size, &bytes))) return NULL; return kvmalloc(bytes, flags); } static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) { return kvmalloc_array(n, size, flags | __GFP_ZERO); } extern void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags); extern void kvfree(const void *addr); extern void kvfree_sensitive(const void *addr, size_t len); static inline int head_compound_mapcount(struct page *head) { return atomic_read(compound_mapcount_ptr(head)) + 1; } /* * Mapcount of compound page as a whole, does not include mapped sub-pages. * * Must be called only for compound pages or any their tail sub-pages. */ static inline int compound_mapcount(struct page *page) { VM_BUG_ON_PAGE(!PageCompound(page), page); page = compound_head(page); return head_compound_mapcount(page); } /* * The atomic page->_mapcount, starts from -1: so that transitions * both from it and to it can be tracked, using atomic_inc_and_test * and atomic_add_negative(-1). */ static inline void page_mapcount_reset(struct page *page) { atomic_set(&(page)->_mapcount, -1); } int __page_mapcount(struct page *page); /* * Mapcount of 0-order page; when compound sub-page, includes * compound_mapcount(). * * Result is undefined for pages which cannot be mapped into userspace. * For example SLAB or special types of pages. See function page_has_type(). * They use this place in struct page differently. */ static inline int page_mapcount(struct page *page) { if (unlikely(PageCompound(page))) return __page_mapcount(page); return atomic_read(&page->_mapcount) + 1; } #ifdef CONFIG_TRANSPARENT_HUGEPAGE int total_mapcount(struct page *page); int page_trans_huge_mapcount(struct page *page, int *total_mapcount); #else static inline int total_mapcount(struct page *page) { return page_mapcount(page); } static inline int page_trans_huge_mapcount(struct page *page, int *total_mapcount) { int mapcount = page_mapcount(page); if (total_mapcount) *total_mapcount = mapcount; return mapcount; } #endif static inline struct page *virt_to_head_page(const void *x) { struct page *page = virt_to_page(x); return compound_head(page); } void __put_page(struct page *page); void put_pages_list(struct list_head *pages); void split_page(struct page *page, unsigned int order); void copy_huge_page(struct page *dst, struct page *src); /* * Compound pages have a destructor function. Provide a * prototype for that function and accessor functions. * These are _only_ valid on the head of a compound page. */ typedef void compound_page_dtor(struct page *); /* Keep the enum in sync with compound_page_dtors array in mm/page_alloc.c */ enum compound_dtor_id { NULL_COMPOUND_DTOR, COMPOUND_PAGE_DTOR, #ifdef CONFIG_HUGETLB_PAGE HUGETLB_PAGE_DTOR, #endif #ifdef CONFIG_TRANSPARENT_HUGEPAGE TRANSHUGE_PAGE_DTOR, #endif NR_COMPOUND_DTORS, }; extern compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS]; static inline void set_compound_page_dtor(struct page *page, enum compound_dtor_id compound_dtor) { VM_BUG_ON_PAGE(compound_dtor >= NR_COMPOUND_DTORS, page); page[1].compound_dtor = compound_dtor; } static inline void destroy_compound_page(struct page *page) { VM_BUG_ON_PAGE(page[1].compound_dtor >= NR_COMPOUND_DTORS, page); compound_page_dtors[page[1].compound_dtor](page); } static inline unsigned int compound_order(struct page *page) { if (!PageHead(page)) return 0; return page[1].compound_order; } static inline bool hpage_pincount_available(struct page *page) { /* * Can the page->hpage_pinned_refcount field be used? That field is in * the 3rd page of the compound page, so the smallest (2-page) compound * pages cannot support it. */ page = compound_head(page); return PageCompound(page) && compound_order(page) > 1; } static inline int head_compound_pincount(struct page *head) { return atomic_read(compound_pincount_ptr(head)); } static inline int compound_pincount(struct page *page) { VM_BUG_ON_PAGE(!hpage_pincount_available(page), page); page = compound_head(page); return head_compound_pincount(page); } static inline void set_compound_order(struct page *page, unsigned int order) { page[1].compound_order = order; page[1].compound_nr = 1U << order; } /* Returns the number of pages in this potentially compound page. */ static inline unsigned long compound_nr(struct page *page) { if (!PageHead(page)) return 1; return page[1].compound_nr; } /* Returns the number of bytes in this potentially compound page. */ static inline unsigned long page_size(struct page *page) { return PAGE_SIZE << compound_order(page); } /* Returns the number of bits needed for the number of bytes in a page */ static inline unsigned int page_shift(struct page *page) { return PAGE_SHIFT + compound_order(page); } void free_compound_page(struct page *page); #ifdef CONFIG_MMU /* * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when * servicing faults for write access. In the normal case, do always want * pte_mkwrite. But get_user_pages can cause write faults for mappings * that do not have writing enabled, when used by access_process_vm. */ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) { if (likely(vma->vm_flags & VM_WRITE)) pte = pte_mkwrite(pte); return pte; } vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page); void do_set_pte(struct vm_fault *vmf, struct page *page, unsigned long addr); vm_fault_t finish_fault(struct vm_fault *vmf); vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf); #endif /* * Multiple processes may "see" the same page. E.g. for untouched * mappings of /dev/null, all processes see the same page full of * zeroes, and text pages of executables and shared libraries have * only one copy in memory, at most, normally. * * For the non-reserved pages, page_count(page) denotes a reference count. * page_count() == 0 means the page is free. page->lru is then used for * freelist management in the buddy allocator. * page_count() > 0 means the page has been allocated. * * Pages are allocated by the slab allocator in order to provide memory * to kmalloc and kmem_cache_alloc. In this case, the management of the * page, and the fields in 'struct page' are the responsibility of mm/slab.c * unless a particular usage is carefully commented. (the responsibility of * freeing the kmalloc memory is the caller's, of course). * * A page may be used by anyone else who does a __get_free_page(). * In this case, page_count still tracks the references, and should only * be used through the normal accessor functions. The top bits of page->flags * and page->virtual store page management information, but all other fields * are unused and could be used privately, carefully. The management of this * page is the responsibility of the one who allocated it, and those who have * subsequently been given references to it. * * The other pages (we may call them "pagecache pages") are completely * managed by the Linux memory manager: I/O, buffers, swapping etc. * The following discussion applies only to them. * * A pagecache page contains an opaque `private' member, which belongs to the * page's address_space. Usually, this is the address of a circular list of * the page's disk buffers. PG_private must be set to tell the VM to call * into the filesystem to release these pages. * * A page may belong to an inode's memory mapping. In this case, page->mapping * is the pointer to the inode, and page->index is the file offset of the page, * in units of PAGE_SIZE. * * If pagecache pages are not associated with an inode, they are said to be * anonymous pages. These may become associated with the swapcache, and in that * case PG_swapcache is set, and page->private is an offset into the swapcache. * * In either case (swapcache or inode backed), the pagecache itself holds one * reference to the page. Setting PG_private should also increment the * refcount. The each user mapping also has a reference to the page. * * The pagecache pages are stored in a per-mapping radix tree, which is * rooted at mapping->i_pages, and indexed by offset. * Where 2.4 and early 2.6 kernels kept dirty/clean pages in per-address_space * lists, we instead now tag pages as dirty/writeback in the radix tree. * * All pagecache pages may be subject to I/O: * - inode pages may need to be read from disk, * - inode pages which have been modified and are MAP_SHARED may need * to be written back to the inode on disk, * - anonymous pages (including MAP_PRIVATE file mappings) which have been * modified may need to be swapped out to swap space and (later) to be read * back into memory. */ /* * The zone field is never updated after free_area_init_core() * sets it, so none of the operations on it need to be atomic. */ /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_CPUPID] | ... | FLAGS | */ #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) #define LAST_CPUPID_PGOFF (ZONES_PGOFF - LAST_CPUPID_WIDTH) #define KASAN_TAG_PGOFF (LAST_CPUPID_PGOFF - KASAN_TAG_WIDTH) /* * Define the bit shifts to access each section. For non-existent * sections we define the shift as 0; that plus a 0 mask ensures * the compiler will optimise away reference to them. */ #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) #define LAST_CPUPID_PGSHIFT (LAST_CPUPID_PGOFF * (LAST_CPUPID_WIDTH != 0)) #define KASAN_TAG_PGSHIFT (KASAN_TAG_PGOFF * (KASAN_TAG_WIDTH != 0)) /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ #ifdef NODE_NOT_IN_PAGE_FLAGS #define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) #define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ SECTIONS_PGOFF : ZONES_PGOFF) #else #define ZONEID_SHIFT (NODES_SHIFT + ZONES_SHIFT) #define ZONEID_PGOFF ((NODES_PGOFF < ZONES_PGOFF)? \ NODES_PGOFF : ZONES_PGOFF) #endif #define ZONEID_PGSHIFT (ZONEID_PGOFF * (ZONEID_SHIFT != 0)) #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) #define NODES_MASK ((1UL << NODES_WIDTH) - 1) #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) #define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_SHIFT) - 1) #define KASAN_TAG_MASK ((1UL << KASAN_TAG_WIDTH) - 1) #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) static inline enum zone_type page_zonenum(const struct page *page) { ASSERT_EXCLUSIVE_BITS(page->flags, ZONES_MASK << ZONES_PGSHIFT); return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; } #ifdef CONFIG_ZONE_DEVICE static inline bool is_zone_device_page(const struct page *page) { return page_zonenum(page) == ZONE_DEVICE; } extern void memmap_init_zone_device(struct zone *, unsigned long, unsigned long, struct dev_pagemap *); #else static inline bool is_zone_device_page(const struct page *page) { return false; } #endif static inline bool is_zone_movable_page(const struct page *page) { return page_zonenum(page) == ZONE_MOVABLE; } #ifdef CONFIG_DEV_PAGEMAP_OPS void free_devmap_managed_page(struct page *page); DECLARE_STATIC_KEY_FALSE(devmap_managed_key); static inline bool page_is_devmap_managed(struct page *page) { if (!static_branch_unlikely(&devmap_managed_key)) return false; if (!is_zone_device_page(page)) return false; switch (page->pgmap->type) { case MEMORY_DEVICE_PRIVATE: case MEMORY_DEVICE_FS_DAX: return true; default: break; } return false; } void put_devmap_managed_page(struct page *page); #else /* CONFIG_DEV_PAGEMAP_OPS */ static inline bool page_is_devmap_managed(struct page *page) { return false; } static inline void put_devmap_managed_page(struct page *page) { } #endif /* CONFIG_DEV_PAGEMAP_OPS */ static inline bool is_device_private_page(const struct page *page) { return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) && IS_ENABLED(CONFIG_DEVICE_PRIVATE) && is_zone_device_page(page) && page->pgmap->type == MEMORY_DEVICE_PRIVATE; } static inline bool is_pci_p2pdma_page(const struct page *page) { return IS_ENABLED(CONFIG_DEV_PAGEMAP_OPS) && IS_ENABLED(CONFIG_PCI_P2PDMA) && is_zone_device_page(page) && page->pgmap->type == MEMORY_DEVICE_PCI_P2PDMA; } /* 127: arbitrary random number, small enough to assemble well */ #define page_ref_zero_or_close_to_overflow(page) \ ((unsigned int) page_ref_count(page) + 127u <= 127u) static inline void get_page(struct page *page) { page = compound_head(page); /* * Getting a normal page or the head of a compound page * requires to already have an elevated page->_refcount. */ VM_BUG_ON_PAGE(page_ref_zero_or_close_to_overflow(page), page); page_ref_inc(page); } bool __must_check try_grab_page(struct page *page, unsigned int flags); struct page *try_grab_compound_head(struct page *page, int refs, unsigned int flags); static inline __must_check bool try_get_page(struct page *page) { page = compound_head(page); if (WARN_ON_ONCE(page_ref_count(page) <= 0)) return false; page_ref_inc(page); return true; } static inline void put_page(struct page *page) { page = compound_head(page); /* * For devmap managed pages we need to catch refcount transition from * 2 to 1, when refcount reach one it means the page is free and we * need to inform the device driver through callback. See * include/linux/memremap.h and HMM for details. */ if (page_is_devmap_managed(page)) { put_devmap_managed_page(page); return; } if (put_page_testzero(page)) __put_page(page); } /* * GUP_PIN_COUNTING_BIAS, and the associated functions that use it, overload * the page's refcount so that two separate items are tracked: the original page * reference count, and also a new count of how many pin_user_pages() calls were * made against the page. ("gup-pinned" is another term for the latter). * * With this scheme, pin_user_pages() becomes special: such pages are marked as * distinct from normal pages. As such, the unpin_user_page() call (and its * variants) must be used in order to release gup-pinned pages. * * Choice of value: * * By making GUP_PIN_COUNTING_BIAS a power of two, debugging of page reference * counts with respect to pin_user_pages() and unpin_user_page() becomes * simpler, due to the fact that adding an even power of two to the page * refcount has the effect of using only the upper N bits, for the code that * counts up using the bias value. This means that the lower bits are left for * the exclusive use of the original code that increments and decrements by one * (or at least, by much smaller values than the bias value). * * Of course, once the lower bits overflow into the upper bits (and this is * OK, because subtraction recovers the original values), then visual inspection * no longer suffices to directly view the separate counts. However, for normal * applications that don't have huge page reference counts, this won't be an * issue. * * Locking: the lockless algorithm described in page_cache_get_speculative() * and page_cache_gup_pin_speculative() provides safe operation for * get_user_pages and page_mkclean and other calls that race to set up page * table entries. */ #define GUP_PIN_COUNTING_BIAS (1U << 10) void unpin_user_page(struct page *page); void unpin_user_pages_dirty_lock(struct page **pages, unsigned long npages, bool make_dirty); void unpin_user_page_range_dirty_lock(struct page *page, unsigned long npages, bool make_dirty); void unpin_user_pages(struct page **pages, unsigned long npages); /** * page_maybe_dma_pinned - Report if a page is pinned for DMA. * @page: The page. * * This function checks if a page has been pinned via a call to * a function in the pin_user_pages() family. * * For non-huge pages, the return value is partially fuzzy: false is not fuzzy, * because it means "definitely not pinned for DMA", but true means "probably * pinned for DMA, but possibly a false positive due to having at least * GUP_PIN_COUNTING_BIAS worth of normal page references". * * False positives are OK, because: a) it's unlikely for a page to get that many * refcounts, and b) all the callers of this routine are expected to be able to * deal gracefully with a false positive. * * For huge pages, the result will be exactly correct. That's because we have * more tracking data available: the 3rd struct page in the compound page is * used to track the pincount (instead using of the GUP_PIN_COUNTING_BIAS * scheme). * * For more information, please see Documentation/core-api/pin_user_pages.rst. * * Return: True, if it is likely that the page has been "dma-pinned". * False, if the page is definitely not dma-pinned. */ static inline bool page_maybe_dma_pinned(struct page *page) { if (hpage_pincount_available(page)) return compound_pincount(page) > 0; /* * page_ref_count() is signed. If that refcount overflows, then * page_ref_count() returns a negative value, and callers will avoid * further incrementing the refcount. * * Here, for that overflow case, use the signed bit to count a little * bit higher via unsigned math, and thus still get an accurate result. */ return ((unsigned int)page_ref_count(compound_head(page))) >= GUP_PIN_COUNTING_BIAS; } static inline bool is_cow_mapping(vm_flags_t flags) { return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; } /* * This should most likely only be called during fork() to see whether we * should break the cow immediately for a page on the src mm. */ static inline bool page_needs_cow_for_dma(struct vm_area_struct *vma, struct page *page) { if (!is_cow_mapping(vma->vm_flags)) return false; if (!test_bit(MMF_HAS_PINNED, &vma->vm_mm->flags)) return false; return page_maybe_dma_pinned(page); } #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) #define SECTION_IN_PAGE_FLAGS #endif /* * The identification function is mainly used by the buddy allocator for * determining if two pages could be buddies. We are not really identifying * the zone since we could be using the section number id if we do not have * node id available in page flags. * We only guarantee that it will return the same value for two combinable * pages in a zone. */ static inline int page_zone_id(struct page *page) { return (page->flags >> ZONEID_PGSHIFT) & ZONEID_MASK; } #ifdef NODE_NOT_IN_PAGE_FLAGS extern int page_to_nid(const struct page *page); #else static inline int page_to_nid(const struct page *page) { struct page *p = (struct page *)page; return (PF_POISONED_CHECK(p)->flags >> NODES_PGSHIFT) & NODES_MASK; } #endif #ifdef CONFIG_NUMA_BALANCING static inline int cpu_pid_to_cpupid(int cpu, int pid) { return ((cpu & LAST__CPU_MASK) << LAST__PID_SHIFT) | (pid & LAST__PID_MASK); } static inline int cpupid_to_pid(int cpupid) { return cpupid & LAST__PID_MASK; } static inline int cpupid_to_cpu(int cpupid) { return (cpupid >> LAST__PID_SHIFT) & LAST__CPU_MASK; } static inline int cpupid_to_nid(int cpupid) { return cpu_to_node(cpupid_to_cpu(cpupid)); } static inline bool cpupid_pid_unset(int cpupid) { return cpupid_to_pid(cpupid) == (-1 & LAST__PID_MASK); } static inline bool cpupid_cpu_unset(int cpupid) { return cpupid_to_cpu(cpupid) == (-1 & LAST__CPU_MASK); } static inline bool __cpupid_match_pid(pid_t task_pid, int cpupid) { return (task_pid & LAST__PID_MASK) == cpupid_to_pid(cpupid); } #define cpupid_match_pid(task, cpupid) __cpupid_match_pid(task->pid, cpupid) #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS static inline int page_cpupid_xchg_last(struct page *page, int cpupid) { return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK); } static inline int page_cpupid_last(struct page *page) { return page->_last_cpupid; } static inline void page_cpupid_reset_last(struct page *page) { page->_last_cpupid = -1 & LAST_CPUPID_MASK; } #else static inline int page_cpupid_last(struct page *page) { return (page->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; } extern int page_cpupid_xchg_last(struct page *page, int cpupid); static inline void page_cpupid_reset_last(struct page *page) { page->flags |= LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT; } #endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */ #else /* !CONFIG_NUMA_BALANCING */ static inline int page_cpupid_xchg_last(struct page *page, int cpupid) { return page_to_nid(page); /* XXX */ } static inline int page_cpupid_last(struct page *page) { return page_to_nid(page); /* XXX */ } static inline int cpupid_to_nid(int cpupid) { return -1; } static inline int cpupid_to_pid(int cpupid) { return -1; } static inline int cpupid_to_cpu(int cpupid) { return -1; } static inline int cpu_pid_to_cpupid(int nid, int pid) { return -1; } static inline bool cpupid_pid_unset(int cpupid) { return true; } static inline void page_cpupid_reset_last(struct page *page) { } static inline bool cpupid_match_pid(struct task_struct *task, int cpupid) { return false; } #endif /* CONFIG_NUMA_BALANCING */ #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /* * KASAN per-page tags are stored xor'ed with 0xff. This allows to avoid * setting tags for all pages to native kernel tag value 0xff, as the default * value 0x00 maps to 0xff. */ static inline u8 page_kasan_tag(const struct page *page) { u8 tag = 0xff; if (kasan_enabled()) { tag = (page->flags >> KASAN_TAG_PGSHIFT) & KASAN_TAG_MASK; tag ^= 0xff; } return tag; } static inline void page_kasan_tag_set(struct page *page, u8 tag) { unsigned long old_flags, flags; if (!kasan_enabled()) return; tag ^= 0xff; old_flags = READ_ONCE(page->flags); do { flags = old_flags; flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT); flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT; } while (unlikely(!try_cmpxchg(&page->flags, &old_flags, flags))); } static inline void page_kasan_tag_reset(struct page *page) { if (kasan_enabled()) page_kasan_tag_set(page, 0xff); } #else /* CONFIG_KASAN_SW_TAGS || CONFIG_KASAN_HW_TAGS */ static inline u8 page_kasan_tag(const struct page *page) { return 0xff; } static inline void page_kasan_tag_set(struct page *page, u8 tag) { } static inline void page_kasan_tag_reset(struct page *page) { } #endif /* CONFIG_KASAN_SW_TAGS || CONFIG_KASAN_HW_TAGS */ static inline struct zone *page_zone(const struct page *page) { return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; } static inline pg_data_t *page_pgdat(const struct page *page) { return NODE_DATA(page_to_nid(page)); } #ifdef SECTION_IN_PAGE_FLAGS static inline void set_page_section(struct page *page, unsigned long section) { page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; } static inline unsigned long page_to_section(const struct page *page) { return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; } #endif /* MIGRATE_CMA and ZONE_MOVABLE do not allow pin pages */ #ifdef CONFIG_MIGRATION static inline bool is_pinnable_page(struct page *page) { return !(is_zone_movable_page(page) || is_migrate_cma_page(page)) || is_zero_pfn(page_to_pfn(page)); } #else static inline bool is_pinnable_page(struct page *page) { return true; } #endif static inline void set_page_zone(struct page *page, enum zone_type zone) { page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT); page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT; } static inline void set_page_node(struct page *page, unsigned long node) { page->flags &= ~(NODES_MASK << NODES_PGSHIFT); page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; } static inline void set_page_links(struct page *page, enum zone_type zone, unsigned long node, unsigned long pfn) { set_page_zone(page, zone); set_page_node(page, node); #ifdef SECTION_IN_PAGE_FLAGS set_page_section(page, pfn_to_section_nr(pfn)); #endif } /* * Some inline functions in vmstat.h depend on page_zone() */ #include static __always_inline void *lowmem_page_address(const struct page *page) { return page_to_virt(page); } #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) #define HASHED_PAGE_VIRTUAL #endif #if defined(WANT_PAGE_VIRTUAL) static inline void *page_address(const struct page *page) { return page->virtual; } static inline void set_page_address(struct page *page, void *address) { page->virtual = address; } #define page_address_init() do { } while(0) #endif #if defined(HASHED_PAGE_VIRTUAL) void *page_address(const struct page *page); void set_page_address(struct page *page, void *virtual); void page_address_init(void); #endif #if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL) #define page_address(page) lowmem_page_address(page) #define set_page_address(page, address) do { } while(0) #define page_address_init() do { } while(0) #endif extern void *page_rmapping(struct page *page); extern struct anon_vma *page_anon_vma(struct page *page); extern struct address_space *page_mapping(struct page *page); extern struct address_space *__page_file_mapping(struct page *); static inline struct address_space *page_file_mapping(struct page *page) { if (unlikely(PageSwapCache(page))) return __page_file_mapping(page); return page->mapping; } extern pgoff_t __page_file_index(struct page *page); /* * Return the pagecache index of the passed page. Regular pagecache pages * use ->index whereas swapcache pages use swp_offset(->private) */ static inline pgoff_t page_index(struct page *page) { if (unlikely(PageSwapCache(page))) return __page_file_index(page); return page->index; } bool page_mapped(struct page *page); struct address_space *page_mapping(struct page *page); /* * Return true only if the page has been allocated with * ALLOC_NO_WATERMARKS and the low watermark was not * met implying that the system is under some pressure. */ static inline bool page_is_pfmemalloc(const struct page *page) { /* * lru.next has bit 1 set if the page is allocated from the * pfmemalloc reserves. Callers may simply overwrite it if * they do not need to preserve that information. */ return (uintptr_t)page->lru.next & BIT(1); } /* * Only to be called by the page allocator on a freshly allocated * page. */ static inline void set_page_pfmemalloc(struct page *page) { page->lru.next = (void *)BIT(1); } static inline void clear_page_pfmemalloc(struct page *page) { page->lru.next = NULL; } /* * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. */ extern void pagefault_out_of_memory(void); #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) #define offset_in_thp(page, p) ((unsigned long)(p) & (thp_size(page) - 1)) /* * Flags passed to show_mem() and show_free_areas() to suppress output in * various contexts. */ #define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ extern void show_free_areas(unsigned int flags, nodemask_t *nodemask); #ifdef CONFIG_MMU extern bool can_do_mlock(void); #else static inline bool can_do_mlock(void) { return false; } #endif extern int user_shm_lock(size_t, struct ucounts *); extern void user_shm_unlock(size_t, struct ucounts *); /* * Parameter block passed down to zap_pte_range in exceptional cases. */ struct zap_details { struct address_space *check_mapping; /* Check page->mapping if set */ pgoff_t first_index; /* Lowest page->index to unmap */ pgoff_t last_index; /* Highest page->index to unmap */ struct page *single_page; /* Locked page to be unmapped */ }; struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_t pte); struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t pmd); void zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, unsigned long size); void zap_page_range(struct vm_area_struct *vma, unsigned long address, unsigned long size); void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma, unsigned long start, unsigned long end); struct mmu_notifier_range; void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling); int copy_page_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma); int follow_invalidate_pte(struct mm_struct *mm, unsigned long address, struct mmu_notifier_range *range, pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp); int follow_pte(struct mm_struct *mm, unsigned long address, pte_t **ptepp, spinlock_t **ptlp); int follow_pfn(struct vm_area_struct *vma, unsigned long address, unsigned long *pfn); int follow_phys(struct vm_area_struct *vma, unsigned long address, unsigned int flags, unsigned long *prot, resource_size_t *phys); int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write); extern void truncate_pagecache(struct inode *inode, loff_t new); extern void truncate_setsize(struct inode *inode, loff_t newsize); void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to); void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end); int truncate_inode_page(struct address_space *mapping, struct page *page); int generic_error_remove_page(struct address_space *mapping, struct page *page); int invalidate_inode_page(struct page *page); #ifdef CONFIG_MMU extern vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address, unsigned int flags, struct pt_regs *regs); extern int fixup_user_fault(struct mm_struct *mm, unsigned long address, unsigned int fault_flags, bool *unlocked); void unmap_mapping_page(struct page *page); void unmap_mapping_pages(struct address_space *mapping, pgoff_t start, pgoff_t nr, bool even_cows); void unmap_mapping_range(struct address_space *mapping, loff_t const holebegin, loff_t const holelen, int even_cows); #else static inline vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address, unsigned int flags, struct pt_regs *regs) { /* should never happen if there's no MMU */ BUG(); return VM_FAULT_SIGBUS; } static inline int fixup_user_fault(struct mm_struct *mm, unsigned long address, unsigned int fault_flags, bool *unlocked) { /* should never happen if there's no MMU */ BUG(); return -EFAULT; } static inline void unmap_mapping_page(struct page *page) { } static inline void unmap_mapping_pages(struct address_space *mapping, pgoff_t start, pgoff_t nr, bool even_cows) { } static inline void unmap_mapping_range(struct address_space *mapping, loff_t const holebegin, loff_t const holelen, int even_cows) { } #endif static inline void unmap_shared_mapping_range(struct address_space *mapping, loff_t const holebegin, loff_t const holelen) { unmap_mapping_range(mapping, holebegin, holelen, 0); } extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], int); extern void vma_do_get_file(struct vm_area_struct *, const char[], int); extern void vma_do_fput(struct vm_area_struct *, const char[], int); #define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \ __LINE__) #define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \ __LINE__) #define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) #define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) #ifndef CONFIG_MMU extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int); extern void vmr_do_fput(struct vm_region *, const char[], int); #define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \ __LINE__) #define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) #endif /* !CONFIG_MMU */ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, unsigned int gup_flags); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, unsigned int gup_flags); extern int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, unsigned int gup_flags); long get_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas, int *locked); long pin_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas, int *locked); long get_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas); long pin_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas); long get_user_pages_locked(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, int *locked); long pin_user_pages_locked(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, int *locked); long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, struct page **pages, unsigned int gup_flags); long pin_user_pages_unlocked(unsigned long start, unsigned long nr_pages, struct page **pages, unsigned int gup_flags); int get_user_pages_fast(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages); int pin_user_pages_fast(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages); int account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc); int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc, struct task_struct *task, bool bypass_rlim); struct kvec; int get_kernel_pages(const struct kvec *iov, int nr_pages, int write, struct page **pages); struct page *get_dump_page(unsigned long addr); extern int try_to_release_page(struct page * page, gfp_t gfp_mask); extern void do_invalidatepage(struct page *page, unsigned int offset, unsigned int length); int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page); void account_page_cleaned(struct page *page, struct address_space *mapping, struct bdi_writeback *wb); int set_page_dirty(struct page *page); int set_page_dirty_lock(struct page *page); void __cancel_dirty_page(struct page *page); static inline void cancel_dirty_page(struct page *page) { /* Avoid atomic ops, locking, etc. when not actually needed. */ if (PageDirty(page)) __cancel_dirty_page(page); } int clear_page_dirty_for_io(struct page *page); int get_cmdline(struct task_struct *task, char *buffer, int buflen); extern unsigned long move_page_tables(struct vm_area_struct *vma, unsigned long old_addr, struct vm_area_struct *new_vma, unsigned long new_addr, unsigned long len, bool need_rmap_locks); /* * Flags used by change_protection(). For now we make it a bitmap so * that we can pass in multiple flags just like parameters. However * for now all the callers are only use one of the flags at the same * time. */ /* Whether we should allow dirty bit accounting */ #define MM_CP_DIRTY_ACCT (1UL << 0) /* Whether this protection change is for NUMA hints */ #define MM_CP_PROT_NUMA (1UL << 1) /* Whether this change is for write protecting */ #define MM_CP_UFFD_WP (1UL << 2) /* do wp */ #define MM_CP_UFFD_WP_RESOLVE (1UL << 3) /* Resolve wp */ #define MM_CP_UFFD_WP_ALL (MM_CP_UFFD_WP | \ MM_CP_UFFD_WP_RESOLVE) extern unsigned long change_protection(struct vm_area_struct *vma, unsigned long start, unsigned long end, pgprot_t newprot, unsigned long cp_flags); extern int mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, unsigned long start, unsigned long end, unsigned long newflags); /* * doesn't attempt to fault and will return short. */ int get_user_pages_fast_only(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages); int pin_user_pages_fast_only(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages); static inline bool get_user_page_fast_only(unsigned long addr, unsigned int gup_flags, struct page **pagep) { return get_user_pages_fast_only(addr, 1, gup_flags, pagep) == 1; } /* * per-process(per-mm_struct) statistics. */ static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) { long val = atomic_long_read(&mm->rss_stat.count[member]); #ifdef SPLIT_RSS_COUNTING /* * counter is updated in asynchronous manner and may go to minus. * But it's never be expected number for users. */ if (val < 0) val = 0; #endif return (unsigned long)val; } void mm_trace_rss_stat(struct mm_struct *mm, int member, long count); static inline void add_mm_counter(struct mm_struct *mm, int member, long value) { long count = atomic_long_add_return(value, &mm->rss_stat.count[member]); mm_trace_rss_stat(mm, member, count); } static inline void inc_mm_counter(struct mm_struct *mm, int member) { long count = atomic_long_inc_return(&mm->rss_stat.count[member]); mm_trace_rss_stat(mm, member, count); } static inline void dec_mm_counter(struct mm_struct *mm, int member) { long count = atomic_long_dec_return(&mm->rss_stat.count[member]); mm_trace_rss_stat(mm, member, count); } /* Optimized variant when page is already known not to be PageAnon */ static inline int mm_counter_file(struct page *page) { if (PageSwapBacked(page)) return MM_SHMEMPAGES; return MM_FILEPAGES; } static inline int mm_counter(struct page *page) { if (PageAnon(page)) return MM_ANONPAGES; return mm_counter_file(page); } static inline unsigned long get_mm_rss(struct mm_struct *mm) { return get_mm_counter(mm, MM_FILEPAGES) + get_mm_counter(mm, MM_ANONPAGES) + get_mm_counter(mm, MM_SHMEMPAGES); } static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) { return max(mm->hiwater_rss, get_mm_rss(mm)); } static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) { return max(mm->hiwater_vm, mm->total_vm); } static inline void update_hiwater_rss(struct mm_struct *mm) { unsigned long _rss = get_mm_rss(mm); if ((mm)->hiwater_rss < _rss) (mm)->hiwater_rss = _rss; } static inline void update_hiwater_vm(struct mm_struct *mm) { if (mm->hiwater_vm < mm->total_vm) mm->hiwater_vm = mm->total_vm; } static inline void reset_mm_hiwater_rss(struct mm_struct *mm) { mm->hiwater_rss = get_mm_rss(mm); } static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, struct mm_struct *mm) { unsigned long hiwater_rss = get_mm_hiwater_rss(mm); if (*maxrss < hiwater_rss) *maxrss = hiwater_rss; } #if defined(SPLIT_RSS_COUNTING) void sync_mm_rss(struct mm_struct *mm); #else static inline void sync_mm_rss(struct mm_struct *mm) { } #endif #ifndef CONFIG_ARCH_HAS_PTE_SPECIAL static inline int pte_special(pte_t pte) { return 0; } static inline pte_t pte_mkspecial(pte_t pte) { return pte; } #endif #ifndef CONFIG_ARCH_HAS_PTE_DEVMAP static inline int pte_devmap(pte_t pte) { return 0; } #endif int vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot); extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl) { pte_t *ptep; __cond_lock(*ptl, ptep = __get_locked_pte(mm, addr, ptl)); return ptep; } #ifdef __PAGETABLE_P4D_FOLDED static inline int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) { return 0; } #else int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); #endif #if defined(__PAGETABLE_PUD_FOLDED) || !defined(CONFIG_MMU) static inline int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address) { return 0; } static inline void mm_inc_nr_puds(struct mm_struct *mm) {} static inline void mm_dec_nr_puds(struct mm_struct *mm) {} #else int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address); static inline void mm_inc_nr_puds(struct mm_struct *mm) { if (mm_pud_folded(mm)) return; atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); } static inline void mm_dec_nr_puds(struct mm_struct *mm) { if (mm_pud_folded(mm)) return; atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); } #endif #if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU) static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) { return 0; } static inline void mm_inc_nr_pmds(struct mm_struct *mm) {} static inline void mm_dec_nr_pmds(struct mm_struct *mm) {} #else int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); static inline void mm_inc_nr_pmds(struct mm_struct *mm) { if (mm_pmd_folded(mm)) return; atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); } static inline void mm_dec_nr_pmds(struct mm_struct *mm) { if (mm_pmd_folded(mm)) return; atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); } #endif #ifdef CONFIG_MMU static inline void mm_pgtables_bytes_init(struct mm_struct *mm) { atomic_long_set(&mm->pgtables_bytes, 0); } static inline unsigned long mm_pgtables_bytes(const struct mm_struct *mm) { return atomic_long_read(&mm->pgtables_bytes); } static inline void mm_inc_nr_ptes(struct mm_struct *mm) { atomic_long_add(PTRS_PER_PTE * sizeof(pte_t), &mm->pgtables_bytes); } static inline void mm_dec_nr_ptes(struct mm_struct *mm) { atomic_long_sub(PTRS_PER_PTE * sizeof(pte_t), &mm->pgtables_bytes); } #else static inline void mm_pgtables_bytes_init(struct mm_struct *mm) {} static inline unsigned long mm_pgtables_bytes(const struct mm_struct *mm) { return 0; } static inline void mm_inc_nr_ptes(struct mm_struct *mm) {} static inline void mm_dec_nr_ptes(struct mm_struct *mm) {} #endif int __pte_alloc(struct mm_struct *mm, pmd_t *pmd); int __pte_alloc_kernel(pmd_t *pmd); #if defined(CONFIG_MMU) static inline p4d_t *p4d_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) { return (unlikely(pgd_none(*pgd)) && __p4d_alloc(mm, pgd, address)) ? NULL : p4d_offset(pgd, address); } static inline pud_t *pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address) { return (unlikely(p4d_none(*p4d)) && __pud_alloc(mm, p4d, address)) ? NULL : pud_offset(p4d, address); } static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) { return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))? NULL: pmd_offset(pud, address); } #endif /* CONFIG_MMU */ #if USE_SPLIT_PTE_PTLOCKS #if ALLOC_SPLIT_PTLOCKS void __init ptlock_cache_init(void); extern bool ptlock_alloc(struct page *page); extern void ptlock_free(struct page *page); static inline spinlock_t *ptlock_ptr(struct page *page) { return page->ptl; } #else /* ALLOC_SPLIT_PTLOCKS */ static inline void ptlock_cache_init(void) { } static inline bool ptlock_alloc(struct page *page) { return true; } static inline void ptlock_free(struct page *page) { } static inline spinlock_t *ptlock_ptr(struct page *page) { return &page->ptl; } #endif /* ALLOC_SPLIT_PTLOCKS */ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) { return ptlock_ptr(pmd_page(*pmd)); } static inline bool ptlock_init(struct page *page) { /* * prep_new_page() initialize page->private (and therefore page->ptl) * with 0. Make sure nobody took it in use in between. * * It can happen if arch try to use slab for page table allocation: * slab code uses page->slab_cache, which share storage with page->ptl. */ VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page); if (!ptlock_alloc(page)) return false; spin_lock_init(ptlock_ptr(page)); return true; } #else /* !USE_SPLIT_PTE_PTLOCKS */ /* * We use mm->page_table_lock to guard all pagetable pages of the mm. */ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) { return &mm->page_table_lock; } static inline void ptlock_cache_init(void) {} static inline bool ptlock_init(struct page *page) { return true; } static inline void ptlock_free(struct page *page) {} #endif /* USE_SPLIT_PTE_PTLOCKS */ static inline void pgtable_init(void) { ptlock_cache_init(); pgtable_cache_init(); } static inline bool pgtable_pte_page_ctor(struct page *page) { if (!ptlock_init(page)) return false; __SetPageTable(page); inc_lruvec_page_state(page, NR_PAGETABLE); return true; } static inline void pgtable_pte_page_dtor(struct page *page) { ptlock_free(page); __ClearPageTable(page); dec_lruvec_page_state(page, NR_PAGETABLE); } #define pte_offset_map_lock(mm, pmd, address, ptlp) \ ({ \ spinlock_t *__ptl = pte_lockptr(mm, pmd); \ pte_t *__pte = pte_offset_map(pmd, address); \ *(ptlp) = __ptl; \ spin_lock(__ptl); \ __pte; \ }) #define pte_unmap_unlock(pte, ptl) do { \ spin_unlock(ptl); \ pte_unmap(pte); \ } while (0) #define pte_alloc(mm, pmd) (unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, pmd)) #define pte_alloc_map(mm, pmd, address) \ (pte_alloc(mm, pmd) ? NULL : pte_offset_map(pmd, address)) #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ (pte_alloc(mm, pmd) ? \ NULL : pte_offset_map_lock(mm, pmd, address, ptlp)) #define pte_alloc_kernel(pmd, address) \ ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd))? \ NULL: pte_offset_kernel(pmd, address)) #if USE_SPLIT_PMD_PTLOCKS static struct page *pmd_to_page(pmd_t *pmd) { unsigned long mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1); return virt_to_page((void *)((unsigned long) pmd & mask)); } static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) { return ptlock_ptr(pmd_to_page(pmd)); } static inline bool pmd_ptlock_init(struct page *page) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE page->pmd_huge_pte = NULL; #endif return ptlock_init(page); } static inline void pmd_ptlock_free(struct page *page) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE VM_BUG_ON_PAGE(page->pmd_huge_pte, page); #endif ptlock_free(page); } #define pmd_huge_pte(mm, pmd) (pmd_to_page(pmd)->pmd_huge_pte) #else static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) { return &mm->page_table_lock; } static inline bool pmd_ptlock_init(struct page *page) { return true; } static inline void pmd_ptlock_free(struct page *page) {} #define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte) #endif static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd) { spinlock_t *ptl = pmd_lockptr(mm, pmd); spin_lock(ptl); return ptl; } static inline bool pgtable_pmd_page_ctor(struct page *page) { if (!pmd_ptlock_init(page)) return false; __SetPageTable(page); #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE atomic_set(&page->pt_share_count, 0); #endif inc_lruvec_page_state(page, NR_PAGETABLE); return true; } static inline void pgtable_pmd_page_dtor(struct page *page) { pmd_ptlock_free(page); __ClearPageTable(page); dec_lruvec_page_state(page, NR_PAGETABLE); } /* * No scalability reason to split PUD locks yet, but follow the same pattern * as the PMD locks to make it easier if we decide to. The VM should not be * considered ready to switch to split PUD locks yet; there may be places * which need to be converted from page_table_lock. */ static inline spinlock_t *pud_lockptr(struct mm_struct *mm, pud_t *pud) { return &mm->page_table_lock; } static inline spinlock_t *pud_lock(struct mm_struct *mm, pud_t *pud) { spinlock_t *ptl = pud_lockptr(mm, pud); spin_lock(ptl); return ptl; } extern void __init pagecache_init(void); extern void __init free_area_init_memoryless_node(int nid); extern void free_initmem(void); /* * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) * into the buddy system. The freed pages will be poisoned with pattern * "poison" if it's within range [0, UCHAR_MAX]. * Return pages freed into the buddy system. */ extern unsigned long free_reserved_area(void *start, void *end, int poison, const char *s); extern void adjust_managed_page_count(struct page *page, long count); extern void mem_init_print_info(void); extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end); /* Free the reserved page into the buddy system, so it gets managed. */ static inline void free_reserved_page(struct page *page) { ClearPageReserved(page); init_page_count(page); __free_page(page); adjust_managed_page_count(page, 1); } #define free_highmem_page(page) free_reserved_page(page) static inline void mark_page_reserved(struct page *page) { SetPageReserved(page); adjust_managed_page_count(page, -1); } /* * Default method to free all the __init memory into the buddy system. * The freed pages will be poisoned with pattern "poison" if it's within * range [0, UCHAR_MAX]. * Return pages freed into the buddy system. */ static inline unsigned long free_initmem_default(int poison) { extern char __init_begin[], __init_end[]; return free_reserved_area(&__init_begin, &__init_end, poison, "unused kernel image (initmem)"); } static inline unsigned long get_num_physpages(void) { int nid; unsigned long phys_pages = 0; for_each_online_node(nid) phys_pages += node_present_pages(nid); return phys_pages; } /* * Using memblock node mappings, an architecture may initialise its * zones, allocate the backing mem_map and account for memory holes in an * architecture independent manner. * * An architecture is expected to register range of page frames backed by * physical memory with memblock_add[_node]() before calling * free_area_init() passing in the PFN each zone ends at. At a basic * usage, an architecture is expected to do something like * * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, * max_highmem_pfn}; * for_each_valid_physical_page_range() * memblock_add_node(base, size, nid, MEMBLOCK_NONE) * free_area_init(max_zone_pfns); */ void free_area_init(unsigned long *max_zone_pfn); unsigned long node_map_pfn_alignment(void); unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, unsigned long end_pfn); extern unsigned long absent_pages_in_range(unsigned long start_pfn, unsigned long end_pfn); extern void get_pfn_range_for_nid(unsigned int nid, unsigned long *start_pfn, unsigned long *end_pfn); extern unsigned long find_min_pfn_with_active_regions(void); #ifndef CONFIG_NUMA static inline int early_pfn_to_nid(unsigned long pfn) { return 0; } #else /* please see mm/page_alloc.c */ extern int __meminit early_pfn_to_nid(unsigned long pfn); #endif extern void set_dma_reserve(unsigned long new_dma_reserve); extern void memmap_init_range(unsigned long, int, unsigned long, unsigned long, unsigned long, enum meminit_context, struct vmem_altmap *, int migratetype); extern void setup_per_zone_wmarks(void); extern int __meminit init_per_zone_wmark_min(void); extern void mem_init(void); extern void __init mmap_init(void); extern void show_mem(unsigned int flags, nodemask_t *nodemask); extern long si_mem_available(void); extern void si_meminfo(struct sysinfo * val); extern void si_meminfo_node(struct sysinfo *val, int nid); #ifdef __HAVE_ARCH_RESERVED_KERNEL_PAGES extern unsigned long arch_reserved_kernel_pages(void); #endif extern __printf(3, 4) void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...); extern void setup_per_cpu_pageset(void); /* page_alloc.c */ extern int min_free_kbytes; extern int watermark_boost_factor; extern int watermark_scale_factor; extern bool arch_has_descending_max_zone_pfns(void); /* nommu.c */ extern atomic_long_t mmap_pages_allocated; extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); /* interval_tree.c */ void vma_interval_tree_insert(struct vm_area_struct *node, struct rb_root_cached *root); void vma_interval_tree_insert_after(struct vm_area_struct *node, struct vm_area_struct *prev, struct rb_root_cached *root); void vma_interval_tree_remove(struct vm_area_struct *node, struct rb_root_cached *root); struct vm_area_struct *vma_interval_tree_iter_first(struct rb_root_cached *root, unsigned long start, unsigned long last); struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node, unsigned long start, unsigned long last); #define vma_interval_tree_foreach(vma, root, start, last) \ for (vma = vma_interval_tree_iter_first(root, start, last); \ vma; vma = vma_interval_tree_iter_next(vma, start, last)) void anon_vma_interval_tree_insert(struct anon_vma_chain *node, struct rb_root_cached *root); void anon_vma_interval_tree_remove(struct anon_vma_chain *node, struct rb_root_cached *root); struct anon_vma_chain * anon_vma_interval_tree_iter_first(struct rb_root_cached *root, unsigned long start, unsigned long last); struct anon_vma_chain *anon_vma_interval_tree_iter_next( struct anon_vma_chain *node, unsigned long start, unsigned long last); #ifdef CONFIG_DEBUG_VM_RB void anon_vma_interval_tree_verify(struct anon_vma_chain *node); #endif #define anon_vma_interval_tree_foreach(avc, root, start, last) \ for (avc = anon_vma_interval_tree_iter_first(root, start, last); \ avc; avc = anon_vma_interval_tree_iter_next(avc, start, last)) /* mmap.c */ extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin); extern int __vma_adjust(struct vm_area_struct *vma, unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert, struct vm_area_struct *expand); static inline int vma_adjust(struct vm_area_struct *vma, unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert) { return __vma_adjust(vma, start, end, pgoff, insert, NULL); } extern struct vm_area_struct *vma_merge(struct mm_struct *, struct vm_area_struct *prev, unsigned long addr, unsigned long end, unsigned long vm_flags, struct anon_vma *, struct file *, pgoff_t, struct mempolicy *, struct vm_userfaultfd_ctx); extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *); extern int __split_vma(struct mm_struct *, struct vm_area_struct *, unsigned long addr, int new_below); extern int split_vma(struct mm_struct *, struct vm_area_struct *, unsigned long addr, int new_below); extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *, struct rb_node **, struct rb_node *); extern void unlink_file_vma(struct vm_area_struct *); extern struct vm_area_struct *copy_vma(struct vm_area_struct **, unsigned long addr, unsigned long len, pgoff_t pgoff, bool *need_rmap_locks); extern void exit_mmap(struct mm_struct *); static inline int check_data_rlimit(unsigned long rlim, unsigned long new, unsigned long start, unsigned long end_data, unsigned long start_data) { if (rlim < RLIM_INFINITY) { if (((new - start) + (end_data - start_data)) > rlim) return -ENOSPC; } return 0; } extern int mm_take_all_locks(struct mm_struct *mm); extern void mm_drop_all_locks(struct mm_struct *mm); extern int set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); extern int replace_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); extern struct file *get_mm_exe_file(struct mm_struct *mm); extern struct file *get_task_exe_file(struct task_struct *task); extern bool may_expand_vm(struct mm_struct *, vm_flags_t, unsigned long npages); extern void vm_stat_account(struct mm_struct *, vm_flags_t, long npages); extern bool vma_is_special_mapping(const struct vm_area_struct *vma, const struct vm_special_mapping *sm); extern struct vm_area_struct *_install_special_mapping(struct mm_struct *mm, unsigned long addr, unsigned long len, unsigned long flags, const struct vm_special_mapping *spec); /* This is an obsolete alternative to _install_special_mapping. */ extern int install_special_mapping(struct mm_struct *mm, unsigned long addr, unsigned long len, unsigned long flags, struct page **pages); unsigned long randomize_stack_top(unsigned long stack_top); unsigned long randomize_page(unsigned long start, unsigned long range); extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); extern unsigned long mmap_region(struct file *file, unsigned long addr, unsigned long len, vm_flags_t vm_flags, unsigned long pgoff, struct list_head *uf); extern unsigned long do_mmap(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long pgoff, unsigned long *populate, struct list_head *uf); extern int __do_munmap(struct mm_struct *, unsigned long, size_t, struct list_head *uf, bool downgrade); extern int do_munmap(struct mm_struct *, unsigned long, size_t, struct list_head *uf); extern int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int behavior); #ifdef CONFIG_MMU extern int __mm_populate(unsigned long addr, unsigned long len, int ignore_errors); static inline void mm_populate(unsigned long addr, unsigned long len) { /* Ignore errors */ (void) __mm_populate(addr, len, 1); } #else static inline void mm_populate(unsigned long addr, unsigned long len) {} #endif /* These take the mm semaphore themselves */ extern int __must_check vm_brk(unsigned long, unsigned long); extern int __must_check vm_brk_flags(unsigned long, unsigned long, unsigned long); extern int vm_munmap(unsigned long, size_t); extern unsigned long __must_check vm_mmap(struct file *, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); struct vm_unmapped_area_info { #define VM_UNMAPPED_AREA_TOPDOWN 1 unsigned long flags; unsigned long length; unsigned long low_limit; unsigned long high_limit; unsigned long align_mask; unsigned long align_offset; }; extern unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info); /* truncate.c */ extern void truncate_inode_pages(struct address_space *, loff_t); extern void truncate_inode_pages_range(struct address_space *, loff_t lstart, loff_t lend); extern void truncate_inode_pages_final(struct address_space *); /* generic vm_area_ops exported for stackable file systems */ extern vm_fault_t filemap_fault(struct vm_fault *vmf); extern vm_fault_t filemap_map_pages(struct vm_fault *vmf, pgoff_t start_pgoff, pgoff_t end_pgoff); extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf); /* mm/page-writeback.c */ int __must_check write_one_page(struct page *page); void task_dirty_inc(struct task_struct *tsk); extern unsigned long stack_guard_gap; /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ extern int expand_stack(struct vm_area_struct *vma, unsigned long address); /* CONFIG_STACK_GROWSUP still needs to grow downwards at some places */ extern int expand_downwards(struct vm_area_struct *vma, unsigned long address); #if VM_GROWSUP extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); #else #define expand_upwards(vma, address) (0) #endif /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr, struct vm_area_struct **pprev); /** * find_vma_intersection() - Look up the first VMA which intersects the interval * @mm: The process address space. * @start_addr: The inclusive start user address. * @end_addr: The exclusive end user address. * * Returns: The first VMA within the provided range, %NULL otherwise. Assumes * start_addr < end_addr. */ static inline struct vm_area_struct *find_vma_intersection(struct mm_struct *mm, unsigned long start_addr, unsigned long end_addr) { struct vm_area_struct *vma = find_vma(mm, start_addr); if (vma && end_addr <= vma->vm_start) vma = NULL; return vma; } /** * vma_lookup() - Find a VMA at a specific address * @mm: The process address space. * @addr: The user address. * * Return: The vm_area_struct at the given address, %NULL otherwise. */ static inline struct vm_area_struct *vma_lookup(struct mm_struct *mm, unsigned long addr) { struct vm_area_struct *vma = find_vma(mm, addr); if (vma && addr < vma->vm_start) vma = NULL; return vma; } static inline unsigned long vm_start_gap(struct vm_area_struct *vma) { unsigned long vm_start = vma->vm_start; if (vma->vm_flags & VM_GROWSDOWN) { vm_start -= stack_guard_gap; if (vm_start > vma->vm_start) vm_start = 0; } return vm_start; } static inline unsigned long vm_end_gap(struct vm_area_struct *vma) { unsigned long vm_end = vma->vm_end; if (vma->vm_flags & VM_GROWSUP) { vm_end += stack_guard_gap; if (vm_end < vma->vm_end) vm_end = -PAGE_SIZE; } return vm_end; } static inline unsigned long vma_pages(struct vm_area_struct *vma) { return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; } /* Look up the first VMA which exactly match the interval vm_start ... vm_end */ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm, unsigned long vm_start, unsigned long vm_end) { struct vm_area_struct *vma = find_vma(mm, vm_start); if (vma && (vma->vm_start != vm_start || vma->vm_end != vm_end)) vma = NULL; return vma; } static inline bool range_in_vma(struct vm_area_struct *vma, unsigned long start, unsigned long end) { return (vma && vma->vm_start <= start && end <= vma->vm_end); } #ifdef CONFIG_MMU pgprot_t vm_get_page_prot(unsigned long vm_flags); void vma_set_page_prot(struct vm_area_struct *vma); #else static inline pgprot_t vm_get_page_prot(unsigned long vm_flags) { return __pgprot(0); } static inline void vma_set_page_prot(struct vm_area_struct *vma) { vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); } #endif void vma_set_file(struct vm_area_struct *vma, struct file *file); #ifdef CONFIG_NUMA_BALANCING unsigned long change_prot_numa(struct vm_area_struct *vma, unsigned long start, unsigned long end); #endif struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); int remap_pfn_range(struct vm_area_struct *, unsigned long addr, unsigned long pfn, unsigned long size, pgprot_t); int remap_pfn_range_notrack(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, unsigned long size, pgprot_t prot); int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); int vm_insert_pages(struct vm_area_struct *vma, unsigned long addr, struct page **pages, unsigned long *num); int vm_map_pages(struct vm_area_struct *vma, struct page **pages, unsigned long num); int vm_map_pages_zero(struct vm_area_struct *vma, struct page **pages, unsigned long num); vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, pgprot_t pgprot); vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr, pfn_t pfn); vm_fault_t vmf_insert_mixed_prot(struct vm_area_struct *vma, unsigned long addr, pfn_t pfn, pgprot_t pgprot); vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma, unsigned long addr, pfn_t pfn); int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len); static inline vm_fault_t vmf_insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *page) { int err = vm_insert_page(vma, addr, page); if (err == -ENOMEM) return VM_FAULT_OOM; if (err < 0 && err != -EBUSY) return VM_FAULT_SIGBUS; return VM_FAULT_NOPAGE; } #ifndef io_remap_pfn_range static inline int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, unsigned long size, pgprot_t prot) { return remap_pfn_range(vma, addr, pfn, size, pgprot_decrypted(prot)); } #endif static inline vm_fault_t vmf_error(int err) { if (err == -ENOMEM) return VM_FAULT_OOM; return VM_FAULT_SIGBUS; } struct page *follow_page(struct vm_area_struct *vma, unsigned long address, unsigned int foll_flags); #define FOLL_WRITE 0x01 /* check pte is writable */ #define FOLL_TOUCH 0x02 /* mark page accessed */ #define FOLL_GET 0x04 /* do get_page on page */ #define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ #define FOLL_NOWAIT 0x20 /* if a disk transfer is needed, start the IO * and return without waiting upon it */ #define FOLL_POPULATE 0x40 /* fault in pages (with FOLL_MLOCK) */ #define FOLL_NOFAULT 0x80 /* do not fault in pages */ #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */ #define FOLL_MLOCK 0x1000 /* lock present pages */ #define FOLL_REMOTE 0x2000 /* we are working on non-current tsk/mm */ #define FOLL_COW 0x4000 /* internal GUP flag */ #define FOLL_ANON 0x8000 /* don't do file mappings */ #define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */ #define FOLL_SPLIT_PMD 0x20000 /* split huge pmd before returning */ #define FOLL_PIN 0x40000 /* pages must be released via unpin_user_page */ #define FOLL_FAST_ONLY 0x80000 /* gup_fast: prevent fall-back to slow gup */ /* * FOLL_PIN and FOLL_LONGTERM may be used in various combinations with each * other. Here is what they mean, and how to use them: * * FOLL_LONGTERM indicates that the page will be held for an indefinite time * period _often_ under userspace control. This is in contrast to * iov_iter_get_pages(), whose usages are transient. * * FIXME: For pages which are part of a filesystem, mappings are subject to the * lifetime enforced by the filesystem and we need guarantees that longterm * users like RDMA and V4L2 only establish mappings which coordinate usage with * the filesystem. Ideas for this coordination include revoking the longterm * pin, delaying writeback, bounce buffer page writeback, etc. As FS DAX was * added after the problem with filesystems was found FS DAX VMAs are * specifically failed. Filesystem pages are still subject to bugs and use of * FOLL_LONGTERM should be avoided on those pages. * * FIXME: Also NOTE that FOLL_LONGTERM is not supported in every GUP call. * Currently only get_user_pages() and get_user_pages_fast() support this flag * and calls to get_user_pages_[un]locked are specifically not allowed. This * is due to an incompatibility with the FS DAX check and * FAULT_FLAG_ALLOW_RETRY. * * In the CMA case: long term pins in a CMA region would unnecessarily fragment * that region. And so, CMA attempts to migrate the page before pinning, when * FOLL_LONGTERM is specified. * * FOLL_PIN indicates that a special kind of tracking (not just page->_refcount, * but an additional pin counting system) will be invoked. This is intended for * anything that gets a page reference and then touches page data (for example, * Direct IO). This lets the filesystem know that some non-file-system entity is * potentially changing the pages' data. In contrast to FOLL_GET (whose pages * are released via put_page()), FOLL_PIN pages must be released, ultimately, by * a call to unpin_user_page(). * * FOLL_PIN is similar to FOLL_GET: both of these pin pages. They use different * and separate refcounting mechanisms, however, and that means that each has * its own acquire and release mechanisms: * * FOLL_GET: get_user_pages*() to acquire, and put_page() to release. * * FOLL_PIN: pin_user_pages*() to acquire, and unpin_user_pages to release. * * FOLL_PIN and FOLL_GET are mutually exclusive for a given function call. * (The underlying pages may experience both FOLL_GET-based and FOLL_PIN-based * calls applied to them, and that's perfectly OK. This is a constraint on the * callers, not on the pages.) * * FOLL_PIN should be set internally by the pin_user_pages*() APIs, never * directly by the caller. That's in order to help avoid mismatches when * releasing pages: get_user_pages*() pages must be released via put_page(), * while pin_user_pages*() pages must be released via unpin_user_page(). * * Please see Documentation/core-api/pin_user_pages.rst for more information. */ static inline int vm_fault_to_errno(vm_fault_t vm_fault, int foll_flags) { if (vm_fault & VM_FAULT_OOM) return -ENOMEM; if (vm_fault & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE)) return (foll_flags & FOLL_HWPOISON) ? -EHWPOISON : -EFAULT; if (vm_fault & (VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV)) return -EFAULT; return 0; } typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data); extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); extern int apply_to_existing_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); extern void init_mem_debugging_and_hardening(void); #ifdef CONFIG_PAGE_POISONING extern void __kernel_poison_pages(struct page *page, int numpages); extern void __kernel_unpoison_pages(struct page *page, int numpages); extern bool _page_poisoning_enabled_early; DECLARE_STATIC_KEY_FALSE(_page_poisoning_enabled); static inline bool page_poisoning_enabled(void) { return _page_poisoning_enabled_early; } /* * For use in fast paths after init_mem_debugging() has run, or when a * false negative result is not harmful when called too early. */ static inline bool page_poisoning_enabled_static(void) { return static_branch_unlikely(&_page_poisoning_enabled); } static inline void kernel_poison_pages(struct page *page, int numpages) { if (page_poisoning_enabled_static()) __kernel_poison_pages(page, numpages); } static inline void kernel_unpoison_pages(struct page *page, int numpages) { if (page_poisoning_enabled_static()) __kernel_unpoison_pages(page, numpages); } #else static inline bool page_poisoning_enabled(void) { return false; } static inline bool page_poisoning_enabled_static(void) { return false; } static inline void __kernel_poison_pages(struct page *page, int nunmpages) { } static inline void kernel_poison_pages(struct page *page, int numpages) { } static inline void kernel_unpoison_pages(struct page *page, int numpages) { } #endif DECLARE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, init_on_alloc); static inline bool want_init_on_alloc(gfp_t flags) { if (static_branch_maybe(CONFIG_INIT_ON_ALLOC_DEFAULT_ON, &init_on_alloc)) return true; return flags & __GFP_ZERO; } DECLARE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); static inline bool want_init_on_free(void) { return static_branch_maybe(CONFIG_INIT_ON_FREE_DEFAULT_ON, &init_on_free); } extern bool _debug_pagealloc_enabled_early; DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled); static inline bool debug_pagealloc_enabled(void) { return IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) && _debug_pagealloc_enabled_early; } /* * For use in fast paths after init_debug_pagealloc() has run, or when a * false negative result is not harmful when called too early. */ static inline bool debug_pagealloc_enabled_static(void) { if (!IS_ENABLED(CONFIG_DEBUG_PAGEALLOC)) return false; return static_branch_unlikely(&_debug_pagealloc_enabled); } #ifdef CONFIG_DEBUG_PAGEALLOC /* * To support DEBUG_PAGEALLOC architecture must ensure that * __kernel_map_pages() never fails */ extern void __kernel_map_pages(struct page *page, int numpages, int enable); static inline void debug_pagealloc_map_pages(struct page *page, int numpages) { if (debug_pagealloc_enabled_static()) __kernel_map_pages(page, numpages, 1); } static inline void debug_pagealloc_unmap_pages(struct page *page, int numpages) { if (debug_pagealloc_enabled_static()) __kernel_map_pages(page, numpages, 0); } #else /* CONFIG_DEBUG_PAGEALLOC */ static inline void debug_pagealloc_map_pages(struct page *page, int numpages) {} static inline void debug_pagealloc_unmap_pages(struct page *page, int numpages) {} #endif /* CONFIG_DEBUG_PAGEALLOC */ #ifdef __HAVE_ARCH_GATE_AREA extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm); extern int in_gate_area_no_mm(unsigned long addr); extern int in_gate_area(struct mm_struct *mm, unsigned long addr); #else static inline struct vm_area_struct *get_gate_vma(struct mm_struct *mm) { return NULL; } static inline int in_gate_area_no_mm(unsigned long addr) { return 0; } static inline int in_gate_area(struct mm_struct *mm, unsigned long addr) { return 0; } #endif /* __HAVE_ARCH_GATE_AREA */ extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm); #ifdef CONFIG_SYSCTL extern int sysctl_drop_caches; int drop_caches_sysctl_handler(struct ctl_table *, int, void *, size_t *, loff_t *); #endif void drop_slab(void); void drop_slab_node(int nid); #ifndef CONFIG_MMU #define randomize_va_space 0 #else extern int randomize_va_space; #endif const char * arch_vma_name(struct vm_area_struct *vma); #ifdef CONFIG_MMU void print_vma_addr(char *prefix, unsigned long rip); #else static inline void print_vma_addr(char *prefix, unsigned long rip) { } #endif int vmemmap_remap_free(unsigned long start, unsigned long end, unsigned long reuse); int vmemmap_remap_alloc(unsigned long start, unsigned long end, unsigned long reuse, gfp_t gfp_mask); void *sparse_buffer_alloc(unsigned long size); struct page * __populate_section_memmap(unsigned long pfn, unsigned long nr_pages, int nid, struct vmem_altmap *altmap); pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node); pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node); pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node, struct vmem_altmap *altmap); void *vmemmap_alloc_block(unsigned long size, int node); struct vmem_altmap; void *vmemmap_alloc_block_buf(unsigned long size, int node, struct vmem_altmap *altmap); void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); int vmemmap_populate_basepages(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap); int vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap); void vmemmap_populate_print_last(void); #ifdef CONFIG_MEMORY_HOTPLUG void vmemmap_free(unsigned long start, unsigned long end, struct vmem_altmap *altmap); #endif void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, unsigned long nr_pages); enum mf_flags { MF_COUNT_INCREASED = 1 << 0, MF_ACTION_REQUIRED = 1 << 1, MF_MUST_KILL = 1 << 2, MF_SOFT_OFFLINE = 1 << 3, }; extern int memory_failure(unsigned long pfn, int flags); extern void memory_failure_queue_kick(int cpu); extern int unpoison_memory(unsigned long pfn); extern int sysctl_memory_failure_early_kill; extern int sysctl_memory_failure_recovery; extern void shake_page(struct page *p); extern atomic_long_t num_poisoned_pages __read_mostly; extern int soft_offline_page(unsigned long pfn, int flags); #ifdef CONFIG_MEMORY_FAILURE extern void memory_failure_queue(unsigned long pfn, int flags); extern int __get_huge_page_for_hwpoison(unsigned long pfn, int flags); #else static inline void memory_failure_queue(unsigned long pfn, int flags) { } static inline int __get_huge_page_for_hwpoison(unsigned long pfn, int flags) { return 0; } #endif /* * Error handlers for various types of pages. */ enum mf_result { MF_IGNORED, /* Error: cannot be handled */ MF_FAILED, /* Error: handling failed */ MF_DELAYED, /* Will be handled later */ MF_RECOVERED, /* Successfully recovered */ }; enum mf_action_page_type { MF_MSG_KERNEL, MF_MSG_KERNEL_HIGH_ORDER, MF_MSG_SLAB, MF_MSG_DIFFERENT_COMPOUND, MF_MSG_POISONED_HUGE, MF_MSG_HUGE, MF_MSG_FREE_HUGE, MF_MSG_NON_PMD_HUGE, MF_MSG_UNMAP_FAILED, MF_MSG_DIRTY_SWAPCACHE, MF_MSG_CLEAN_SWAPCACHE, MF_MSG_DIRTY_MLOCKED_LRU, MF_MSG_CLEAN_MLOCKED_LRU, MF_MSG_DIRTY_UNEVICTABLE_LRU, MF_MSG_CLEAN_UNEVICTABLE_LRU, MF_MSG_DIRTY_LRU, MF_MSG_CLEAN_LRU, MF_MSG_TRUNCATED_LRU, MF_MSG_BUDDY, MF_MSG_BUDDY_2ND, MF_MSG_DAX, MF_MSG_UNSPLIT_THP, MF_MSG_UNKNOWN, }; #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) extern void clear_huge_page(struct page *page, unsigned long addr_hint, unsigned int pages_per_huge_page); extern void copy_user_huge_page(struct page *dst, struct page *src, unsigned long addr_hint, struct vm_area_struct *vma, unsigned int pages_per_huge_page); extern long copy_huge_page_from_user(struct page *dst_page, const void __user *usr_src, unsigned int pages_per_huge_page, bool allow_pagefault); /** * vma_is_special_huge - Are transhuge page-table entries considered special? * @vma: Pointer to the struct vm_area_struct to consider * * Whether transhuge page-table entries are considered "special" following * the definition in vm_normal_page(). * * Return: true if transhuge page-table entries should be considered special, * false otherwise. */ static inline bool vma_is_special_huge(const struct vm_area_struct *vma) { return vma_is_dax(vma) || (vma->vm_file && (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP))); } #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */ #ifdef CONFIG_DEBUG_PAGEALLOC extern unsigned int _debug_guardpage_minorder; DECLARE_STATIC_KEY_FALSE(_debug_guardpage_enabled); static inline unsigned int debug_guardpage_minorder(void) { return _debug_guardpage_minorder; } static inline bool debug_guardpage_enabled(void) { return static_branch_unlikely(&_debug_guardpage_enabled); } static inline bool page_is_guard(struct page *page) { if (!debug_guardpage_enabled()) return false; return PageGuard(page); } #else static inline unsigned int debug_guardpage_minorder(void) { return 0; } static inline bool debug_guardpage_enabled(void) { return false; } static inline bool page_is_guard(struct page *page) { return false; } #endif /* CONFIG_DEBUG_PAGEALLOC */ #if MAX_NUMNODES > 1 void __init setup_nr_node_ids(void); #else static inline void setup_nr_node_ids(void) {} #endif extern int memcmp_pages(struct page *page1, struct page *page2); static inline int pages_identical(struct page *page1, struct page *page2) { return !memcmp_pages(page1, page2); } #ifdef CONFIG_MAPPING_DIRTY_HELPERS unsigned long clean_record_shared_mapping_range(struct address_space *mapping, pgoff_t first_index, pgoff_t nr, pgoff_t bitmap_pgoff, unsigned long *bitmap, pgoff_t *start, pgoff_t *end); unsigned long wp_shared_mapping_range(struct address_space *mapping, pgoff_t first_index, pgoff_t nr); #endif extern int sysctl_nr_trim_pages; #ifdef CONFIG_PRINTK void mem_dump_obj(void *object); #else static inline void mem_dump_obj(void *object) {} #endif static inline bool is_write_sealed(int seals) { return seals & (F_SEAL_WRITE | F_SEAL_FUTURE_WRITE); } /** * is_readonly_sealed - Checks whether write-sealed but mapped read-only, * in which case writes should be disallowing moving * forwards. * @seals: the seals to check * @vm_flags: the VMA flags to check * * Returns whether readonly sealed, in which case writess should be disallowed * going forward. */ static inline bool is_readonly_sealed(int seals, vm_flags_t vm_flags) { /* * Since an F_SEAL_[FUTURE_]WRITE sealed memfd can be mapped as * MAP_SHARED and read-only, take care to not allow mprotect to * revert protections on such mappings. Do this only for shared * mappings. For private mappings, don't need to mask * VM_MAYWRITE as we still want them to be COW-writable. */ if (is_write_sealed(seals) && ((vm_flags & (VM_SHARED | VM_WRITE)) == VM_SHARED)) return true; return false; } /** * seal_check_write - Check for F_SEAL_WRITE or F_SEAL_FUTURE_WRITE flags and * handle them. * @seals: the seals to check * @vma: the vma to operate on * * Check whether F_SEAL_WRITE or F_SEAL_FUTURE_WRITE are set; if so, do proper * check/handling on the vma flags. Return 0 if check pass, or <0 for errors. */ static inline int seal_check_write(int seals, struct vm_area_struct *vma) { if (!is_write_sealed(seals)) return 0; /* * New PROT_WRITE and MAP_SHARED mmaps are not allowed when * write seals are active. */ if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE)) return -EPERM; return 0; } #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */