linux-stable/Documentation
Michal Hocko 28aeb4c95f mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps
[ Upstream commit 7550c60798 ]

Patch series "THP eligibility reporting via proc".

This series of three patches aims at making THP eligibility reporting much
more robust and long term sustainable.  The trigger for the change is a
regression report [2] and the long follow up discussion.  In short the
specific application didn't have good API to query whether a particular
mapping can be backed by THP so it has used VMA flags to workaround that.
These flags represent a deep internal state of VMAs and as such they
should be used by userspace with a great deal of caution.

A similar has happened for [3] when users complained that VM_MIXEDMAP is
no longer set on DAX mappings.  Again a lack of a proper API led to an
abuse.

The first patch in the series tries to emphasise that that the semantic of
flags might change and any application consuming those should be really
careful.

The remaining two patches provide a more suitable interface to address [2]
and provide a consistent API to query the THP status both for each VMA and
process wide as well.  [1]

http://lkml.kernel.org/r/20181120103515.25280-1-mhocko@kernel.org [2]
http://lkml.kernel.org/r/http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com
[3] http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz

This patch (of 3):

Even though vma flags exported via /proc/<pid>/smaps are explicitly
documented to be not guaranteed for future compatibility the warning
doesn't go far enough because it doesn't mention semantic changes to those
flags.  And they are important as well because these flags are a deep
implementation internal to the MM code and the semantic might change at
any time.

Let's consider two recent examples:
http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz
: commit e1fb4a0864 "dax: remove VM_MIXEDMAP for fsdax and device dax" has
: removed VM_MIXEDMAP flag from DAX VMAs. Now our testing shows that in the
: mean time certain customer of ours started poking into /proc/<pid>/smaps
: and looks at VMA flags there and if VM_MIXEDMAP is missing among the VMA
: flags, the application just fails to start complaining that DAX support is
: missing in the kernel.

http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com
: Commit 1860033237 ("mm: make PR_SET_THP_DISABLE immediately active")
: introduced a regression in that userspace cannot always determine the set
: of vmas where thp is ineligible.
: Userspace relies on the "nh" flag being emitted as part of /proc/pid/smaps
: to determine if a vma is eligible to be backed by hugepages.
: Previous to this commit, prctl(PR_SET_THP_DISABLE, 1) would cause thp to
: be disabled and emit "nh" as a flag for the corresponding vmas as part of
: /proc/pid/smaps.  After the commit, thp is disabled by means of an mm
: flag and "nh" is not emitted.
: This causes smaps parsing libraries to assume a vma is eligible for thp
: and ends up puzzling the user on why its memory is not backed by thp.

In both cases userspace was relying on a semantic of a specific VMA flag.
The primary reason why that happened is a lack of a proper interface.
While this has been worked on and it will be fixed properly, it seems that
our wording could see some refinement and be more vocal about semantic
aspect of these flags as well.

