mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "13 fixes" * emailed patches from Andrew Morton <[email protected]>: memcg: disable hierarchy support if bound to the legacy cgroup hierarchy mm: reorder can_do_mlock to fix audit denial kasan, module: move MODULE_ALIGN macro into <linux/moduleloader.h> kasan, module, vmalloc: rework shadow allocation for modules fanotify: fix event filtering with FAN_ONDIR set mm/nommu.c: export symbol max_mapnr arch/c6x/include/asm/pgtable.h: define dummy pgprot_writecombine for !MMU nilfs2: fix deadlock of segment constructor during recovery mm: cma: fix CMA aligned offset calculation mm, hugetlb: close race when setting PageTail for gigantic pages mm, oom: do not fail __GFP_NOFAIL allocation if oom killer is disabled drivers/rtc/rtc-s3c.c: add .needs_src_clk to s3c6410 RTC data ocfs2: make append_dio an incompat feature
This commit is contained in:
commit
c202baf017
18 changed files with 63 additions and 33 deletions
12
mm/cma.c
12
mm/cma.c
|
|
@ -64,15 +64,17 @@ static unsigned long cma_bitmap_aligned_mask(struct cma *cma, int align_order)
|
|||
return (1UL << (align_order - cma->order_per_bit)) - 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a PFN aligned to the specified order and return an offset represented in
|
||||
* order_per_bits.
|
||||
*/
|
||||
static unsigned long cma_bitmap_aligned_offset(struct cma *cma, int align_order)
|
||||
{
|
||||
unsigned int alignment;
|
||||
|
||||
if (align_order <= cma->order_per_bit)
|
||||
return 0;
|
||||
alignment = 1UL << (align_order - cma->order_per_bit);
|
||||
return ALIGN(cma->base_pfn, alignment) -
|
||||
(cma->base_pfn >> cma->order_per_bit);
|
||||
|
||||
return (ALIGN(cma->base_pfn, (1UL << align_order))
|
||||
- cma->base_pfn) >> cma->order_per_bit;
|
||||
}
|
||||
|
||||
static unsigned long cma_bitmap_maxno(struct cma *cma)
|
||||
|
|
|
|||
|
|
@ -917,7 +917,6 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order)
|
|||
__SetPageHead(page);
|
||||
__ClearPageReserved(page);
|
||||
for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
|
||||
__SetPageTail(p);
|
||||
/*
|
||||
* For gigantic hugepages allocated through bootmem at
|
||||
* boot, it's safer to be consistent with the not-gigantic
|
||||
|
|
@ -933,6 +932,9 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order)
|
|||
__ClearPageReserved(p);
|
||||
set_page_count(p, 0);
|
||||
p->first_page = page;
|
||||
/* Make sure p->first_page is always valid for PageTail() */
|
||||
smp_wmb();
|
||||
__SetPageTail(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/stacktrace.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/kasan.h>
|
||||
|
||||
#include "kasan.h"
|
||||
|
|
@ -414,12 +415,19 @@ int kasan_module_alloc(void *addr, size_t size)
|
|||
GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO,
|
||||
PAGE_KERNEL, VM_NO_GUARD, NUMA_NO_NODE,
|
||||
__builtin_return_address(0));
|
||||
return ret ? 0 : -ENOMEM;
|
||||
|
||||
if (ret) {
|
||||
find_vm_area(addr)->flags |= VM_KASAN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
void kasan_module_free(void *addr)
|
||||
void kasan_free_shadow(const struct vm_struct *vm)
|
||||
{
|
||||
vfree(kasan_mem_to_shadow(addr));
|
||||
if (vm->flags & VM_KASAN)
|
||||
vfree(kasan_mem_to_shadow(vm->addr));
|
||||
}
|
||||
|
||||
static void register_global(struct kasan_global *global)
|
||||
|
|
|
|||
|
|
@ -5232,7 +5232,9 @@ static void mem_cgroup_bind(struct cgroup_subsys_state *root_css)
|
|||
* on for the root memcg is enough.
|
||||
*/
|
||||
if (cgroup_on_dfl(root_css->cgroup))
|
||||
mem_cgroup_from_css(root_css)->use_hierarchy = true;
|
||||
root_mem_cgroup->use_hierarchy = true;
|
||||
else
|
||||
root_mem_cgroup->use_hierarchy = false;
|
||||
}
|
||||
|
||||
static u64 memory_current_read(struct cgroup_subsys_state *css,
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@
|
|||
|
||||
int can_do_mlock(void)
|
||||
{
|
||||
if (capable(CAP_IPC_LOCK))
|
||||
return 1;
|
||||
if (rlimit(RLIMIT_MEMLOCK) != 0)
|
||||
return 1;
|
||||
if (capable(CAP_IPC_LOCK))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(can_do_mlock);
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ void *high_memory;
|
|||
EXPORT_SYMBOL(high_memory);
|
||||
struct page *mem_map;
|
||||
unsigned long max_mapnr;
|
||||
EXPORT_SYMBOL(max_mapnr);
|
||||
unsigned long highest_memmap_pfn;
|
||||
struct percpu_counter vm_committed_as;
|
||||
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
|
||||
|
|
|
|||
|
|
@ -2373,7 +2373,8 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
|
|||
goto out;
|
||||
}
|
||||
/* Exhausted what can be done so it's blamo time */
|
||||
if (out_of_memory(ac->zonelist, gfp_mask, order, ac->nodemask, false))
|
||||
if (out_of_memory(ac->zonelist, gfp_mask, order, ac->nodemask, false)
|
||||
|| WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL))
|
||||
*did_some_progress = 1;
|
||||
out:
|
||||
oom_zonelist_unlock(ac->zonelist, gfp_mask);
|
||||
|
|
|
|||
|
|
@ -1418,6 +1418,7 @@ struct vm_struct *remove_vm_area(const void *addr)
|
|||
spin_unlock(&vmap_area_lock);
|
||||
|
||||
vmap_debug_free_range(va->va_start, va->va_end);
|
||||
kasan_free_shadow(vm);
|
||||
free_unmap_vmap_area(va);
|
||||
vm->size -= PAGE_SIZE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue