linux-stable/include
Petr Tesarik def9b71ee6 include/linux/mmzone.h: fix explanation of lower bits in the SPARSEMEM mem_map pointer
The comment is confusing.  On the one hand, it refers to 32-bit
alignment (struct page alignment on 32-bit platforms), but this would
only guarantee that the 2 lowest bits must be zero.  On the other hand,
it claims that at least 3 bits are available, and 3 bits are actually
used.

This is not broken, because there is a stronger alignment guarantee,
just less obvious.  Let's fix the comment to make it clear how many bits
are available and why.

Although memmap arrays are allocated in various places, the resulting
pointer is encoded eventually, so I am adding a BUG_ON() here to enforce
at runtime that all expected bits are indeed available.

I have also added a BUILD_BUG_ON to check that PFN_SECTION_SHIFT is
sufficient, because this part of the calculation can be easily checked
at build time.

[ptesarik@suse.com: v2]
  Link: http://lkml.kernel.org/r/20180125100516.589ea6af@ezekiel.suse.cz
Link: http://lkml.kernel.org/r/20180119080908.3a662e6f@ezekiel.suse.cz
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kemi Wang <kemi.wang@intel.com>
Cc: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-01-31 17:18:39 -08:00
..
acpi Merge branches 'acpi-gpio', 'acpi-button', 'acpi-battery' and 'acpi-video' 2018-01-18 03:02:16 +01:00
asm-generic mm/thp: remove pmd_huge_split_prepare() 2018-01-31 17:18:38 -08:00
clocksource
crypto Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
drm Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
dt-bindings
keys
kvm KVM: arm/arm64: timer: Don't set irq as forwarded if no usable GIC 2017-12-18 10:53:23 +01:00
linux include/linux/mmzone.h: fix explanation of lower bits in the SPARSEMEM mem_map pointer 2018-01-31 17:18:39 -08:00
math-emu
media
memory
misc
net Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
pcmcia
ras
rdma RDMA/restrack: Add general infrastructure to track RDMA resources 2018-01-29 20:21:39 -07:00
scsi First merge window pull request for 4.16 2018-01-31 12:05:10 -08:00
soc
sound Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
target
trace mm: use sc->priority for slab shrink targets 2018-01-31 17:18:36 -08:00
uapi First merge window pull request for 4.16 2018-01-31 12:05:10 -08:00
video
xen xen: fixes for 4.15-rc5 2017-12-22 12:30:10 -08:00