Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: - a few misc things - a few Y2038 fixes - ntfs fixes - arch/sh tweaks - ocfs2 updates - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (111 commits) mm/hmm.c: remove unused variables align_start and align_end fs/userfaultfd.c: remove redundant pointer uwq mm, vmacache: hash addresses based on pmd mm/list_lru: introduce list_lru_shrink_walk_irq() mm/list_lru.c: pass struct list_lru_node* as an argument to __list_lru_walk_one() mm/list_lru.c: move locking from __list_lru_walk_one() to its caller mm/list_lru.c: use list_lru_walk_one() in list_lru_walk_node() mm, swap: make CONFIG_THP_SWAP depend on CONFIG_SWAP mm/sparse: delete old sparse_init and enable new one mm/sparse: add new sparse_init_nid() and sparse_init() mm/sparse: move buffer init/fini to the common place mm/sparse: use the new sparse buffer functions in non-vmemmap mm/sparse: abstract sparse buffer allocations mm/hugetlb.c: don't zero 1GiB bootmem pages mm, page_alloc: double zone's batchsize mm/oom_kill.c: document oom_lock mm/hugetlb: remove gigantic page support for HIGHMEM mm, oom: remove sleep from under oom_lock kernel/dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous() mm/cma: remove unsupported gfp_mask parameter from cma_alloc() ...
This commit is contained in:
@@ -178,7 +178,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
|
||||
* @dev: Pointer to device for which the allocation is performed.
|
||||
* @count: Requested number of pages.
|
||||
* @align: Requested alignment of pages (in PAGE_SIZE order).
|
||||
* @gfp_mask: GFP flags to use for this allocation.
|
||||
* @no_warn: Avoid printing message about failed allocation.
|
||||
*
|
||||
* This function allocates memory buffer for specified device. It uses
|
||||
* device specific contiguous memory area if available or the default
|
||||
@@ -186,12 +186,12 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
|
||||
* function.
|
||||
*/
|
||||
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
|
||||
unsigned int align, gfp_t gfp_mask)
|
||||
unsigned int align, bool no_warn)
|
||||
{
|
||||
if (align > CONFIG_CMA_ALIGNMENT)
|
||||
align = CONFIG_CMA_ALIGNMENT;
|
||||
|
||||
return cma_alloc(dev_get_cma_area(dev), count, align, gfp_mask);
|
||||
return cma_alloc(dev_get_cma_area(dev), count, align, no_warn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -78,7 +78,8 @@ void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
|
||||
again:
|
||||
/* CMA can be used only in the context which permits sleeping */
|
||||
if (gfpflags_allow_blocking(gfp)) {
|
||||
page = dma_alloc_from_contiguous(dev, count, page_order, gfp);
|
||||
page = dma_alloc_from_contiguous(dev, count, page_order,
|
||||
gfp & __GFP_NOWARN);
|
||||
if (page && !dma_coherent_ok(dev, page_to_phys(page), size)) {
|
||||
dma_release_from_contiguous(dev, page, count);
|
||||
page = NULL;
|
||||
|
@@ -871,6 +871,9 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
|
||||
tsk->use_memdelay = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MEMCG
|
||||
tsk->active_memcg = NULL;
|
||||
#endif
|
||||
return tsk;
|
||||
|
||||
free_stack:
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/pfn_t.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kasan.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/memory_hotplug.h>
|
||||
#include <linux/swap.h>
|
||||
@@ -137,6 +138,7 @@ static void devm_memremap_pages_release(void *data)
|
||||
mem_hotplug_begin();
|
||||
arch_remove_memory(align_start, align_size, pgmap->altmap_valid ?
|
||||
&pgmap->altmap : NULL);
|
||||
kasan_remove_zero_shadow(__va(align_start), align_size);
|
||||
mem_hotplug_done();
|
||||
|
||||
untrack_pfn(NULL, PHYS_PFN(align_start), align_size);
|
||||
@@ -239,6 +241,12 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
|
||||
goto err_pfn_remap;
|
||||
|
||||
mem_hotplug_begin();
|
||||
error = kasan_add_zero_shadow(__va(align_start), align_size);
|
||||
if (error) {
|
||||
mem_hotplug_done();
|
||||
goto err_kasan;
|
||||
}
|
||||
|
||||
error = arch_add_memory(nid, align_start, align_size, altmap, false);
|
||||
if (!error)
|
||||
move_pfn_range_to_zone(&NODE_DATA(nid)->node_zones[ZONE_DEVICE],
|
||||
@@ -267,6 +275,8 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
|
||||
return __va(res->start);
|
||||
|
||||
err_add_memory:
|
||||
kasan_remove_zero_shadow(__va(align_start), align_size);
|
||||
err_kasan:
|
||||
untrack_pfn(NULL, PHYS_PFN(align_start), align_size);
|
||||
err_pfn_remap:
|
||||
err_radix:
|
||||
|
Reference in New Issue
Block a user