1
0
Fork 0
alistair23-linux/include
Mike Kravetz b5cec28d36 hugetlbfs: truncate_hugepages() takes a range of pages
Modify truncate_hugepages() to take a range of pages (start, end)
instead of simply start.  If an end value of LLONG_MAX is passed, the
current "truncate" functionality is maintained.  Existing callers are
modified to pass LLONG_MAX as end of range.  By keying off end ==
LLONG_MAX, the routine behaves differently for truncate and hole punch.
Page removal is now synchronized with page allocation via faults by
using the fault mutex table.  The hole punch case can experience the
rare region_del error and must handle accordingly.

Add the routine hugetlb_fix_reserve_counts to fix up reserve counts in
the case where region_del returns an error.

Since the routine handles more than just the truncate case, it is
renamed to remove_inode_hugepages().  To be consistent, the routine
truncate_huge_page() is renamed remove_huge_page().

Downstream of remove_inode_hugepages(), the routine
hugetlb_unreserve_pages() is also modified to take a range of pages.
hugetlb_unreserve_pages is modified to detect an error from region_del and
pass it back to the caller.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-08 15:35:28 -07:00
..
acpi Merge branch 'pm-cpufreq' 2015-09-01 15:52:35 +02:00
asm-generic Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-09-03 15:46:07 -07:00
clocksource
crypto Merge branch 'for-4.3/sg' of git://git.kernel.dk/linux-block 2015-09-02 13:22:38 -07:00
drm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2015-09-04 15:49:32 -07:00
dt-bindings media updates for v4.3-rc1 2015-09-05 18:21:14 -07:00
keys
kvm
linux hugetlbfs: truncate_hugepages() takes a range of pages 2015-09-08 15:35:28 -07:00
math-emu
media media updates for v4.3-rc1 2015-09-05 18:21:14 -07:00
memory
misc cxl: Allow the kernel to trust that an image won't change on PERST. 2015-08-14 21:32:07 +10:00
net memcg: move memcg_proto_active from sock.h 2015-09-08 15:35:28 -07:00
pcmcia
ras
rdma core: Remove the ib_reg_phys_mr() and ib_rereg_phys_mr() verbs 2015-08-05 16:21:28 -04:00
rxrpc
scsi SCSI misc on 20150901 2015-09-02 12:22:54 -07:00
soc ARM: tegra: Memory controller updates for v4.3-rc1 2015-08-20 18:50:17 -07:00
sound ALSA: hda - Fix missing inline for dummy snd_hdac_set_codec_wakeup() 2015-09-02 12:24:55 +02:00
target iscsi-target: Fix iscsit_start_kthreads failure OOPs 2015-07-24 14:19:43 -07:00
trace media updates for v4.3-rc1 2015-09-05 18:21:14 -07:00
uapi NFS client updates for Linux 4.3 2015-09-07 14:02:24 -07:00
video Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2015-09-04 15:49:32 -07:00
xen xen-netback: add support for multicast control 2015-09-02 11:45:00 -07:00
Kbuild