Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Sep 5, 2020
2 parents 9322c47 + 428fc0a commit 7514c03
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 67 deletions.
32 changes: 16 additions & 16 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,6 @@ F: arch/arm/mach-cns3xxx/

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

CAVIUM I2C DRIVER
M: Robert Richter <[email protected]>
S: Supported
M: Robert Richter <[email protected]>
S: Odd Fixes
W: http://www.marvell.com
F: drivers/i2c/busses/i2c-octeon*
F: drivers/i2c/busses/i2c-thunderx*
Expand All @@ -3964,8 +3963,8 @@ W: http://www.marvell.com
F: drivers/net/ethernet/cavium/liquidio/

CAVIUM MMC DRIVER
M: Robert Richter <[email protected]>
S: Supported
M: Robert Richter <[email protected]>
S: Odd Fixes
W: http://www.marvell.com
F: drivers/mmc/host/cavium*

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

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

Expand Down Expand Up @@ -4258,6 +4257,8 @@ S: Maintained
F: .clang-format

CLANG/LLVM BUILD SUPPORT
M: Nathan Chancellor <[email protected]>
M: Nick Desaulniers <[email protected]>
L: [email protected]
S: Supported
W: https://clangbuiltlinux.github.io/
Expand Down Expand Up @@ -6191,24 +6192,23 @@ F: drivers/edac/highbank*

EDAC-CAVIUM OCTEON
M: Ralf Baechle <[email protected]>
M: Robert Richter <[email protected]>
L: [email protected]
L: [email protected]
S: Supported
F: drivers/edac/octeon_edac*

EDAC-CAVIUM THUNDERX
M: Robert Richter <[email protected]>
M: Robert Richter <[email protected]>
L: [email protected]
S: Supported
S: Odd Fixes
F: drivers/edac/thunderx_edac*

EDAC-CORE
M: Borislav Petkov <[email protected]>
M: Mauro Carvalho Chehab <[email protected]>
M: Tony Luck <[email protected]>
R: James Morse <[email protected]>
R: Robert Richter <[email protected]>
R: Robert Richter <[email protected]>
L: [email protected]
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
Expand Down Expand Up @@ -8272,7 +8272,7 @@ IA64 (Itanium) PLATFORM
M: Tony Luck <[email protected]>
M: Fenghua Yu <[email protected]>
L: [email protected]
S: Maintained
S: Odd Fixes
T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git
F: Documentation/ia64/
F: arch/ia64/
Expand Down Expand Up @@ -13446,10 +13446,10 @@ F: Documentation/devicetree/bindings/pci/axis,artpec*
F: drivers/pci/controller/dwc/*artpec*

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

PCIE DRIVER FOR HISILICON
Expand Down Expand Up @@ -17237,8 +17237,8 @@ S: Maintained
F: drivers/net/thunderbolt.c

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

TI AM437X VPFE DRIVER
Expand Down
2 changes: 1 addition & 1 deletion include/linux/log2.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
#define roundup_pow_of_two(n) \
( \
__builtin_constant_p(n) ? ( \
(n == 1) ? 1 : \
((n) == 1) ? 1 : \
(1UL << (ilog2((n) - 1) + 1)) \
) : \
__roundup_pow_of_two(n) \
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int proc_ipc_auto_msgmni(struct ctl_table *table, int write,
}

static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
void *buffer, size_t *lenp, loff_t *ppos)
{
int ret, semmni;
struct ipc_namespace *ns = current->nsproxy->ipc_ns;
Expand Down
2 changes: 1 addition & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,7 @@ int unshare_files(struct files_struct **displaced)
}

int sysctl_max_threads(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
void *buffer, size_t *lenp, loff_t *ppos)
{
struct ctl_table t;
int ret;
Expand Down
49 changes: 37 additions & 12 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,21 +1250,32 @@ static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask,
int nid, nodemask_t *nodemask)
{
unsigned long nr_pages = 1UL << huge_page_order(h);
if (nid == NUMA_NO_NODE)
nid = numa_mem_id();

#ifdef CONFIG_CMA
{
struct page *page;
int node;

for_each_node_mask(node, *nodemask) {
if (!hugetlb_cma[node])
continue;

page = cma_alloc(hugetlb_cma[node], nr_pages,
huge_page_order(h), true);
if (hugetlb_cma[nid]) {
page = cma_alloc(hugetlb_cma[nid], nr_pages,
huge_page_order(h), true);
if (page)
return page;
}

if (!(gfp_mask & __GFP_THISNODE)) {
for_each_node_mask(node, *nodemask) {
if (node == nid || !hugetlb_cma[node])
continue;

page = cma_alloc(hugetlb_cma[node], nr_pages,
huge_page_order(h), true);
if (page)
return page;
}
}
}
#endif

Expand Down Expand Up @@ -3454,6 +3465,22 @@ static unsigned int allowed_mems_nr(struct hstate *h)
}

#ifdef CONFIG_SYSCTL
static int proc_hugetlb_doulongvec_minmax(struct ctl_table *table, int write,
void *buffer, size_t *length,
loff_t *ppos, unsigned long *out)
{
struct ctl_table dup_table;

/*
* In order to avoid races with __do_proc_doulongvec_minmax(), we
* can duplicate the @table and alter the duplicate of it.
*/
dup_table = *table;
dup_table.data = out;

