Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
Merge fixes from Andrew Morton:
 "6 fixes"

* emailed patches from Andrew Morton <[email protected]>:
  drivers core: remove assert_held_device_hotplug()
  mm: add private lock to serialize memory hotplug operations
  mm: don't warn when vmalloc() fails due to a fatal signal
  mm, x86: fix native_pud_clear build error
  kasan: add a prototype of task_struct to avoid warning
  z3fold: fix spinlock unlocking in page reclaim
  • Loading branch information
torvalds committed Mar 17, 2017
2 parents d11507e + 15c9e10 commit d528ae0
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 16 deletions.
3 changes: 0 additions & 3 deletions arch/x86/include/asm/pgtable-3level.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,9 @@ static inline void native_pmd_clear(pmd_t *pmd)
*(tmp + 1) = 0;
}

#if !defined(CONFIG_SMP) || (defined(CONFIG_HIGHMEM64G) && \
defined(CONFIG_PARAVIRT))
static inline void native_pud_clear(pud_t *pudp)
{
}
#endif

static inline void pud_clear(pud_t *pudp)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
# define set_pud(pudp, pud) native_set_pud(pudp, pud)
#endif

#ifndef __PAGETABLE_PMD_FOLDED
#ifndef __PAGETABLE_PUD_FOLDED
#define pud_clear(pud) native_pud_clear(pud)
#endif

Expand Down
5 changes: 0 additions & 5 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,6 @@ int lock_device_hotplug_sysfs(void)
return restart_syscall();
}

void assert_held_device_hotplug(void)
{
lockdep_assert_held(&device_hotplug_lock);
}

#ifdef CONFIG_BLOCK
static inline int device_is_not_partition(struct device *dev)
{
Expand Down
1 change: 0 additions & 1 deletion include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,6 @@ static inline bool device_supports_offline(struct device *dev)
extern void lock_device_hotplug(void);
extern void unlock_device_hotplug(void);
extern int lock_device_hotplug_sysfs(void);
void assert_held_device_hotplug(void);
extern int device_offline(struct device *dev);
extern int device_online(struct device *dev);
extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
Expand Down
1 change: 1 addition & 0 deletions include/linux/kasan.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
struct kmem_cache;
struct page;
struct vm_struct;
struct task_struct;

#ifdef CONFIG_KASAN

Expand Down
4 changes: 0 additions & 4 deletions kernel/memremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,9 @@ static void devm_memremap_pages_release(struct device *dev, void *data)
align_start = res->start & ~(SECTION_SIZE - 1);
align_size = ALIGN(resource_size(res), SECTION_SIZE);

lock_device_hotplug();
mem_hotplug_begin();
arch_remove_memory(align_start, align_size);
mem_hotplug_done();
unlock_device_hotplug();

untrack_pfn(NULL, PHYS_PFN(align_start), align_size);
pgmap_radix_release(res);
Expand Down Expand Up @@ -364,11 +362,9 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
if (error)
goto err_pfn_remap;

lock_device_hotplug();
mem_hotplug_begin();
error = arch_add_memory(nid, align_start, align_size, true);
mem_hotplug_done();
unlock_device_hotplug();
if (error)
goto err_add_memory;

Expand Down
6 changes: 5 additions & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ void put_online_mems(void)

}

/* Serializes write accesses to mem_hotplug.active_writer. */
static DEFINE_MUTEX(memory_add_remove_lock);

void mem_hotplug_begin(void)
{
assert_held_device_hotplug();
mutex_lock(&memory_add_remove_lock);

mem_hotplug.active_writer = current;

Expand All @@ -147,6 +150,7 @@ void mem_hotplug_done(void)
mem_hotplug.active_writer = NULL;
mutex_unlock(&mem_hotplug.lock);
memhp_lock_release();
mutex_unlock(&memory_add_remove_lock);
}

/* add this memory to iomem resource */
Expand Down
3 changes: 2 additions & 1 deletion mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,

if (fatal_signal_pending(current)) {
area->nr_pages = i;
goto fail;
goto fail_no_warn;
}

if (node == NUMA_NO_NODE)
Expand All @@ -1709,6 +1709,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
warn_alloc(gfp_mask, NULL,
"vmalloc: allocation failure, allocated %ld of %ld bytes",
(area->nr_pages*PAGE_SIZE), area->size);
fail_no_warn:
vfree(area->addr);
return NULL;
}
Expand Down
1 change: 1 addition & 0 deletions mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
z3fold_page_unlock(zhdr);
spin_lock(&pool->lock);
if (kref_put(&zhdr->refcount, release_z3fold_page)) {
spin_unlock(&pool->lock);
atomic64_dec(&pool->pages_nr);
return 0;
}
Expand Down

0 comments on commit d528ae0

Please sign in to comment.