mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'mm-hotfixes-stable-2025-04-16-19-59' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc hotfixes from Andrew Morton: "31 hotfixes. 9 are cc:stable and the remainder address post-6.15 issues or aren't considered necessary for -stable kernels. 22 patches are for MM, 9 are otherwise" * tag 'mm-hotfixes-stable-2025-04-16-19-59' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (31 commits) MAINTAINERS: update HUGETLB reviewers mm: fix apply_to_existing_page_range() selftests/mm: fix compiler -Wmaybe-uninitialized warning alloc_tag: handle incomplete bulk allocations in vm_module_tags_populate mailmap: add entry for Jean-Michel Hautbois mm: (un)track_pfn_copy() fix + doc improvements mm: fix filemap_get_folios_contig returning batches of identical folios mm/hugetlb: add a line break at the end of the format string selftests: mincore: fix tmpfs mincore test failure mm/hugetlb: fix set_max_huge_pages() when there are surplus pages mm/cma: report base address of single range correctly mm: page_alloc: speed up fallbacks in rmqueue_bulk() kunit: slub: add module description mm/kasan: add module decription ucs2_string: add module description zlib: add module description fpga: tests: add module descriptions samples/livepatch: add module descriptions ASN.1: add module description mm/vma: add give_up_on_oom option on modify/merge, use in uffd release ...
This commit is contained in:
@@ -322,6 +322,7 @@ Jayachandran C <c.jayachandran@gmail.com> <jchandra@broadcom.com>
|
||||
Jayachandran C <c.jayachandran@gmail.com> <jchandra@digeo.com>
|
||||
Jayachandran C <c.jayachandran@gmail.com> <jnair@caviumnetworks.com>
|
||||
<jean-philippe@linaro.org> <jean-philippe.brucker@arm.com>
|
||||
Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org> <jeanmichel.hautbois@ideasonboard.com>
|
||||
Jean Tourrilhes <jt@hpl.hp.com>
|
||||
Jeevan Shriram <quic_jshriram@quicinc.com> <jshriram@codeaurora.org>
|
||||
Jeff Garzik <jgarzik@pretzel.yyz.us>
|
||||
@@ -438,6 +439,8 @@ Linus Lüssing <linus.luessing@c0d3.blue> <ll@simonwunderlich.de>
|
||||
Li Yang <leoyang.li@nxp.com> <leoli@freescale.com>
|
||||
Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org>
|
||||
Lior David <quic_liord@quicinc.com> <liord@codeaurora.org>
|
||||
Loic Poulain <loic.poulain@oss.qualcomm.com> <loic.poulain@linaro.org>
|
||||
Loic Poulain <loic.poulain@oss.qualcomm.com> <loic.poulain@intel.com>
|
||||
Lorenzo Pieralisi <lpieralisi@kernel.org> <lorenzo.pieralisi@arm.com>
|
||||
Lorenzo Stoakes <lorenzo.stoakes@oracle.com> <lstoakes@gmail.com>
|
||||
Luca Ceresoli <luca.ceresoli@bootlin.com> <luca@lucaceresoli.net>
|
||||
|
||||
@@ -27,7 +27,7 @@ SYSCALL
|
||||
=======
|
||||
mseal syscall signature
|
||||
-----------------------
|
||||
``int mseal(void \* addr, size_t len, unsigned long flags)``
|
||||
``int mseal(void *addr, size_t len, unsigned long flags)``
|
||||
|
||||
**addr**/**len**: virtual memory address range.
|
||||
The address range set by **addr**/**len** must meet:
|
||||
|
||||
@@ -10956,6 +10956,7 @@ F: include/linux/platform_data/huawei-gaokun-ec.h
|
||||
|
||||
HUGETLB SUBSYSTEM
|
||||
M: Muchun Song <muchun.song@linux.dev>
|
||||
R: Oscar Salvador <osalvador@suse.de>
|
||||
L: linux-mm@kvack.org
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-kernel-mm-hugepages
|
||||
@@ -12812,6 +12813,7 @@ F: lib/Kconfig.kcsan
|
||||
F: scripts/Makefile.kcsan
|
||||
|
||||
KDUMP
|
||||
M: Andrew Morton <akpm@linux-foundation.org>
|
||||
M: Baoquan He <bhe@redhat.com>
|
||||
R: Vivek Goyal <vgoyal@redhat.com>
|
||||
R: Dave Young <dyoung@redhat.com>
|
||||
@@ -13113,6 +13115,8 @@ F: fs/kernfs/
|
||||
F: include/linux/kernfs.h
|
||||
|
||||
KEXEC
|
||||
M: Andrew Morton <akpm@linux-foundation.org>
|
||||
M: Baoquan He <bhe@redhat.com>
|
||||
L: kexec@lists.infradead.org
|
||||
W: http://kernel.org/pub/linux/utils/kernel/kexec/
|
||||
F: include/linux/kexec.h
|
||||
|
||||
@@ -170,4 +170,5 @@ static struct kunit_suite fpga_bridge_suite = {
|
||||
|
||||
kunit_test_suite(fpga_bridge_suite);
|
||||
|
||||
MODULE_DESCRIPTION("KUnit test for the FPGA Bridge");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -330,4 +330,5 @@ static struct kunit_suite fpga_mgr_suite = {
|
||||
|
||||
kunit_test_suite(fpga_mgr_suite);
|
||||
|
||||
MODULE_DESCRIPTION("KUnit test for the FPGA Manager");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -214,4 +214,5 @@ static struct kunit_suite fpga_region_suite = {
|
||||
|
||||
kunit_test_suite(fpga_region_suite);
|
||||
|
||||
MODULE_DESCRIPTION("KUnit test for the FPGA Region");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -52,44 +52,23 @@
|
||||
__local_unlock_irqrestore(lock, flags)
|
||||
|
||||
/**
|
||||
* localtry_lock_init - Runtime initialize a lock instance
|
||||
* local_lock_init - Runtime initialize a lock instance
|
||||
*/
|
||||
#define localtry_lock_init(lock) __localtry_lock_init(lock)
|
||||
#define local_trylock_init(lock) __local_trylock_init(lock)
|
||||
|
||||
/**
|
||||
* localtry_lock - Acquire a per CPU local lock
|
||||
* @lock: The lock variable
|
||||
*/
|
||||
#define localtry_lock(lock) __localtry_lock(lock)
|
||||
|
||||
/**
|
||||
* localtry_lock_irq - Acquire a per CPU local lock and disable interrupts
|
||||
* @lock: The lock variable
|
||||
*/
|
||||
#define localtry_lock_irq(lock) __localtry_lock_irq(lock)
|
||||
|
||||
/**
|
||||
* localtry_lock_irqsave - Acquire a per CPU local lock, save and disable
|
||||
* interrupts
|
||||
* @lock: The lock variable
|
||||
* @flags: Storage for interrupt flags
|
||||
*/
|
||||
#define localtry_lock_irqsave(lock, flags) \
|
||||
__localtry_lock_irqsave(lock, flags)
|
||||
|
||||
/**
|
||||
* localtry_trylock - Try to acquire a per CPU local lock.
|
||||
* local_trylock - Try to acquire a per CPU local lock
|
||||
* @lock: The lock variable
|
||||
*
|
||||
* The function can be used in any context such as NMI or HARDIRQ. Due to
|
||||
* locking constrains it will _always_ fail to acquire the lock in NMI or
|
||||
* HARDIRQ context on PREEMPT_RT.
|
||||
*/
|
||||
#define localtry_trylock(lock) __localtry_trylock(lock)
|
||||
#define local_trylock(lock) __local_trylock(lock)
|
||||
|
||||
/**
|
||||
* localtry_trylock_irqsave - Try to acquire a per CPU local lock, save and disable
|
||||
* interrupts if acquired
|
||||
* local_trylock_irqsave - Try to acquire a per CPU local lock, save and disable
|
||||
* interrupts if acquired
|
||||
* @lock: The lock variable
|
||||
* @flags: Storage for interrupt flags
|
||||
*
|
||||
@@ -97,29 +76,8 @@
|
||||
* locking constrains it will _always_ fail to acquire the lock in NMI or
|
||||
* HARDIRQ context on PREEMPT_RT.
|
||||
*/
|
||||
#define localtry_trylock_irqsave(lock, flags) \
|
||||
__localtry_trylock_irqsave(lock, flags)
|
||||
|
||||
/**
|
||||
* local_unlock - Release a per CPU local lock
|
||||
* @lock: The lock variable
|
||||
*/
|
||||
#define localtry_unlock(lock) __localtry_unlock(lock)
|
||||
|
||||
/**
|
||||
* local_unlock_irq - Release a per CPU local lock and enable interrupts
|
||||
* @lock: The lock variable
|
||||
*/
|
||||
#define localtry_unlock_irq(lock) __localtry_unlock_irq(lock)
|
||||
|
||||
/**
|
||||
* localtry_unlock_irqrestore - Release a per CPU local lock and restore
|
||||
* interrupt flags
|
||||
* @lock: The lock variable
|
||||
* @flags: Interrupt flags to restore
|
||||
*/
|
||||
#define localtry_unlock_irqrestore(lock, flags) \
|
||||
__localtry_unlock_irqrestore(lock, flags)
|
||||
#define local_trylock_irqsave(lock, flags) \
|
||||
__local_trylock_irqsave(lock, flags)
|
||||
|
||||
DEFINE_GUARD(local_lock, local_lock_t __percpu*,
|
||||
local_lock(_T),
|
||||
|
||||
@@ -15,10 +15,11 @@ typedef struct {
|
||||
#endif
|
||||
} local_lock_t;
|
||||
|
||||
/* local_trylock() and local_trylock_irqsave() only work with local_trylock_t */
|
||||
typedef struct {
|
||||
local_lock_t llock;
|
||||
unsigned int acquired;
|
||||
} localtry_lock_t;
|
||||
u8 acquired;
|
||||
} local_trylock_t;
|
||||
|
||||
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
||||
# define LOCAL_LOCK_DEBUG_INIT(lockname) \
|
||||
@@ -29,6 +30,9 @@ typedef struct {
|
||||
}, \
|
||||
.owner = NULL,
|
||||
|
||||
# define LOCAL_TRYLOCK_DEBUG_INIT(lockname) \
|
||||
.llock = { LOCAL_LOCK_DEBUG_INIT((lockname).llock) },
|
||||
|
||||
static inline void local_lock_acquire(local_lock_t *l)
|
||||
{
|
||||
lock_map_acquire(&l->dep_map);
|
||||
@@ -56,6 +60,7 @@ static inline void local_lock_debug_init(local_lock_t *l)
|
||||
}
|
||||
#else /* CONFIG_DEBUG_LOCK_ALLOC */
|
||||
# define LOCAL_LOCK_DEBUG_INIT(lockname)
|
||||
# define LOCAL_TRYLOCK_DEBUG_INIT(lockname)
|
||||
static inline void local_lock_acquire(local_lock_t *l) { }
|
||||
static inline void local_trylock_acquire(local_lock_t *l) { }
|
||||
static inline void local_lock_release(local_lock_t *l) { }
|
||||
@@ -63,7 +68,7 @@ static inline void local_lock_debug_init(local_lock_t *l) { }
|
||||
#endif /* !CONFIG_DEBUG_LOCK_ALLOC */
|
||||
|
||||
#define INIT_LOCAL_LOCK(lockname) { LOCAL_LOCK_DEBUG_INIT(lockname) }
|
||||
#define INIT_LOCALTRY_LOCK(lockname) { .llock = { LOCAL_LOCK_DEBUG_INIT(lockname.llock) }}
|
||||
#define INIT_LOCAL_TRYLOCK(lockname) { LOCAL_TRYLOCK_DEBUG_INIT(lockname) }
|
||||
|
||||
#define __local_lock_init(lock) \
|
||||
do { \
|
||||
@@ -76,6 +81,8 @@ do { \
|
||||
local_lock_debug_init(lock); \
|
||||
} while (0)
|
||||
|
||||
#define __local_trylock_init(lock) __local_lock_init(lock.llock)
|
||||
|
||||
#define __spinlock_nested_bh_init(lock) \
|
||||
do { \
|
||||
static struct lock_class_key __key; \
|
||||
@@ -87,39 +94,105 @@ do { \
|
||||
local_lock_debug_init(lock); \
|
||||
} while (0)
|
||||
|
||||
#define __local_lock_acquire(lock) \
|
||||
do { \
|
||||
local_trylock_t *tl; \
|
||||
local_lock_t *l; \
|
||||
\
|
||||
l = (local_lock_t *)this_cpu_ptr(lock); \
|
||||
tl = (local_trylock_t *)l; \
|
||||
_Generic((lock), \
|
||||
local_trylock_t *: ({ \
|
||||
lockdep_assert(tl->acquired == 0); \
|
||||
WRITE_ONCE(tl->acquired, 1); \
|
||||
}), \
|
||||
default:(void)0); \
|
||||
local_lock_acquire(l); \
|
||||
} while (0)
|
||||
|
||||
#define __local_lock(lock) \
|
||||
do { \
|
||||
preempt_disable(); \
|
||||
local_lock_acquire(this_cpu_ptr(lock)); \
|
||||
__local_lock_acquire(lock); \
|
||||
} while (0)
|
||||
|
||||
#define __local_lock_irq(lock) \
|
||||
do { \
|
||||
local_irq_disable(); \
|
||||
local_lock_acquire(this_cpu_ptr(lock)); \
|
||||
__local_lock_acquire(lock); \
|
||||
} while (0)
|
||||
|
||||
#define __local_lock_irqsave(lock, flags) \
|
||||
do { \
|
||||
local_irq_save(flags); \
|
||||
local_lock_acquire(this_cpu_ptr(lock)); \
|
||||
__local_lock_acquire(lock); \
|
||||
} while (0)
|
||||
|
||||
#define __local_trylock(lock) \
|
||||
({ \
|
||||
local_trylock_t *tl; \
|
||||
\
|
||||
preempt_disable(); \
|
||||
tl = this_cpu_ptr(lock); \
|
||||
if (READ_ONCE(tl->acquired)) { \
|
||||
preempt_enable(); \
|
||||
tl = NULL; \
|
||||
} else { \
|
||||
WRITE_ONCE(tl->acquired, 1); \
|
||||
local_trylock_acquire( \
|
||||
(local_lock_t *)tl); \
|
||||
} \
|
||||
!!tl; \
|
||||
})
|
||||
|
||||
#define __local_trylock_irqsave(lock, flags) \
|
||||
({ \
|
||||
local_trylock_t *tl; \
|
||||
\
|
||||
local_irq_save(flags); \
|
||||
tl = this_cpu_ptr(lock); \
|
||||
if (READ_ONCE(tl->acquired)) { \
|
||||
local_irq_restore(flags); \
|
||||
tl = NULL; \
|
||||
} else { \
|
||||
WRITE_ONCE(tl->acquired, 1); \
|
||||
local_trylock_acquire( \
|
||||
(local_lock_t *)tl); \
|
||||
} \
|
||||
!!tl; \
|
||||
})
|
||||
|
||||
#define __local_lock_release(lock) \
|
||||
do { \
|
||||
local_trylock_t *tl; \
|
||||
local_lock_t *l; \
|
||||
\
|
||||
l = (local_lock_t *)this_cpu_ptr(lock); \
|
||||
tl = (local_trylock_t *)l; \
|
||||
local_lock_release(l); \
|
||||
_Generic((lock), \
|
||||
local_trylock_t *: ({ \
|
||||
lockdep_assert(tl->acquired == 1); \
|
||||
WRITE_ONCE(tl->acquired, 0); \
|
||||
}), \
|
||||
default:(void)0); \
|
||||
} while (0)
|
||||
|
||||
#define __local_unlock(lock) \
|
||||
do { \
|
||||
local_lock_release(this_cpu_ptr(lock)); \
|
||||
__local_lock_release(lock); \
|
||||
preempt_enable(); \
|
||||
} while (0)
|
||||
|
||||
#define __local_unlock_irq(lock) \
|
||||
do { \
|
||||
local_lock_release(this_cpu_ptr(lock)); \
|
||||
__local_lock_release(lock); \
|
||||
local_irq_enable(); \
|
||||
} while (0)
|
||||
|
||||
#define __local_unlock_irqrestore(lock, flags) \
|
||||
do { \
|
||||
local_lock_release(this_cpu_ptr(lock)); \
|
||||
__local_lock_release(lock); \
|
||||
local_irq_restore(flags); \
|
||||
} while (0)
|
||||
|
||||
@@ -132,104 +205,6 @@ do { \
|
||||
#define __local_unlock_nested_bh(lock) \
|
||||
local_lock_release(this_cpu_ptr(lock))
|
||||
|
||||
/* localtry_lock_t variants */
|
||||
|
||||
#define __localtry_lock_init(lock) \
|
||||
do { \
|
||||
__local_lock_init(&(lock)->llock); \
|
||||
WRITE_ONCE((lock)->acquired, 0); \
|
||||
} while (0)
|
||||
|
||||
#define __localtry_lock(lock) \
|
||||
do { \
|
||||
localtry_lock_t *lt; \
|
||||
preempt_disable(); \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
local_lock_acquire(<->llock); \
|
||||
WRITE_ONCE(lt->acquired, 1); \
|
||||
} while (0)
|
||||
|
||||
#define __localtry_lock_irq(lock) \
|
||||
do { \
|
||||
localtry_lock_t *lt; \
|
||||
local_irq_disable(); \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
local_lock_acquire(<->llock); \
|
||||
WRITE_ONCE(lt->acquired, 1); \
|
||||
} while (0)
|
||||
|
||||
#define __localtry_lock_irqsave(lock, flags) \
|
||||
do { \
|
||||
localtry_lock_t *lt; \
|
||||
local_irq_save(flags); \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
local_lock_acquire(<->llock); \
|
||||
WRITE_ONCE(lt->acquired, 1); \
|
||||
} while (0)
|
||||
|
||||
#define __localtry_trylock(lock) \
|
||||
({ \
|
||||
localtry_lock_t *lt; \
|
||||
bool _ret; \
|
||||
\
|
||||
preempt_disable(); \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
if (!READ_ONCE(lt->acquired)) { \
|
||||
WRITE_ONCE(lt->acquired, 1); \
|
||||
local_trylock_acquire(<->llock); \
|
||||
_ret = true; \
|
||||
} else { \
|
||||
_ret = false; \
|
||||
preempt_enable(); \
|
||||
} \
|
||||
_ret; \
|
||||
})
|
||||
|
||||
#define __localtry_trylock_irqsave(lock, flags) \
|
||||
({ \
|
||||
localtry_lock_t *lt; \
|
||||
bool _ret; \
|
||||
\
|
||||
local_irq_save(flags); \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
if (!READ_ONCE(lt->acquired)) { \
|
||||
WRITE_ONCE(lt->acquired, 1); \
|
||||
local_trylock_acquire(<->llock); \
|
||||
_ret = true; \
|
||||
} else { \
|
||||
_ret = false; \
|
||||
local_irq_restore(flags); \
|
||||
} \
|
||||
_ret; \
|
||||
})
|
||||
|
||||
#define __localtry_unlock(lock) \
|
||||
do { \
|
||||
localtry_lock_t *lt; \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
WRITE_ONCE(lt->acquired, 0); \
|
||||
local_lock_release(<->llock); \
|
||||
preempt_enable(); \
|
||||
} while (0)
|
||||
|
||||
#define __localtry_unlock_irq(lock) \
|
||||
do { \
|
||||
localtry_lock_t *lt; \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
WRITE_ONCE(lt->acquired, 0); \
|
||||
local_lock_release(<->llock); \
|
||||
local_irq_enable(); \
|
||||
} while (0)
|
||||
|
||||
#define __localtry_unlock_irqrestore(lock, flags) \
|
||||
do { \
|
||||
localtry_lock_t *lt; \
|
||||
lt = this_cpu_ptr(lock); \
|
||||
WRITE_ONCE(lt->acquired, 0); \
|
||||
local_lock_release(<->llock); \
|
||||
local_irq_restore(flags); \
|
||||
} while (0)
|
||||
|
||||
#else /* !CONFIG_PREEMPT_RT */
|
||||
|
||||
/*
|
||||
@@ -237,16 +212,18 @@ do { \
|
||||
* critical section while staying preemptible.
|
||||
*/
|
||||
typedef spinlock_t local_lock_t;
|
||||
typedef spinlock_t localtry_lock_t;
|
||||
typedef spinlock_t local_trylock_t;
|
||||
|
||||
#define INIT_LOCAL_LOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
|
||||
#define INIT_LOCALTRY_LOCK(lockname) INIT_LOCAL_LOCK(lockname)
|
||||
#define INIT_LOCAL_TRYLOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
|
||||
|
||||
#define __local_lock_init(l) \
|
||||
do { \
|
||||
local_spin_lock_init((l)); \
|
||||
} while (0)
|
||||
|
||||
#define __local_trylock_init(l) __local_lock_init(l)
|
||||
|
||||
#define __local_lock(__lock) \
|
||||
do { \
|
||||
migrate_disable(); \
|
||||
@@ -283,17 +260,7 @@ do { \
|
||||
spin_unlock(this_cpu_ptr((lock))); \
|
||||
} while (0)
|
||||
|
||||
/* localtry_lock_t variants */
|
||||
|
||||
#define __localtry_lock_init(lock) __local_lock_init(lock)
|
||||
#define __localtry_lock(lock) __local_lock(lock)
|
||||
#define __localtry_lock_irq(lock) __local_lock(lock)
|
||||
#define __localtry_lock_irqsave(lock, flags) __local_lock_irqsave(lock, flags)
|
||||
#define __localtry_unlock(lock) __local_unlock(lock)
|
||||
#define __localtry_unlock_irq(lock) __local_unlock(lock)
|
||||
#define __localtry_unlock_irqrestore(lock, flags) __local_unlock_irqrestore(lock, flags)
|
||||
|
||||
#define __localtry_trylock(lock) \
|
||||
#define __local_trylock(lock) \
|
||||
({ \
|
||||
int __locked; \
|
||||
\
|
||||
@@ -308,11 +275,11 @@ do { \
|
||||
__locked; \
|
||||
})
|
||||
|
||||
#define __localtry_trylock_irqsave(lock, flags) \
|
||||
#define __local_trylock_irqsave(lock, flags) \
|
||||
({ \
|
||||
typecheck(unsigned long, flags); \
|
||||
flags = 0; \
|
||||
__localtry_trylock(lock); \
|
||||
__local_trylock(lock); \
|
||||
})
|
||||
|
||||
#endif /* CONFIG_PREEMPT_RT */
|
||||
|
||||
@@ -1511,8 +1511,9 @@ static inline void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
|
||||
|
||||
/*
|
||||
* track_pfn_copy is called when a VM_PFNMAP VMA is about to get the page
|
||||
* tables copied during copy_page_range(). On success, stores the pfn to be
|
||||
* passed to untrack_pfn_copy().
|
||||
* tables copied during copy_page_range(). Will store the pfn to be
|
||||
* passed to untrack_pfn_copy() only if there is something to be untracked.
|
||||
* Callers should initialize the pfn to 0.
|
||||
*/
|
||||
static inline int track_pfn_copy(struct vm_area_struct *dst_vma,
|
||||
struct vm_area_struct *src_vma, unsigned long *pfn)
|
||||
@@ -1522,7 +1523,9 @@ static inline int track_pfn_copy(struct vm_area_struct *dst_vma,
|
||||
|
||||
/*
|
||||
* untrack_pfn_copy is called when a VM_PFNMAP VMA failed to copy during
|
||||
* copy_page_range(), but after track_pfn_copy() was already called.
|
||||
* copy_page_range(), but after track_pfn_copy() was already called. Can
|
||||
* be called even if track_pfn_copy() did not actually track anything:
|
||||
* handled internally.
|
||||
*/
|
||||
static inline void untrack_pfn_copy(struct vm_area_struct *dst_vma,
|
||||
unsigned long pfn)
|
||||
|
||||
+12
-3
@@ -422,11 +422,20 @@ static int vm_module_tags_populate(void)
|
||||
unsigned long old_shadow_end = ALIGN(phys_end, MODULE_ALIGN);
|
||||
unsigned long new_shadow_end = ALIGN(new_end, MODULE_ALIGN);
|
||||
unsigned long more_pages;
|
||||
unsigned long nr;
|
||||
unsigned long nr = 0;
|
||||
|
||||
more_pages = ALIGN(new_end - phys_end, PAGE_SIZE) >> PAGE_SHIFT;
|
||||
nr = alloc_pages_bulk_node(GFP_KERNEL | __GFP_NOWARN,
|
||||
NUMA_NO_NODE, more_pages, next_page);
|
||||
while (nr < more_pages) {
|
||||
unsigned long allocated;
|
||||
|
||||
allocated = alloc_pages_bulk_node(GFP_KERNEL | __GFP_NOWARN,
|
||||
NUMA_NO_NODE, more_pages - nr, next_page + nr);
|
||||
|
||||
if (!allocated)
|
||||
break;
|
||||
nr += allocated;
|
||||
}
|
||||
|
||||
if (nr < more_pages ||
|
||||
vmap_pages_range(phys_end, phys_end + (nr << PAGE_SHIFT), PAGE_KERNEL,
|
||||
next_page, PAGE_SHIFT) < 0) {
|
||||
|
||||
@@ -518,4 +518,5 @@ error:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asn1_ber_decoder);
|
||||
|
||||
MODULE_DESCRIPTION("Decoder for ASN.1 BER/DER/CER encoded bytestream");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
+1
-1
@@ -1191,7 +1191,7 @@ static ssize_t __iov_iter_get_pages_alloc(struct iov_iter *i,
|
||||
return -ENOMEM;
|
||||
p = *pages;
|
||||
for (int k = 0; k < n; k++) {
|
||||
struct folio *folio = page_folio(page);
|
||||
struct folio *folio = page_folio(page + k);
|
||||
p[k] = page + k;
|
||||
if (!folio_test_slab(folio))
|
||||
folio_get(folio);
|
||||
|
||||
@@ -325,4 +325,5 @@ static struct kunit_suite test_suite = {
|
||||
};
|
||||
kunit_test_suite(test_suite);
|
||||
|
||||
MODULE_DESCRIPTION("Kunit tests for slub allocator");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -165,4 +165,5 @@ ucs2_as_utf8(u8 *dest, const ucs2_char_t *src, unsigned long maxlength)
|
||||
}
|
||||
EXPORT_SYMBOL(ucs2_as_utf8);
|
||||
|
||||
MODULE_DESCRIPTION("UCS2 string handling");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -18,4 +18,5 @@ EXPORT_SYMBOL(zlib_inflateEnd);
|
||||
EXPORT_SYMBOL(zlib_inflateReset);
|
||||
EXPORT_SYMBOL(zlib_inflateIncomp);
|
||||
EXPORT_SYMBOL(zlib_inflate_blob);
|
||||
MODULE_DESCRIPTION("Data decompression using the deflation algorithm");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
struct cma cma_areas[MAX_CMA_AREAS];
|
||||
unsigned int cma_area_count;
|
||||
|
||||
static int __init __cma_declare_contiguous_nid(phys_addr_t base,
|
||||
static int __init __cma_declare_contiguous_nid(phys_addr_t *basep,
|
||||
phys_addr_t size, phys_addr_t limit,
|
||||
phys_addr_t alignment, unsigned int order_per_bit,
|
||||
bool fixed, const char *name, struct cma **res_cma,
|
||||
@@ -370,7 +370,7 @@ int __init cma_declare_contiguous_multi(phys_addr_t total_size,
|
||||
phys_addr_t align, unsigned int order_per_bit,
|
||||
const char *name, struct cma **res_cma, int nid)
|
||||
{
|
||||
phys_addr_t start, end;
|
||||
phys_addr_t start = 0, end;
|
||||
phys_addr_t size, sizesum, sizeleft;
|
||||
struct cma_init_memrange *mrp, *mlp, *failed;
|
||||
struct cma_memrange *cmrp;
|
||||
@@ -384,7 +384,7 @@ int __init cma_declare_contiguous_multi(phys_addr_t total_size,
|
||||
/*
|
||||
* First, try it the normal way, producing just one range.
|
||||
*/
|
||||
ret = __cma_declare_contiguous_nid(0, total_size, 0, align,
|
||||
ret = __cma_declare_contiguous_nid(&start, total_size, 0, align,
|
||||
order_per_bit, false, name, res_cma, nid);
|
||||
if (ret != -ENOMEM)
|
||||
goto out;
|
||||
@@ -580,7 +580,7 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = __cma_declare_contiguous_nid(base, size, limit, alignment,
|
||||
ret = __cma_declare_contiguous_nid(&base, size, limit, alignment,
|
||||
order_per_bit, fixed, name, res_cma, nid);
|
||||
if (ret != 0)
|
||||
pr_err("Failed to reserve %ld MiB\n",
|
||||
@@ -592,14 +592,14 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __init __cma_declare_contiguous_nid(phys_addr_t base,
|
||||
static int __init __cma_declare_contiguous_nid(phys_addr_t *basep,
|
||||
phys_addr_t size, phys_addr_t limit,
|
||||
phys_addr_t alignment, unsigned int order_per_bit,
|
||||
bool fixed, const char *name, struct cma **res_cma,
|
||||
int nid)
|
||||
{
|
||||
phys_addr_t memblock_end = memblock_end_of_DRAM();
|
||||
phys_addr_t highmem_start;
|
||||
phys_addr_t highmem_start, base = *basep;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
@@ -722,12 +722,15 @@ static int __init __cma_declare_contiguous_nid(phys_addr_t base,
|
||||
}
|
||||
|
||||
ret = cma_init_reserved_mem(base, size, order_per_bit, name, res_cma);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
memblock_phys_free(base, size);
|
||||
return ret;
|
||||
}
|
||||
|
||||
(*res_cma)->nid = nid;
|
||||
*basep = base;
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void cma_debug_show_areas(struct cma *cma)
|
||||
|
||||
+3
-3
@@ -981,13 +981,13 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
|
||||
}
|
||||
|
||||
if (PageHuge(page)) {
|
||||
const unsigned int order = compound_order(page);
|
||||
/*
|
||||
* skip hugetlbfs if we are not compacting for pages
|
||||
* bigger than its order. THPs and other compound pages
|
||||
* are handled below.
|
||||
*/
|
||||
if (!cc->alloc_contig) {
|
||||
const unsigned int order = compound_order(page);
|
||||
|
||||
if (order <= MAX_PAGE_ORDER) {
|
||||
low_pfn += (1UL << order) - 1;
|
||||
@@ -1011,8 +1011,8 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
|
||||
/* Do not report -EBUSY down the chain */
|
||||
if (ret == -EBUSY)
|
||||
ret = 0;
|
||||
low_pfn += compound_nr(page) - 1;
|
||||
nr_scanned += compound_nr(page) - 1;
|
||||
low_pfn += (1UL << order) - 1;
|
||||
nr_scanned += (1UL << order) - 1;
|
||||
goto isolate_fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -2244,6 +2244,7 @@ unsigned filemap_get_folios_contig(struct address_space *mapping,
|
||||
*start = folio->index + nr;
|
||||
goto out;
|
||||
}
|
||||
xas_advance(&xas, folio_next_index(folio) - 1);
|
||||
continue;
|
||||
put_folio:
|
||||
folio_put(folio);
|
||||
|
||||
+20
-3
@@ -2271,7 +2271,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h,
|
||||
* as surplus_pages, otherwise it might confuse
|
||||
* persistent_huge_pages() momentarily.
|
||||
*/
|
||||
__prep_account_new_huge_page(h, nid);
|
||||
__prep_account_new_huge_page(h, folio_nid(folio));
|
||||
|
||||
/*
|
||||
* We could have raced with the pool size change.
|
||||
@@ -3825,6 +3825,7 @@ found:
|
||||
static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid,
|
||||
nodemask_t *nodes_allowed)
|
||||
{
|
||||
unsigned long persistent_free_count;
|
||||
unsigned long min_count;
|
||||
unsigned long allocated;
|
||||
struct folio *folio;
|
||||
@@ -3959,8 +3960,24 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid,
|
||||
* though, we'll note that we're not allowed to exceed surplus
|
||||
* and won't grow the pool anywhere else. Not until one of the
|
||||
* sysctls are changed, or the surplus pages go out of use.
|
||||
*
|
||||
* min_count is the expected number of persistent pages, we
|
||||
* shouldn't calculate min_count by using
|
||||
* resv_huge_pages + persistent_huge_pages() - free_huge_pages,
|
||||
* because there may exist free surplus huge pages, and this will
|
||||
* lead to subtracting twice. Free surplus huge pages come from HVO
|
||||
* failing to restore vmemmap, see comments in the callers of
|
||||
* hugetlb_vmemmap_restore_folio(). Thus, we should calculate
|
||||
* persistent free count first.
|
||||
*/
|
||||
min_count = h->resv_huge_pages + h->nr_huge_pages - h->free_huge_pages;
|
||||
persistent_free_count = h->free_huge_pages;
|
||||
if (h->free_huge_pages > persistent_huge_pages(h)) {
|
||||
if (h->free_huge_pages > h->surplus_huge_pages)
|
||||
persistent_free_count -= h->surplus_huge_pages;
|
||||
else
|
||||
persistent_free_count = 0;
|
||||
}
|
||||
min_count = h->resv_huge_pages + persistent_huge_pages(h) - persistent_free_count;
|
||||
min_count = max(count, min_count);
|
||||
try_to_free_low(h, min_count, nodes_allowed);
|
||||
|
||||
@@ -4630,7 +4647,7 @@ static void __init hugetlb_sysfs_init(void)
|
||||
err = hugetlb_sysfs_add_hstate(h, hugepages_kobj,
|
||||
hstate_kobjs, &hstate_attr_group);
|
||||
if (err)
|
||||
pr_err("HugeTLB: Unable to add hstate %s", h->name);
|
||||
pr_err("HugeTLB: Unable to add hstate %s\n", h->name);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
|
||||
@@ -2127,4 +2127,5 @@ static struct kunit_suite kasan_kunit_test_suite = {
|
||||
|
||||
kunit_test_suite(kasan_kunit_test_suite);
|
||||
|
||||
MODULE_DESCRIPTION("KUnit tests for checking KASAN bug-detection capabilities");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user