return proc_doulongvec_minmax(&dup_table, write, buffer, length, ppos);
}

static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
struct ctl_table *table, int write,
void *buffer, size_t *length, loff_t *ppos)
Expand All @@ -3465,9 +3492,8 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
if (!hugepages_supported())
return -EOPNOTSUPP;

table->data = &tmp;
table->maxlen = sizeof(unsigned long);
ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
ret = proc_hugetlb_doulongvec_minmax(table, write, buffer, length, ppos,
&tmp);
if (ret)
goto out;

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

table->data = &tmp;
table->maxlen = sizeof(unsigned long);
ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
ret = proc_hugetlb_doulongvec_minmax(table, write, buffer, length, ppos,
&tmp);
if (ret)
goto out;

Expand Down
2 changes: 1 addition & 1 deletion mm/khugepaged.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ static void collapse_file(struct mm_struct *mm,
xas_unlock_irq(&xas);
page_cache_sync_readahead(mapping, &file->f_ra,
file, index,
PAGE_SIZE);
end - index);
/* drain pagevecs to help isolate_lru_page() */
lru_add_drain();
page = find_lock_page(mapping, index);
Expand Down
2 changes: 1 addition & 1 deletion mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ static long madvise_willneed(struct vm_area_struct *vma,
*/
*prev = NULL; /* tell sys_madvise we drop mmap_lock */
get_file(file);
mmap_read_unlock(current->mm);
offset = (loff_t)(start - vma->vm_start)
+ ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
mmap_read_unlock(current->mm);
vfs_fadvise(file, offset, end - start, POSIX_FADV_WILLNEED);
fput(file);
mmap_read_lock(current->mm);
Expand Down
6 changes: 6 additions & 0 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -6774,6 +6774,9 @@ static void uncharge_batch(const struct uncharge_gather *ug)
__this_cpu_add(ug->memcg->vmstats_percpu->nr_page_events, ug->nr_pages);
memcg_check_events(ug->memcg, ug->dummy_page);
local_irq_restore(flags);

/* drop reference from uncharge_page */
css_put(&ug->memcg->css);
}

static void uncharge_page(struct page *page, struct uncharge_gather *ug)
Expand All @@ -6797,6 +6800,9 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug)
uncharge_gather_clear(ug);
}
ug->memcg = page->mem_cgroup;

/* pairs with css_put in uncharge_batch */
css_get(&ug->memcg->css);
}

nr_pages = compound_nr(page);
Expand Down
Loading

0 comments on commit 7514c03

Please sign in to comment.