Link: http://lkml.kernel.org/r/20181211143641.3503-2-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Jan Kara <jack@suse.cz>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Paul Oppenheimer <bepvte@gmail.com>
Cc: William Kucharski <william.kucharski@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-26 09:38:36 +01:00
..
80211 docs-rst: sphinxify 802.11 documentation 2016-10-11 16:19:17 -06:00
ABI x86/bugs, kvm: Introduce boot-time control of L1TF mitigations 2018-08-15 18:14:51 +02:00
accounting tools: move accounting tool from Documentation 2016-09-23 13:07:15 -06:00
acpi Merge branches 'acpi-button', 'acpi-battery' and 'acpi-doc' 2016-10-02 01:40:20 +02:00
aoe
arm linux-kselftest-4.9-rc1-update 2016-10-14 15:17:12 -07:00
arm64 arm64: Add work around for Arm Cortex-A55 Erratum 1024718 2018-05-16 10:08:42 +02:00
auxdisplay samples: move auxdisplay example code from Documentation 2016-09-23 11:52:32 -06:00
backlight
blackfin samples: move blackfin gptimers-example from Documentation 2016-10-10 07:12:02 -06:00
block block: remove remnant refs to hardsect 2016-09-14 08:44:57 -06:00
blockdev zram: cosmetic: cleanup documentation 2016-07-26 16:19:19 -07:00
bus-devices
cdrom
cgroup-v1 Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
cma
connector
console
cpu-freq cpufreq-stats: Minor documentation fix 2016-09-08 23:05:07 +02:00
cpuidle
cris
crypto crypto: doc - Fix typo 2016-05-31 16:41:55 +08:00
dev-tools mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping 2016-10-11 15:06:33 -07:00
development-process docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
device-mapper dm thin: fix documentation relative to low water mark threshold 2018-05-30 07:50:20 +02:00
devicetree ARM: dts: at91: add new compatibility string for macb on sama5d3 2018-10-18 09:13:20 +02:00
dmaengine dmaengine: documentation to the new callback mechanism 2016-08-08 08:11:42 +05:30
DocBook A single commit converting the mac80211 DocBook template over to Sphinx. 2016-10-14 14:11:22 -07:00
driver-api docs: Don't format internal MPT docs 2016-09-06 09:15:48 -06:00
driver-model power supply and reset changes for the v4.9 series 2016-10-06 18:21:15 -07:00
early-userspace
EDID
extcon
fault-injection
fb Documentation: fb: fix spelling mistakes 2016-05-10 12:05:27 +03:00
features Documentation: MIPS supports HAVE_REGS_AND_STACK_ACCESS_API 2016-10-13 17:19:19 +02:00
filesystems mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps 2019-01-26 09:38:36 +01:00
firmware_class
fmc
fpga
frv
gpio gpio/board.txt: point to gpiod_set_value 2016-10-20 14:14:11 +02:00
gpu Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux 2016-10-11 18:12:22 -07:00
hid Documentation: HID: Intel ISH HID document 2016-08-17 11:13:07 +02:00
hwmon hwmon: (ina2xx) fix sysfs shunt resistor read access 2018-10-03 17:01:52 -07:00
i2c i2c: Documentation: i2c-topology: fix minor whitespace nit 2016-11-10 21:18:56 +01:00
ia64 selftests: move ia64 tests from Documentation/ia64 2016-09-20 09:58:12 -06:00
ide
iio iio: Documentation: Correct the path used to create triggers. 2016-10-01 00:49:58 -06:00
infiniband IB/hfi1: Document new sysfs entries for hfi1 driver 2016-10-02 08:42:19 -04:00
input Input: ALPS - add V8 protocol documentation 2016-10-04 11:47:02 -07:00
ioctl doc: ioctl: Add some clarifications to botching-up-ioctls 2016-09-06 06:00:22 -06:00
isdn
ja_JP
kbuild Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
kdump Documentation: kdump: Add description of enable multi-cpus support 2016-09-20 18:02:54 -06:00
ko_KR locking/Documentation: Add Korean translation 2016-08-12 08:24:14 +02:00
laptops tools: move laptops dslm tool from Documentation 2016-09-23 13:07:21 -06:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds 2016-10-04 10:25:53 -07:00
livepatch Documentation: livepatch: add section about arch-specific code 2016-08-18 23:41:56 +02:00
locking locking/lglock: Remove lglock implementation 2016-09-22 15:25:56 +02:00
m68k
media videodev2.h: go back to limited range Y'CbCr for SRGB and, ADOBERGB 2017-02-23 17:44:37 +01:00
memory-devices
metag
mic samples: move mic/mpssd example code from Documentation 2016-09-20 12:38:48 -06:00
mips
misc-devices samples: move misc-devices/mei example code from Documentation 2016-09-23 11:51:43 -06:00
mmc mmc: core: Extend sysfs with DSR register 2016-07-25 10:34:51 +02:00
mn10300
mtd
namespaces
netlabel
networking inet: frags: break the 2GB limit for frags storage 2018-10-18 09:13:24 +02:00
nfc
nios2
nvdimm libnvdimm, btt: update the usage section in Documentation 2016-06-17 16:23:23 -07:00
nvmem
parisc
PCI PCI changes for the v4.9 merge window: 2016-10-07 11:46:37 -07:00
pcmcia tools: move pcmcia crc32hash tool from Documentation 2016-09-23 13:07:27 -06:00
perf perf: xgene: Add APM X-Gene SoC Performance Monitoring Unit driver 2016-09-15 11:20:55 -07:00
phy
platform
power power supply and reset changes for the v4.9 series 2016-10-06 18:21:15 -07:00
powerpc powerpc updates for 4.9 2016-10-07 20:19:31 -07:00
pps
prctl selftests: move prctl tests from Documentation/prctl 2016-09-20 09:09:09 -06:00
pti
ptp selftests: move ptp tests from Documentation/ptp 2016-09-20 09:54:38 -06:00
rapidio rapidio/documentation/mport_cdev: add missing parameter description 2016-09-01 17:52:02 -07:00
RCU kthread: kthread worker API cleanup 2016-10-11 15:06:33 -07:00
s390 s390/Documentation: improve sort command for trace buffer 2016-06-13 15:58:23 +02:00
scheduler sched/deadline: Document behavior of sched_yield() 2016-09-10 11:17:41 +02:00
scsi scsi: g_NCR5380: Stop using scsi_module.c 2016-09-29 21:52:43 -04:00
security Some big changes this month, headlined by the addition of a new formatted 2016-07-26 13:05:11 -07:00
serial Documentation: rs485: Do not define manually the ioctl 2016-08-18 11:08:33 -06:00
sh
sound ASoC: Updates for v4.8 2016-07-26 10:35:31 +02:00
sphinx docs: sphinx-extensions: make rstFlatTable work with docutils 0.13 2017-01-09 08:32:18 +01:00
sphinx-static This is the documentation update pull for the 4.9 merge window. 2016-10-04 13:54:07 -07:00
spi Doc: update 00-INDEX files to reflect the runnable code move 2016-10-10 07:12:09 -06:00
sysctl namei: allow restricted O_CREAT of FIFOs and regular files 2018-12-01 09:44:25 +01:00
target target: make close_session optional 2016-05-10 01:19:26 -07:00
thermal thermal: Add support for hardware-tracked trip points 2016-09-27 14:02:16 +08:00
timers Doc: update 00-INDEX files to reflect the runnable code move 2016-10-10 07:12:09 -06:00
tpm tpm: Add documentation for the tpm_vtpm_proxy device driver 2016-06-25 17:26:35 +03:00
trace This release cycle is rather small. Just a few fixes to tracing. 2016-10-06 11:48:41 -07:00
usb Documentation: tiny typo fix in usb/gadget_multi.txt 2016-06-23 08:09:10 -06:00
virtual KVM: x86: Add a framework for supporting MSR-based features 2018-08-15 18:14:52 +02:00
vm Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
w1 w1: add ability to set (SRAM) and store (EEPROM) configuration for temp sensors like DS18B20 2016-05-01 14:37:49 -07:00
watchdog linux-kselftest-4.9-rc1-update 2016-10-14 15:17:12 -07:00
wimax
x86 x86/pti: Document fix wrong index 2018-01-23 19:57:10 +01:00
xtensa xtensa: cleanup MMU setup and kernel layout macros 2016-07-24 06:33:58 +03:00
zh_CN docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
.gitignore Add .pyc files to .gitignore 2016-06-30 13:07:33 -06:00
00-INDEX Doc: update 00-INDEX files to reflect the runnable code move 2016-10-10 07:12:09 -06:00
adding-syscalls.txt
applying-patches.txt docs: Clean up bare :: lines 2016-09-20 18:46:36 -06:00
assoc_array.txt
atomic_ops.txt
bad_memory.txt
basic_profiling.txt
bcache.txt bcache: documentation formatting, edited for clarity, stripe alignment notes 2016-06-23 07:58:38 -06:00
binfmt_misc.txt
braille-console.txt
bt8xxgpio.txt
btmrvl.txt
BUG-HUNTING
bus-virt-phys-mapping.txt
cachetlb.txt
cgroup-v2.txt
Changes kbuild: verify that $DEPMOD is installed 2018-08-17 20:59:29 +02:00
circular-buffers.txt
clk.txt Documentation: clk: update file names containing referenced structures 2016-08-14 12:12:36 -06:00
CodeOfConflict URL changed for Linux Foundation TAB 2016-10-01 00:57:13 -06:00
CodingStyle docs: Remove space-before-label guidance from CodingStyle 2016-09-21 15:53:31 -06:00
conf.py docs-rst: fix LaTeX \DURole renewcommand with Sphinx 1.3+ 2017-01-12 11:39:32 +01:00
cpu-hotplug.txt
cpu-load.txt
cputopology.txt topology/sysfs: provide drawer id and siblings attributes 2016-06-13 15:58:27 +02:00
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
devices.txt
digsig.txt
DMA-API-HOWTO.txt Documentation: DMA-API-HOWTO: Fix a typo 2016-09-20 17:58:46 -06:00
DMA-API.txt dma-mapping: add dma_{map,unmap}_resource 2016-09-26 22:16:41 +05:30
DMA-attributes.txt dma-mapping: introduce the DMA_ATTR_NO_WARN attribute 2016-10-11 15:06:32 -07:00
dma-buf-sharing.txt
DMA-ISA-LPC.txt
docutils.conf doc-rst: add docutils config file 2016-08-14 11:52:40 -06:00
dontdiff GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
dynamic-debug-howto.txt
edac.txt
efi-stub.txt
eisa.txt
email-clients.txt Documentation/email-clients.txt: convert it to ReST markup 2016-09-21 15:41:50 -06:00
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
highuid.txt
HOWTO docs: Clean up bare :: lines 2016-09-20 18:46:36 -06:00
hw_random.txt
hwspinlock.txt
index.rst Documentation: Add section about CPU vulnerabilities 2018-08-15 18:14:51 +02:00
init.txt
initrd.txt
Intel-IOMMU.txt
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isa.txt Documentation: Add ISA bus driver documentation 2016-05-02 09:32:04 -07:00
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt docs: deprecate kernel-doc-nano-HOWTO.txt 2016-07-20 16:45:37 -06:00
kernel-docs.txt Documentation/kernel-docs.txt: reorder based on timestamp 2016-09-20 18:54:42 -06:00
kernel-documentation.rst This is the documentation update pull for the 4.9 merge window. 2016-10-04 13:54:07 -07:00
kernel-parameters.txt ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs 2018-11-10 07:42:45 -08:00
kernel-per-CPU-kthreads.txt Documenation: update cgroup's document path 2016-08-03 15:43:58 -06:00
kobject.txt
kprobes.txt Documentation: kprobes: Document jprobes stack copying limitations 2016-08-15 10:19:11 -06:00
kref.txt
kselftest.txt kselftest: kselftest documentation improvement 2016-09-20 08:58:27 -06:00
l1tf.rst KVM: VMX: Tell the nested hypervisor to skip L1D flush on vmentry 2018-08-15 18:14:53 +02:00
ldm.txt
local_ops.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lzo.txt
magic-number.txt
mailbox.txt
Makefile samples: move blackfin gptimers-example from Documentation 2016-10-10 07:12:02 -06:00
Makefile.sphinx doc-rst: generic way to build PDF of sub-folders 2016-09-01 08:49:23 -06:00
ManagementStyle Documentation/HOWTO: add cross-references to other documents 2016-09-20 18:41:04 -06:00
md-cluster.txt md-cluster: change array_sectors and update size are not supported 2016-05-04 12:39:35 -07:00
md.txt Documentation: fix wrong value in md.txt 2016-06-23 08:08:36 -06:00
memory-barriers.txt locking/Documentation: Fix a typo of example result 2016-08-12 08:24:13 +02:00
memory-hotplug.txt memory_hotplug: introduce CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE 2016-05-19 19:12:14 -07:00
men-chameleon-bus.txt
module-signing.txt Documentation/module-signing.txt: Note need for version info if reusing a key 2016-07-27 12:38:00 +09:30
mono.txt
nommu-mmap.txt
ntb.txt
numastat.txt
oops-tracing.txt
padata.txt
parport-lowlevel.txt
parport.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pinctrl.txt pinctrl: Flag strict is a field in struct pinmux_ops 2016-06-23 10:50:10 +02:00
pnp.txt
preempt-locking.txt
printk-formats.txt lib/vsprintf: Remove atomic-unsafe support for %pCr 2018-07-03 11:23:06 +02:00
pwm.txt pwm: Update documentation 2016-05-17 14:48:04 +02:00
ramoops.txt ramoops: use DT reserved-memory bindings 2016-08-05 11:21:36 -07:00
rbtree.txt
remoteproc.txt remoteproc: Split driver and consumer dereferencing 2016-10-02 22:50:21 -07:00
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt rpmsg: use module_rpmsg_driver in existing drivers and examples 2016-05-06 11:09:01 -07:00
rtc.txt
SAK.txt
SecurityBugs Documentation/HOWTO: add cross-references to other documents 2016-09-20 18:41:04 -06:00
serial-console.txt
sgi-ioc4.txt
SM501.txt
smsc_ece1099.txt
spec_ctrl.txt Documentation/spec_ctrl: Do some minor cleanups 2018-05-22 16:58:02 +02:00
speculation.txt Documentation: Document array_index_nospec 2018-02-13 12:35:59 +01:00
stable_api_nonsense.txt Documentation/HOWTO: add cross-references to other documents 2016-09-20 18:41:04 -06:00
stable_kernel_rules.txt Documentation: stable-kernel-rules: fix stable-tag format 2017-04-12 12:41:15 +02:00
static-keys.txt jump_labels: Allow array initialisers 2016-09-07 09:41:11 +01:00
SubmitChecklist docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
SubmittingDrivers docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
SubmittingPatches docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
svga.txt
sync_file.txt Documentation: add doc for sync_file_get_fence() 2016-08-11 15:33:24 +05:30
sysfs-rules.txt
sysrq.txt
this_cpu_ops.txt
unaligned-memory-access.txt
unicode.txt
unshare.txt
vfio.txt
VGA-softcursor.txt
video-output.txt
vme_api.txt vme: Update documentation to match api 2016-08-31 13:20:16 +02:00
volatile-considered-harmful.txt
workqueue.txt workqueue: Fix a typo in workqueue.txt 2016-07-06 02:37:38 -06:00
xillybus.txt
xz.txt
zorro.txt