OrangePi_CM5/Documentation
Mike Kravetz 282f421438 hugetlbfs: clean up command line processing
With all hugetlb page processing done in a single file clean up code.

- Make code match desired semantics
  - Update documentation with semantics
- Make all warnings and errors messages start with 'HugeTLB:'.
- Consistently name command line parsing routines.
- Warn if !hugepages_supported() and command line parameters have
  been specified.
- Add comments to code
  - Describe some of the subtle interactions
  - Describe semantics of command line arguments

This patch also fixes issues with implicitly setting the number of
gigantic huge pages to preallocate.  Previously on X86 command line,

        hugepages=2 default_hugepagesz=1G

would result in zero 1G pages being preallocated and,

        # grep HugePages_Total /proc/meminfo
        HugePages_Total:       0
        # sysctl -a | grep nr_hugepages
        vm.nr_hugepages = 2
        vm.nr_hugepages_mempolicy = 2
        # cat /proc/sys/vm/nr_hugepages
        2

After this patch 2 gigantic pages will be preallocated and all the proc,
sysfs, sysctl and meminfo files will accurately reflect this.

To address the issue with gigantic pages, a small change in behavior was
made to command line processing.  Previously the command line,

        hugepages=128 default_hugepagesz=2M hugepagesz=2M hugepages=256

