diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-30 21:44:44 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-30 21:44:44 -0500 |
| commit | aa2e7100e38880db7907cb2b7ec6267b2b243771 (patch) | |
| tree | 67f9d2479365398c07833d3fc4f794861f7da5b1 /include/linux | |
| parent | 2def2ef2ae5f3990aabdbe8a755911902707d268 (diff) | |
| parent | 7c094fd698de2f333fa39b6da213f880d40b9bfe (diff) | |
Merge branch 'akpm' (patches from Andrew Morton)
Merge misc fixes from Andrew Morton:
"A few hotfixes and various leftovers which were awaiting other merges.
Mainly movement of zram into mm/"
* emailed patches fron Andrew Morton <akpm@linux-foundation.org>: (25 commits)
memcg: fix mutex not unlocked on memcg_create_kmem_cache fail path
Documentation/filesystems/vfs.txt: update file_operations documentation
mm, oom: base root bonus on current usage
mm: don't lose the SOFT_DIRTY flag on mprotect
mm/slub.c: fix page->_count corruption (again)
mm/mempolicy.c: fix mempolicy printing in numa_maps
zram: remove zram->lock in read path and change it with mutex
zram: remove workqueue for freeing removed pending slot
zram: introduce zram->tb_lock
zram: use atomic operation for stat
zram: remove unnecessary free
zram: delay pending free request in read path
zram: fix race between reset and flushing pending work
zsmalloc: add maintainers
zram: add zram maintainers
zsmalloc: add copyright
zram: add copyright
zram: remove old private project comment
zram: promote zram from staging
zsmalloc: move it under mm
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 5 | ||||
| -rw-r--r-- | include/linux/bootmem.h | 4 | ||||
| -rw-r--r-- | include/linux/smp.h | 6 | ||||
| -rw-r--r-- | include/linux/zsmalloc.h | 51 |
4 files changed, 59 insertions, 7 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0375654adb28..8678c4322b44 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -95,10 +95,7 @@ enum rq_cmd_type_bits { | |||
| 95 | * as well! | 95 | * as well! |
| 96 | */ | 96 | */ |
| 97 | struct request { | 97 | struct request { |
| 98 | union { | 98 | struct list_head queuelist; |
| 99 | struct list_head queuelist; | ||
| 100 | struct llist_node ll_list; | ||
| 101 | }; | ||
| 102 | union { | 99 | union { |
| 103 | struct call_single_data csd; | 100 | struct call_single_data csd; |
| 104 | struct work_struct mq_flush_data; | 101 | struct work_struct mq_flush_data; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index b388223bd4a9..db51fe4fe317 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -264,7 +264,7 @@ static inline void * __init memblock_virt_alloc_low( | |||
| 264 | { | 264 | { |
| 265 | if (!align) | 265 | if (!align) |
| 266 | align = SMP_CACHE_BYTES; | 266 | align = SMP_CACHE_BYTES; |
| 267 | return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT); | 267 | return __alloc_bootmem_low(size, align, 0); |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | static inline void * __init memblock_virt_alloc_low_nopanic( | 270 | static inline void * __init memblock_virt_alloc_low_nopanic( |
| @@ -272,7 +272,7 @@ static inline void * __init memblock_virt_alloc_low_nopanic( | |||
| 272 | { | 272 | { |
| 273 | if (!align) | 273 | if (!align) |
| 274 | align = SMP_CACHE_BYTES; | 274 | align = SMP_CACHE_BYTES; |
| 275 | return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT); | 275 | return __alloc_bootmem_low_nopanic(size, align, 0); |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | static inline void * __init memblock_virt_alloc_from_nopanic( | 278 | static inline void * __init memblock_virt_alloc_from_nopanic( |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 5da22ee42e16..3834f43f9993 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -11,12 +11,16 @@ | |||
| 11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| 12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
| 13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| 14 | #include <linux/llist.h> | ||
| 14 | 15 | ||
| 15 | extern void cpu_idle(void); | 16 | extern void cpu_idle(void); |
| 16 | 17 | ||
| 17 | typedef void (*smp_call_func_t)(void *info); | 18 | typedef void (*smp_call_func_t)(void *info); |
| 18 | struct call_single_data { | 19 | struct call_single_data { |
| 19 | struct list_head list; | 20 | union { |
| 21 | struct list_head list; | ||
| 22 | struct llist_node llist; | ||
| 23 | }; | ||
| 20 | smp_call_func_t func; | 24 | smp_call_func_t func; |
| 21 | void *info; | 25 | void *info; |
| 22 | u16 flags; | 26 | u16 flags; |
diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h new file mode 100644 index 000000000000..e44d634e7fb7 --- /dev/null +++ b/include/linux/zsmalloc.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* | ||
| 2 | * zsmalloc memory allocator | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Nitin Gupta | ||
| 5 | * Copyright (C) 2012, 2013 Minchan Kim | ||
| 6 | * | ||
| 7 | * This code is released using a dual license strategy: BSD/GPL | ||
| 8 | * You can choose the license that better fits your requirements. | ||
| 9 | * | ||
| 10 | * Released under the terms of 3-clause BSD License | ||
| 11 | * Released under the terms of GNU General Public License Version 2.0 | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _ZS_MALLOC_H_ | ||
| 15 | #define _ZS_MALLOC_H_ | ||
| 16 | |||
| 17 | #include <linux/types.h> | ||
| 18 | |||
| 19 | /* | ||
| 20 | * zsmalloc mapping modes | ||
| 21 | * | ||
| 22 | * NOTE: These only make a difference when a mapped object spans pages. | ||
| 23 | * They also have no effect when PGTABLE_MAPPING is selected. | ||
| 24 | */ | ||
| 25 | enum zs_mapmode { | ||
| 26 | ZS_MM_RW, /* normal read-write mapping */ | ||
| 27 | ZS_MM_RO, /* read-only (no copy-out at unmap time) */ | ||
| 28 | ZS_MM_WO /* write-only (no copy-in at map time) */ | ||
| 29 | /* | ||
| 30 | * NOTE: ZS_MM_WO should only be used for initializing new | ||
| 31 | * (uninitialized) allocations. Partial writes to already | ||
| 32 | * initialized allocations should use ZS_MM_RW to preserve the | ||
| 33 | * existing data. | ||
| 34 | */ | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct zs_pool; | ||
| 38 | |||
| 39 | struct zs_pool *zs_create_pool(gfp_t flags); | ||
| 40 | void zs_destroy_pool(struct zs_pool *pool); | ||
| 41 | |||
| 42 | unsigned long zs_malloc(struct zs_pool *pool, size_t size); | ||
| 43 | void zs_free(struct zs_pool *pool, unsigned long obj); | ||
| 44 | |||
| 45 | void *zs_map_object(struct zs_pool *pool, unsigned long handle, | ||
| 46 | enum zs_mapmode mm); | ||
| 47 | void zs_unmap_object(struct zs_pool *pool, unsigned long handle); | ||
| 48 | |||
| 49 | u64 zs_get_total_size_bytes(struct zs_pool *pool); | ||
| 50 | |||
| 51 | #endif | ||
