Skip to content

Commit 4a51c60

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "8 patches. Subsystems affected by this patch series: mm (madvise, pagemap, readahead, memcg, userfaultfd), kbuild, and vfs" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: mm: fix madvise WILLNEED performance problem libfs: fix error cast of negative value in simple_attr_write() mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault() mm: memcg/slab: fix root memcg vmstats mm: fix readahead_page_batch for retry entries mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports compiler-clang: remove version check for BPF Tracing mm/madvise: fix memory leak from process_madvise
2 parents d27637e + 6638380 commit 4a51c60

16 files changed

Lines changed: 75 additions & 49 deletions

File tree

arch/ia64/include/asm/sparsemem.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@
1818
#endif
1919

2020
#endif /* CONFIG_SPARSEMEM */
21+
22+
#ifdef CONFIG_MEMORY_HOTPLUG
23+
int memory_add_physaddr_to_nid(u64 addr);
24+
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
25+
#endif
26+
2127
#endif /* _ASM_IA64_SPARSEMEM_H */

arch/powerpc/include/asm/mmzone.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,10 @@ u64 memory_hotplug_max(void);
4646
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
4747
#endif
4848

49+
#ifdef CONFIG_MEMORY_HOTPLUG
50+
extern int create_section_mapping(unsigned long start, unsigned long end,
51+
int nid, pgprot_t prot);
52+
#endif
53+
4954
#endif /* __KERNEL__ */
5055
#endif /* _ASM_MMZONE_H_ */

arch/powerpc/include/asm/sparsemem.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#endif /* CONFIG_SPARSEMEM */
1414

1515
#ifdef CONFIG_MEMORY_HOTPLUG
16-
extern int create_section_mapping(unsigned long start, unsigned long end,
17-
int nid, pgprot_t prot);
1816
extern int remove_section_mapping(unsigned long start, unsigned long end);
17+
extern int memory_add_physaddr_to_nid(u64 start);
18+
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
1919

2020
#ifdef CONFIG_NUMA
2121
extern int hot_add_scn_to_nid(unsigned long scn_addr);
@@ -26,6 +26,5 @@ static inline int hot_add_scn_to_nid(unsigned long scn_addr)
2626
}
2727
#endif /* CONFIG_NUMA */
2828
#endif /* CONFIG_MEMORY_HOTPLUG */
29-
3029
#endif /* __KERNEL__ */
3130
#endif /* _ASM_POWERPC_SPARSEMEM_H */

arch/powerpc/mm/mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <asm/rtas.h>
5151
#include <asm/kasan.h>
5252
#include <asm/svm.h>
53+
#include <asm/mmzone.h>
5354

5455
#include <mm/mmu_decl.h>
5556

arch/x86/include/asm/sparsemem.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,14 @@
2828
#endif
2929

3030
#endif /* CONFIG_SPARSEMEM */
31+
32+
#ifndef __ASSEMBLY__
33+
#ifdef CONFIG_NUMA_KEEP_MEMINFO
34+
extern int phys_to_target_node(phys_addr_t start);
35+
#define phys_to_target_node phys_to_target_node
36+
extern int memory_add_physaddr_to_nid(u64 start);
37+
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
38+
#endif
39+
#endif /* __ASSEMBLY__ */
40+
3141
#endif /* _ASM_X86_SPARSEMEM_H */

arch/x86/mm/numa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ int phys_to_target_node(phys_addr_t start)
938938

939939
return meminfo_to_nid(&numa_reserved_meminfo, start);
940940
}
941+
EXPORT_SYMBOL_GPL(phys_to_target_node);
941942

942943
int memory_add_physaddr_to_nid(u64 start)
943944
{
@@ -947,4 +948,5 @@ int memory_add_physaddr_to_nid(u64 start)
947948
nid = numa_meminfo.blk[0].nid;
948949
return nid;
949950
}
951+
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
950952
#endif

drivers/dax/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ config DEV_DAX_HMEM
5050
Say M if unsure.
5151

5252
config DEV_DAX_HMEM_DEVICES
53-
depends on NUMA_KEEP_MEMINFO # for phys_to_target_node()
5453
depends on DEV_DAX_HMEM && DAX=y
5554
def_bool y
5655

fs/libfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
959959
size_t len, loff_t *ppos)
960960
{
961961
struct simple_attr *attr;
962-
u64 val;
962+
unsigned long long val;
963963
size_t size;
964964
ssize_t ret;
965965

@@ -977,7 +977,9 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
977977
goto out;
978978

979979
attr->set_buf[size] = '\0';
980-
val = simple_strtoll(attr->set_buf, NULL, 0);
980+
ret = kstrtoull(attr->set_buf, 0, &val);
981+
if (ret)
982+
goto out;
981983
ret = attr->set(attr->data, val);
982984
if (ret == 0)
983985
ret = len; /* on success, claim we got the whole input */

include/linux/compiler-clang.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
+ __clang_patchlevel__)
99

1010
#if CLANG_VERSION < 100001
11+
#ifndef __BPF_TRACING__
1112
# error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
1213
#endif
14+
#endif
1315

1416
/* Compiler specific definitions for Clang compiler */
1517

include/linux/memory_hotplug.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,6 @@ static inline bool movable_node_is_enabled(void)
281281
}
282282
#endif /* ! CONFIG_MEMORY_HOTPLUG */
283283

284-
#ifdef CONFIG_NUMA
285-
extern int memory_add_physaddr_to_nid(u64 start);
286-
extern int phys_to_target_node(u64 start);
287-
#else
288-
static inline int memory_add_physaddr_to_nid(u64 start)
289-
{
290-
return 0;
291-
}
292-
static inline int phys_to_target_node(u64 start)
293-
{
294-
return 0;
295-
}
296-
#endif
297-
298284
#if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_DEFERRED_STRUCT_PAGE_INIT)
299285
/*
300286
* pgdat resizing functions

0 commit comments

Comments
 (0)