would result in the allocation of 256 2M huge pages.  The value 128 would
be ignored without any warning.  After this patch, 128 2M pages will be
allocated and a warning message will be displayed indicating the value of
256 is ignored.  This change in behavior is required because allocation of
implicitly specified gigantic pages must be done when the
default_hugepagesz= is encountered for gigantic pages.  Previously the
code waited until later in the boot process (hugetlb_init), to allocate
pages of default size.  However the bootmem allocator required for
gigantic allocations is not available at this time.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Sandipan Das <sandipan@linux.ibm.com>
Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>	[s390]
Acked-by: Will Deacon <will@kernel.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Longpeng <longpeng2@huawei.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Nitesh Narayan Lal <nitesh@redhat.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Anders Roxell <anders.roxell@linaro.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: Qian Cai <cai@lca.pw>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Link: http://lkml.kernel.org/r/20200417185049.275845-5-mike.kravetz@oracle.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-03 20:09:46 -07:00
..
ABI ACPI updates for 5.8-rc1 2020-06-02 13:25:52 -07:00
PCI docs: pci: boot-interrupts.rst: improve html output 2020-04-20 15:45:23 -06:00
RCU rcu: Make rcu_read_unlock_special() safe for rq/pi locks 2020-04-27 11:03:50 -07:00
accounting
…
admin-guide hugetlbfs: clean up command line processing 2020-06-03 20:09:46 -07:00
arm
…
arm64 A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
block for-5.8-tag 2020-06-02 19:59:25 -07:00
bpf bpf: lsm: Add Documentation 2020-03-30 01:35:12 +02:00
cdrom
…
core-api padata: document multithreaded jobs 2020-06-03 20:09:45 -07:00
cpu-freq docs: cpu-freq: convert cpufreq-stats.txt to ReST 2020-03-06 00:01:02 +01:00
crypto
…
dev-tools linux-kselftest-kunit-5.7-rc1 2020-04-01 16:11:40 -07:00
devicetree drm pull for 5.8-rc1 2020-06-02 15:04:15 -07:00
doc-guide docs: fix broken references for ReST files that moved around 2020-04-20 15:45:03 -06:00
driver-api Power management updates for 5.8-rc1 2020-06-02 13:17:23 -07:00
fault-injection
…
fb efi/gop: Add an option to list out the available GOP modes 2020-05-20 19:09:20 +02:00
features mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option 2020-06-03 20:09:43 -07:00
filesystems New code for 5.8: 2020-06-02 19:45:12 -07:00
firmware-guide Documentation: firmware-guide: ACPI: fix table alignment in namespace.rst 2020-04-08 14:27:48 +02:00
firmware_class
…
fpga
…
gpu Merge tag 'drm-intel-next-2020-05-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2020-05-20 13:36:45 +10:00
hid
…
hwmon hwmon: Add Baikal-T1 PVT sensor driver 2020-05-28 07:59:45 -07:00
i2c docs: i2c: rename i2c.svg to i2c_bus.svg 2020-04-20 15:45:41 -06:00
ia64 docs: add IRQ documentation at the core-api book 2020-05-15 12:00:56 -06:00
ide
…
iio docs: filesystems: convert configfs.txt to ReST 2020-05-05 09:23:25 -06:00
infiniband
…
input
…
isdn
…
kbuild Documentation: kbuild: fix the section title format 2020-04-23 10:53:19 +09:00
kernel-hacking docs: locking: Drop :c:func: throughout 2020-03-20 17:16:24 -06:00
leds
…
livepatch
…
locking A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
m68k
…
maintainer Documentation: fixes to the maintainer-entry-profile template 2020-06-01 09:36:07 -06:00
media media updates for v5.7-rc1 2020-03-30 13:42:05 -07:00
mhi docs: Add documentation for MHI bus 2020-03-19 07:41:04 +01:00
mips docs: mips: remove no longer needed au1xxx_ide.rst documentation 2020-03-24 15:53:48 +01:00
misc-devices doc: misc-device: add uacce to toctree(index) 2020-05-05 09:41:59 -06:00
netlabel
…
networking A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
nios2
…
nvdimm nvdimm: fixes to maintainter-entry-profile 2020-05-25 10:19:19 -06:00
openrisc
…
parisc
…
pcmcia
…
power Power management updates for 5.8-rc1 2020-06-02 13:17:23 -07:00
powerpc docs: powerpc: cxl.rst: mark two section titles as such 2020-04-20 15:45:25 -06:00
process A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
riscv
…
s390 docs: s390: Fix wrong label Guest2 instead of Guest3 2020-05-05 09:45:28 -06:00
scheduler Documentation: scheduler: fix outdated information on sched groups 2020-04-21 13:38:27 -06:00
scsi SCSI misc on 20200402 2020-04-02 17:03:53 -07:00
security A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
sh
…
sound ALSA: hda/realtek - Remove now-unnecessary XPS 13 headphone noise fixups 2020-03-31 10:54:06 +02:00
sparc
…
sphinx docs: update recommended Sphinx version to 2.4.4 2020-04-20 15:35:58 -06:00
sphinx-static
…
spi
…
target docs: prevent warnings due to autosectionlabel 2020-03-20 17:01:29 -06:00
timers
…
trace A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
translations docs: add IRQ documentation at the core-api book 2020-05-15 12:00:56 -06:00
usb A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
userspace-api docs: ioctl-number.rst: add habanalabs driver IOCTL 2020-04-20 17:01:53 -06:00
virt A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
vm docs/vm: update memory-models documentation 2020-06-03 20:09:44 -07:00
w1
…
watchdog watchdog: update email address in conversion doc 2020-05-05 09:39:53 -06:00
x86 A fair amount of stuff this time around, dominated by yet another massive 2020-06-01 15:45:27 -07:00
xtensa
…
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
COPYING-logo
…
Changes
…
CodingStyle
…
Kconfig
…
Makefile docs: Makefile: place final pdf docs on a separate dir 2020-04-20 15:45:41 -06:00
SubmittingPatches
…
asm-annotations.rst
…
atomic_bitops.txt
…
atomic_t.txt
…
bus-virt-phys-mapping.txt
…
conf.py docs: LaTeX/PDF: drop list of documents 2020-04-20 15:35:58 -06:00
crc32.txt
…
docutils.conf
…
dontdiff
…
index.rst Char/Misc driver patches for 5.7-rc1 2020-04-03 13:22:40 -07:00
kprobes.txt
…
logo.gif
…
lzo.txt
…
mailbox.txt
…
memory-barriers.txt docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
nommu-mmap.txt
…
remoteproc.txt remoteproc: Add elf64 support in elf loader 2020-03-25 22:29:40 -07:00
rpmsg.txt
…
speculation.txt
…
static-keys.txt
…
tee.txt
…
this_cpu_ops.txt
…
xz.txt
…