Skip to content

Commit 7514c03

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "19 patches. Subsystems affected by this patch series: MAINTAINERS, ipc, fork, checkpatch, lib, and mm (memcg, slub, pagemap, madvise, migration, hugetlb)" * emailed patches from Andrew Morton <[email protected]>: include/linux/log2.h: add missing () around n in roundup_pow_of_two() mm/khugepaged.c: fix khugepaged's request size in collapse_file mm/hugetlb: fix a race between hugetlb sysctl handlers mm/hugetlb: try preferred node first when alloc gigantic page from cma mm/migrate: preserve soft dirty in remove_migration_pte() mm/migrate: remove unnecessary is_zone_device_page() check mm/rmap: fixup copying of soft dirty and uffd ptes mm/migrate: fixup setting UFFD_WP flag mm: madvise: fix vma user-after-free checkpatch: fix the usage of capture group ( ... ) fork: adjust sysctl_max_threads definition to match prototype ipc: adjust proc_ipc_sem_dointvec definition to match prototype mm: track page table modifications in __apply_to_page_range() MAINTAINERS: IA64: mark Status as Odd Fixes only MAINTAINERS: add LLVM maintainers MAINTAINERS: update Cavium/Marvell entries mm: slub: fix conversion of freelist_corrupted() mm: memcg: fix memcg reclaim soft lockup memcg: fix use-after-free in uncharge_batch
2 parents 9322c47 + 428fc0a commit 7514c03

File tree

14 files changed

+129
-67
lines changed

14 files changed

+129
-67
lines changed

MAINTAINERS

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,6 @@ F: arch/arm/mach-cns3xxx/
16941694

16951695
ARM/CAVIUM THUNDER NETWORK DRIVER
16961696
M: Sunil Goutham <[email protected]>
1697-
M: Robert Richter <[email protected]>
16981697
L: [email protected] (moderated for non-subscribers)
16991698
S: Supported
17001699
F: drivers/net/ethernet/cavium/thunder/
@@ -3948,8 +3947,8 @@ W: https://wireless.wiki.kernel.org/en/users/Drivers/carl9170
39483947
F: drivers/net/wireless/ath/carl9170/
39493948

39503949
CAVIUM I2C DRIVER
3951-
M: Robert Richter <[email protected]>
3952-
S: Supported
3950+
M: Robert Richter <[email protected]>
3951+
S: Odd Fixes
39533952
W: http://www.marvell.com
39543953
F: drivers/i2c/busses/i2c-octeon*
39553954
F: drivers/i2c/busses/i2c-thunderx*
@@ -3964,8 +3963,8 @@ W: http://www.marvell.com
39643963
F: drivers/net/ethernet/cavium/liquidio/
39653964

39663965
CAVIUM MMC DRIVER
3967-
M: Robert Richter <[email protected]>
3968-
S: Supported
3966+
M: Robert Richter <[email protected]>
3967+
S: Odd Fixes
39693968
W: http://www.marvell.com
39703969
F: drivers/mmc/host/cavium*
39713970

@@ -3977,9 +3976,9 @@ W: http://www.marvell.com
39773976
F: drivers/crypto/cavium/cpt/
39783977

39793978
CAVIUM THUNDERX2 ARM64 SOC
3980-
M: Robert Richter <[email protected]>
3979+
M: Robert Richter <[email protected]>
39813980
L: [email protected] (moderated for non-subscribers)
3982-
S: Maintained
3981+
S: Odd Fixes
39833982
F: Documentation/devicetree/bindings/arm/cavium-thunder2.txt
39843983
F: arch/arm64/boot/dts/cavium/thunder2-99xx*
39853984

@@ -4258,6 +4257,8 @@ S: Maintained
42584257
F: .clang-format
42594258

42604259
CLANG/LLVM BUILD SUPPORT
4260+
M: Nathan Chancellor <[email protected]>
4261+
M: Nick Desaulniers <[email protected]>
42614262
42624263
S: Supported
42634264
W: https://clangbuiltlinux.github.io/
@@ -6191,24 +6192,23 @@ F: drivers/edac/highbank*
61916192

61926193
EDAC-CAVIUM OCTEON
61936194
M: Ralf Baechle <[email protected]>
6194-
M: Robert Richter <[email protected]>
61956195
61966196
61976197
S: Supported
61986198
F: drivers/edac/octeon_edac*
61996199

62006200
EDAC-CAVIUM THUNDERX
6201-
M: Robert Richter <[email protected]>
6201+
M: Robert Richter <[email protected]>
62026202
6203-
S: Supported
6203+
S: Odd Fixes
62046204
F: drivers/edac/thunderx_edac*
62056205

62066206
EDAC-CORE
62076207
M: Borislav Petkov <[email protected]>
62086208
M: Mauro Carvalho Chehab <[email protected]>
62096209
M: Tony Luck <[email protected]>
62106210
R: James Morse <[email protected]>
6211-
R: Robert Richter <[email protected]>
6211+
R: Robert Richter <[email protected]>
62126212
62136213
S: Supported
62146214
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
@@ -8272,7 +8272,7 @@ IA64 (Itanium) PLATFORM
82728272
M: Tony Luck <[email protected]>
82738273
M: Fenghua Yu <[email protected]>
82748274
8275-
S: Maintained
8275+
S: Odd Fixes
82768276
T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git
82778277
F: Documentation/ia64/
82788278
F: arch/ia64/
@@ -13446,10 +13446,10 @@ F: Documentation/devicetree/bindings/pci/axis,artpec*
1344613446
F: drivers/pci/controller/dwc/*artpec*
1344713447

1344813448
PCIE DRIVER FOR CAVIUM THUNDERX
13449-
M: Robert Richter <[email protected]>
13449+
M: Robert Richter <[email protected]>
1345013450
1345113451
L: [email protected] (moderated for non-subscribers)
13452-
S: Supported
13452+
S: Odd Fixes
1345313453
F: drivers/pci/controller/pci-thunder-*
1345413454

1345513455
PCIE DRIVER FOR HISILICON
@@ -17237,8 +17237,8 @@ S: Maintained
1723717237
F: drivers/net/thunderbolt.c
1723817238

1723917239
THUNDERX GPIO DRIVER
17240-
M: Robert Richter <[email protected]>
17241-
S: Maintained
17240+
M: Robert Richter <[email protected]>
17241+
S: Odd Fixes
1724217242
F: drivers/gpio/gpio-thunderx.c
1724317243

1724417244
TI AM437X VPFE DRIVER

include/linux/log2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
173173
#define roundup_pow_of_two(n) \
174174
( \
175175
__builtin_constant_p(n) ? ( \
176-
(n == 1) ? 1 : \
176+
((n) == 1) ? 1 : \
177177
(1UL << (ilog2((n) - 1) + 1)) \
178178
) : \
179179
__roundup_pow_of_two(n) \

ipc/ipc_sysctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int proc_ipc_auto_msgmni(struct ctl_table *table, int write,
8585
}
8686

8787
static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
88-
void __user *buffer, size_t *lenp, loff_t *ppos)
88+
void *buffer, size_t *lenp, loff_t *ppos)
8989
{
9090
int ret, semmni;
9191
struct ipc_namespace *ns = current->nsproxy->ipc_ns;

kernel/fork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3014,7 +3014,7 @@ int unshare_files(struct files_struct **displaced)
30143014
}
30153015

30163016
int sysctl_max_threads(struct ctl_table *table, int write,
3017-
void __user *buffer, size_t *lenp, loff_t *ppos)
3017+
void *buffer, size_t *lenp, loff_t *ppos)
30183018
{
30193019
struct ctl_table t;
30203020
int ret;

mm/hugetlb.c

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,21 +1250,32 @@ static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask,
12501250
int nid, nodemask_t *nodemask)
12511251
{
12521252
unsigned long nr_pages = 1UL << huge_page_order(h);
1253+
if (nid == NUMA_NO_NODE)
1254+
nid = numa_mem_id();
12531255

12541256
#ifdef CONFIG_CMA
12551257
{
12561258
struct page *page;
12571259
int node;
12581260

1259-
for_each_node_mask(node, *nodemask) {
1260-
if (!hugetlb_cma[node])
1261-
continue;
1262-
1263-
page = cma_alloc(hugetlb_cma[node], nr_pages,
1264-
huge_page_order(h), true);
1261+
if (hugetlb_cma[nid]) {
1262+
page = cma_alloc(hugetlb_cma[nid], nr_pages,
1263+
huge_page_order(h), true);
12651264
if (page)
12661265
return page;
12671266
}
1267+
1268+
if (!(gfp_mask & __GFP_THISNODE)) {
1269+
for_each_node_mask(node, *nodemask) {
1270+
if (node == nid || !hugetlb_cma[node])
1271+
continue;
1272+
1273+
page = cma_alloc(hugetlb_cma[node], nr_pages,
1274+
huge_page_order(h), true);
1275+
if (page)
1276+
return page;
1277+
}
1278+
}
12681279
}
12691280
#endif
12701281

@@ -3454,6 +3465,22 @@ static unsigned int allowed_mems_nr(struct hstate *h)
34543465
}
34553466

34563467
#ifdef CONFIG_SYSCTL
3468+
static int proc_hugetlb_doulongvec_minmax(struct ctl_table *table, int write,
3469+
void *buffer, size_t *length,
3470+
loff_t *ppos, unsigned long *out)
3471+
{
3472+
struct ctl_table dup_table;
3473+
3474+
/*
3475+
* In order to avoid races with __do_proc_doulongvec_minmax(), we
3476+
* can duplicate the @table and alter the duplicate of it.
3477+
*/
3478+
dup_table = *table;
3479+
dup_table.data = out;
3480+
3481+
return proc_doulongvec_minmax(&dup_table, write, buffer, length, ppos);
3482+
}
3483+
34573484
static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
34583485
struct ctl_table *table, int write,
34593486
void *buffer, size_t *length, loff_t *ppos)
@@ -3465,9 +3492,8 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
34653492
if (!hugepages_supported())
34663493
return -EOPNOTSUPP;
34673494

3468-
table->data = &tmp;
3469-
table->maxlen = sizeof(unsigned long);
3470-
ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
3495+
ret = proc_hugetlb_doulongvec_minmax(table, write, buffer, length, ppos,
3496+
&tmp);
34713497
if (ret)
34723498
goto out;
34733499

@@ -3510,9 +3536,8 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
35103536
if (write && hstate_is_gigantic(h))
35113537
return -EINVAL;
35123538

3513-
table->data = &tmp;
3514-
table->maxlen = sizeof(unsigned long);
3515-
ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
3539+
ret = proc_hugetlb_doulongvec_minmax(table, write, buffer, length, ppos,
3540+
&tmp);
35163541
if (ret)
35173542
goto out;
35183543

mm/khugepaged.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ static void collapse_file(struct mm_struct *mm,
17091709
xas_unlock_irq(&xas);
17101710
page_cache_sync_readahead(mapping, &file->f_ra,
17111711
file, index,
1712-
PAGE_SIZE);
1712+
end - index);
17131713
/* drain pagevecs to help isolate_lru_page() */
17141714
lru_add_drain();
17151715
page = find_lock_page(mapping, index);

mm/madvise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ static long madvise_willneed(struct vm_area_struct *vma,
289289
*/
290290
*prev = NULL; /* tell sys_madvise we drop mmap_lock */
291291
get_file(file);
292-
mmap_read_unlock(current->mm);
293292
offset = (loff_t)(start - vma->vm_start)
294293
+ ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
294+
mmap_read_unlock(current->mm);
295295
vfs_fadvise(file, offset, end - start, POSIX_FADV_WILLNEED);
296296
fput(file);
297297
mmap_read_lock(current->mm);

mm/memcontrol.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6774,6 +6774,9 @@ static void uncharge_batch(const struct uncharge_gather *ug)
67746774
__this_cpu_add(ug->memcg->vmstats_percpu->nr_page_events, ug->nr_pages);
67756775
memcg_check_events(ug->memcg, ug->dummy_page);
67766776
local_irq_restore(flags);
6777+
6778+
/* drop reference from uncharge_page */
6779+
css_put(&ug->memcg->css);
67776780
}
67786781

67796782
static void uncharge_page(struct page *page, struct uncharge_gather *ug)
@@ -6797,6 +6800,9 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug)
67976800
uncharge_gather_clear(ug);
67986801
}
67996802
ug->memcg = page->mem_cgroup;
6803+
6804+
/* pairs with css_put in uncharge_batch */
6805+
css_get(&ug->memcg->css);
68006806
}
68016807

68026808
nr_pages = compound_nr(page);

0 commit comments

Comments
 (0)