Commit b3c03db6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "10 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  x86/mm: split vmalloc_sync_all()
  mm, slub: prevent kmalloc_node crashes and memory leaks
  mm/mmu_notifier: silence PROVE_RCU_LIST warnings
  epoll: fix possible lost wakeup on epoll_ctl() path
  mm: do not allow MADV_PAGEOUT for CoW pages
  mm, memcg: throttle allocators based on ancestral memory.high
  mm, memcg: fix corruption on 64-bit divisor in memory.high throttling
  page-flags: fix a crash at SetPageError(THP_SWAP)
  mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case
  memcg: fix NULL pointer dereference in __mem_cgroup_usage_unregister_event
parents b74b991f 763802b5
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
	return pmd_k;
}

void vmalloc_sync_all(void)
static void vmalloc_sync(void)
{
	unsigned long address;

@@ -217,6 +217,16 @@ void vmalloc_sync_all(void)
	}
}

void vmalloc_sync_mappings(void)
{
	vmalloc_sync();
}

void vmalloc_sync_unmappings(void)
{
	vmalloc_sync();
}

/*
 * 32-bit:
 *
@@ -319,11 +329,23 @@ out:

#else /* CONFIG_X86_64: */

void vmalloc_sync_all(void)
void vmalloc_sync_mappings(void)
{
	/*
	 * 64-bit mappings might allocate new p4d/pud pages
	 * that need to be propagated to all tasks' PGDs.
	 */
	sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END);
}

void vmalloc_sync_unmappings(void)
{
	/*
	 * Unmappings never allocate or free p4d/pud pages.
	 * No work is required here.
	 */
}

/*
 * 64-bit:
 *
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ int ghes_estatus_pool_init(int num_ghes)
	 * New allocation must be visible in all pgd before it can be found by
	 * an NMI allocating from the pool.
	 */
	vmalloc_sync_all();
	vmalloc_sync_mappings();

	rc = gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
	if (rc)
+4 −4
Original line number Diff line number Diff line
@@ -1854,9 +1854,9 @@ fetch_events:
		waiter = true;
		init_waitqueue_entry(&wait, current);

		spin_lock_irq(&ep->wq.lock);
		write_lock_irq(&ep->lock);
		__add_wait_queue_exclusive(&ep->wq, &wait);
		spin_unlock_irq(&ep->wq.lock);
		write_unlock_irq(&ep->lock);
	}

	for (;;) {
@@ -1904,9 +1904,9 @@ send_events:
		goto fetch_events;

	if (waiter) {
		spin_lock_irq(&ep->wq.lock);
		write_lock_irq(&ep->lock);
		__remove_wait_queue(&ep->wq, &wait);
		spin_unlock_irq(&ep->wq.lock);
		write_unlock_irq(&ep->lock);
	}

	return res;
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ static inline int TestClearPage##uname(struct page *page) { return 0; }

__PAGEFLAG(Locked, locked, PF_NO_TAIL)
PAGEFLAG(Waiters, waiters, PF_ONLY_HEAD) __CLEARPAGEFLAG(Waiters, waiters, PF_ONLY_HEAD)
PAGEFLAG(Error, error, PF_NO_COMPOUND) TESTCLEARFLAG(Error, error, PF_NO_COMPOUND)
PAGEFLAG(Error, error, PF_NO_TAIL) TESTCLEARFLAG(Error, error, PF_NO_TAIL)
PAGEFLAG(Referenced, referenced, PF_HEAD)
	TESTCLEARFLAG(Referenced, referenced, PF_HEAD)
	__SETPAGEFLAG(Referenced, referenced, PF_HEAD)
+3 −2
Original line number Diff line number Diff line
@@ -141,7 +141,8 @@ extern int remap_vmalloc_range_partial(struct vm_area_struct *vma,

extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
							unsigned long pgoff);
void vmalloc_sync_all(void);
void vmalloc_sync_mappings(void);
void vmalloc_sync_unmappings(void);

/*
 *	Lowlevel-APIs (not for driver use!)
Loading