aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 21:19:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 21:19:42 -0400
commit33e247c7e58d335d70ecb84fd869091e2e4b8dcb (patch)
treee8561e1993dff03f8e56d10a5795fe9d379a3390 /include
parentd71fc239b6915a8b750e9a447311029ff45b6580 (diff)
parent452e06af1f0149b01201f94264d452cd7a95db7a (diff)
Merge branch 'akpm' (patches from Andrew)
Merge third patch-bomb from Andrew Morton: - even more of the rest of MM - lib/ updates - checkpatch updates - small changes to a few scruffy filesystems - kmod fixes/cleanups - kexec updates - a dma-mapping cleanup series from hch * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (81 commits) dma-mapping: consolidate dma_set_mask dma-mapping: consolidate dma_supported dma-mapping: cosolidate dma_mapping_error dma-mapping: consolidate dma_{alloc,free}_noncoherent dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent} mm: use vma_is_anonymous() in create_huge_pmd() and wp_huge_pmd() mm: make sure all file VMAs have ->vm_ops set mm, mpx: add "vm_flags_t vm_flags" arg to do_mmap_pgoff() mm: mark most vm_operations_struct const namei: fix warning while make xmldocs caused by namei.c ipc: convert invalid scenarios to use WARN_ON zlib_deflate/deftree: remove bi_reverse() lib/decompress_unlzma: Do a NULL check for pointer lib/decompressors: use real out buf size for gunzip with kernel fs/affs: make root lookup from blkdev logical size sysctl: fix int -> unsigned long assignments in INT_MIN case kexec: export KERNEL_IMAGE_SIZE to vmcoreinfo kexec: align crash_notes allocation to make it be inside one physical page kexec: remove unnecessary test in kimage_alloc_crash_control_pages() kexec: split kexec_load syscall from kexec core code ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/dma-mapping-common.h118
-rw-r--r--include/linux/kexec.h17
-rw-r--r--include/linux/kmod.h2
-rw-r--r--include/linux/memcontrol.h10
-rw-r--r--include/linux/mm.h12
-rw-r--r--include/linux/mmu_notifier.h46
-rw-r--r--include/linux/page-flags.h11
-rw-r--r--include/linux/page_ext.h4
-rw-r--r--include/linux/page_idle.h110
-rw-r--r--include/linux/poison.h11
-rw-r--r--include/linux/printk.h14
-rw-r--r--include/linux/seq_file.h4
-rw-r--r--include/linux/string_helpers.h14
-rw-r--r--include/linux/zpool.h2
-rw-r--r--include/uapi/linux/kernel-page-flags.h1
15 files changed, 341 insertions, 35 deletions
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 940d5ec122c9..b1bc954eccf3 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -6,6 +6,7 @@
6#include <linux/scatterlist.h> 6#include <linux/scatterlist.h>
7#include <linux/dma-debug.h> 7#include <linux/dma-debug.h>
8#include <linux/dma-attrs.h> 8#include <linux/dma-attrs.h>
9#include <asm-generic/dma-coherent.h>
9 10
10static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, 11static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
11 size_t size, 12 size_t size,
@@ -237,4 +238,121 @@ dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr,
237 238
238#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, NULL) 239#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, NULL)
239 240
241#ifndef arch_dma_alloc_attrs
242#define arch_dma_alloc_attrs(dev, flag) (true)
243#endif
244
245static inline void *dma_alloc_attrs(struct device *dev, size_t size,
246 dma_addr_t *dma_handle, gfp_t flag,
247 struct dma_attrs *attrs)
248{
249 struct dma_map_ops *ops = get_dma_ops(dev);
250 void *cpu_addr;
251
252 BUG_ON(!ops);
253
254 if (dma_alloc_from_coherent(dev, size, dma_handle, &cpu_addr))
255 return cpu_addr;
256
257 if (!arch_dma_alloc_attrs(&dev, &flag))
258 return NULL;
259 if (!ops->alloc)
260 return NULL;
261
262 cpu_addr = ops->alloc(dev, size, dma_handle, flag, attrs);
263 debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr);
264 return cpu_addr;
265}
266
267static inline void dma_free_attrs(struct device *dev, size_t size,
268 void *cpu_addr, dma_addr_t dma_handle,
269 struct dma_attrs *attrs)
270{
271 struct dma_map_ops *ops = get_dma_ops(dev);
272
273 BUG_ON(!ops);
274 WARN_ON(irqs_disabled());
275
276 if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
277 return;
278
279 if (!ops->free)
280 return;
281
282 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
283 ops->free(dev, size, cpu_addr, dma_handle, attrs);
284}
285
286static inline void *dma_alloc_coherent(struct device *dev, size_t size,
287 dma_addr_t *dma_handle, gfp_t flag)
288{
289 return dma_alloc_attrs(dev, size, dma_handle, flag, NULL);
290}
291
292static inline void dma_free_coherent(struct device *dev, size_t size,
293 void *cpu_addr, dma_addr_t dma_handle)
294{
295 return dma_free_attrs(dev, size, cpu_addr, dma_handle, NULL);
296}
297
298static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
299 dma_addr_t *dma_handle, gfp_t gfp)
300{
301 DEFINE_DMA_ATTRS(attrs);
302
303 dma_set_attr(DMA_ATTR_NON_CONSISTENT, &attrs);
304 return dma_alloc_attrs(dev, size, dma_handle, gfp, &attrs);
305}
306
307static inline void dma_free_noncoherent(struct device *dev, size_t size,
308 void *cpu_addr, dma_addr_t dma_handle)
309{
310 DEFINE_DMA_ATTRS(attrs);
311
312 dma_set_attr(DMA_ATTR_NON_CONSISTENT, &attrs);
313 dma_free_attrs(dev, size, cpu_addr, dma_handle, &attrs);
314}
315
316static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
317{
318 debug_dma_mapping_error(dev, dma_addr);
319
320 if (get_dma_ops(dev)->mapping_error)
321 return get_dma_ops(dev)->mapping_error(dev, dma_addr);
322
323#ifdef DMA_ERROR_CODE
324 return dma_addr == DMA_ERROR_CODE;
325#else
326 return 0;
327#endif
328}
329
330#ifndef HAVE_ARCH_DMA_SUPPORTED
331static inline int dma_supported(struct device *dev, u64 mask)
332{
333 struct dma_map_ops *ops = get_dma_ops(dev);
334
335 if (!ops)
336 return 0;
337 if (!ops->dma_supported)
338 return 1;
339 return ops->dma_supported(dev, mask);
340}
341#endif
342
343#ifndef HAVE_ARCH_DMA_SET_MASK
344static inline int dma_set_mask(struct device *dev, u64 mask)
345{
346 struct dma_map_ops *ops = get_dma_ops(dev);
347
348 if (ops->set_dma_mask)
349 return ops->set_dma_mask(dev, mask);
350
351 if (!dev->dma_mask || !dma_supported(dev, mask))
352 return -EIO;
353 *dev->dma_mask = mask;
354 return 0;
355}
356#endif
357
240#endif 358#endif
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index b63218f68c4b..d140b1e9faa7 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -16,7 +16,7 @@
16 16
17#include <uapi/linux/kexec.h> 17#include <uapi/linux/kexec.h>
18 18
19#ifdef CONFIG_KEXEC 19#ifdef CONFIG_KEXEC_CORE
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/linkage.h> 21#include <linux/linkage.h>
22#include <linux/compat.h> 22#include <linux/compat.h>
@@ -318,13 +318,24 @@ int crash_shrink_memory(unsigned long new_size);
318size_t crash_get_memory_size(void); 318size_t crash_get_memory_size(void);
319void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); 319void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
320 320
321#else /* !CONFIG_KEXEC */ 321int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
322 unsigned long buf_len);
323void * __weak arch_kexec_kernel_image_load(struct kimage *image);
324int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);
325int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,
326 unsigned long buf_len);
327int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,
328 Elf_Shdr *sechdrs, unsigned int relsec);
329int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
330 unsigned int relsec);
331
332#else /* !CONFIG_KEXEC_CORE */
322struct pt_regs; 333struct pt_regs;
323struct task_struct; 334struct task_struct;
324static inline void crash_kexec(struct pt_regs *regs) { } 335static inline void crash_kexec(struct pt_regs *regs) { }
325static inline int kexec_should_crash(struct task_struct *p) { return 0; } 336static inline int kexec_should_crash(struct task_struct *p) { return 0; }
326#define kexec_in_progress false 337#define kexec_in_progress false
327#endif /* CONFIG_KEXEC */ 338#endif /* CONFIG_KEXEC_CORE */
328 339
329#endif /* !defined(__ASSEBMLY__) */ 340#endif /* !defined(__ASSEBMLY__) */
330 341
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 0555cc66a15b..fcfd2bf14d3f 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -85,8 +85,6 @@ enum umh_disable_depth {
85 UMH_DISABLED, 85 UMH_DISABLED,
86}; 86};
87 87
88extern void usermodehelper_init(void);
89
90extern int __usermodehelper_disable(enum umh_disable_depth depth); 88extern int __usermodehelper_disable(enum umh_disable_depth depth);
91extern void __usermodehelper_set_disable_depth(enum umh_disable_depth depth); 89extern void __usermodehelper_set_disable_depth(enum umh_disable_depth depth);
92 90
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index d92b80b63c5c..ad800e62cb7a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -305,11 +305,9 @@ struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *);
305struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *); 305struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *);
306 306
307bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg); 307bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg);
308
309struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
310struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 308struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
311
312struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); 309struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg);
310
313static inline 311static inline
314struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css){ 312struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css){
315 return css ? container_of(css, struct mem_cgroup, css) : NULL; 313 return css ? container_of(css, struct mem_cgroup, css) : NULL;
@@ -345,6 +343,7 @@ static inline bool mm_match_cgroup(struct mm_struct *mm,
345} 343}
346 344
347struct cgroup_subsys_state *mem_cgroup_css_from_page(struct page *page); 345struct cgroup_subsys_state *mem_cgroup_css_from_page(struct page *page);
346ino_t page_cgroup_ino(struct page *page);
348 347
349static inline bool mem_cgroup_disabled(void) 348static inline bool mem_cgroup_disabled(void)
350{ 349{
@@ -555,11 +554,6 @@ static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,
555 return &zone->lruvec; 554 return &zone->lruvec;
556} 555}
557 556
558static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
559{
560 return NULL;
561}
562
563static inline bool mm_match_cgroup(struct mm_struct *mm, 557static inline bool mm_match_cgroup(struct mm_struct *mm,
564 struct mem_cgroup *memcg) 558 struct mem_cgroup *memcg)
565{ 559{
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f25a957bf0ab..fda728e3c27d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1873,11 +1873,19 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo
1873 1873
1874extern unsigned long mmap_region(struct file *file, unsigned long addr, 1874extern unsigned long mmap_region(struct file *file, unsigned long addr,
1875 unsigned long len, vm_flags_t vm_flags, unsigned long pgoff); 1875 unsigned long len, vm_flags_t vm_flags, unsigned long pgoff);
1876extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, 1876extern unsigned long do_mmap(struct file *file, unsigned long addr,
1877 unsigned long len, unsigned long prot, unsigned long flags, 1877 unsigned long len, unsigned long prot, unsigned long flags,
1878 unsigned long pgoff, unsigned long *populate); 1878 vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate);
1879extern int do_munmap(struct mm_struct *, unsigned long, size_t); 1879extern int do_munmap(struct mm_struct *, unsigned long, size_t);
1880 1880
1881static inline unsigned long
1882do_mmap_pgoff(struct file *file, unsigned long addr,
1883 unsigned long len, unsigned long prot, unsigned long flags,
1884 unsigned long pgoff, unsigned long *populate)
1885{
1886 return do_mmap(file, addr, len, prot, flags, 0, pgoff, populate);
1887}
1888
1881#ifdef CONFIG_MMU 1889#ifdef CONFIG_MMU
1882extern int __mm_populate(unsigned long addr, unsigned long len, 1890extern int __mm_populate(unsigned long addr, unsigned long len,
1883 int ignore_errors); 1891 int ignore_errors);
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 61cd67f4d788..a1a210d59961 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -66,6 +66,16 @@ struct mmu_notifier_ops {
66 unsigned long end); 66 unsigned long end);
67 67
68 /* 68 /*
69 * clear_young is a lightweight version of clear_flush_young. Like the
70 * latter, it is supposed to test-and-clear the young/accessed bitflag
71 * in the secondary pte, but it may omit flushing the secondary tlb.
72 */
73 int (*clear_young)(struct mmu_notifier *mn,
74 struct mm_struct *mm,
75 unsigned long start,
76 unsigned long end);
77
78 /*
69 * test_young is called to check the young/accessed bitflag in 79 * test_young is called to check the young/accessed bitflag in
70 * the secondary pte. This is used to know if the page is 80 * the secondary pte. This is used to know if the page is
71 * frequently used without actually clearing the flag or tearing 81 * frequently used without actually clearing the flag or tearing
@@ -203,6 +213,9 @@ extern void __mmu_notifier_release(struct mm_struct *mm);
203extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, 213extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
204 unsigned long start, 214 unsigned long start,
205 unsigned long end); 215 unsigned long end);
216extern int __mmu_notifier_clear_young(struct mm_struct *mm,
217 unsigned long start,
218 unsigned long end);
206extern int __mmu_notifier_test_young(struct mm_struct *mm, 219extern int __mmu_notifier_test_young(struct mm_struct *mm,
207 unsigned long address); 220 unsigned long address);
208extern void __mmu_notifier_change_pte(struct mm_struct *mm, 221extern void __mmu_notifier_change_pte(struct mm_struct *mm,
@@ -231,6 +244,15 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm,
231 return 0; 244 return 0;
232} 245}
233 246
247static inline int mmu_notifier_clear_young(struct mm_struct *mm,
248 unsigned long start,
249 unsigned long end)
250{
251 if (mm_has_notifiers(mm))
252 return __mmu_notifier_clear_young(mm, start, end);
253 return 0;
254}
255
234static inline int mmu_notifier_test_young(struct mm_struct *mm, 256static inline int mmu_notifier_test_young(struct mm_struct *mm,
235 unsigned long address) 257 unsigned long address)
236{ 258{
@@ -311,6 +333,28 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
311 __young; \ 333 __young; \
312}) 334})
313 335
336#define ptep_clear_young_notify(__vma, __address, __ptep) \
337({ \
338 int __young; \
339 struct vm_area_struct *___vma = __vma; \
340 unsigned long ___address = __address; \
341 __young = ptep_test_and_clear_young(___vma, ___address, __ptep);\
342 __young |= mmu_notifier_clear_young(___vma->vm_mm, ___address, \
343 ___address + PAGE_SIZE); \
344 __young; \
345})
346
347#define pmdp_clear_young_notify(__vma, __address, __pmdp) \
348({ \
349 int __young; \
350 struct vm_area_struct *___vma = __vma; \
351 unsigned long ___address = __address; \
352 __young = pmdp_test_and_clear_young(___vma, ___address, __pmdp);\
353 __young |= mmu_notifier_clear_young(___vma->vm_mm, ___address, \
354 ___address + PMD_SIZE); \
355 __young; \
356})
357
314#define ptep_clear_flush_notify(__vma, __address, __ptep) \ 358#define ptep_clear_flush_notify(__vma, __address, __ptep) \
315({ \ 359({ \
316 unsigned long ___addr = __address & PAGE_MASK; \ 360 unsigned long ___addr = __address & PAGE_MASK; \
@@ -427,6 +471,8 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
427 471
428#define ptep_clear_flush_young_notify ptep_clear_flush_young 472#define ptep_clear_flush_young_notify ptep_clear_flush_young
429#define pmdp_clear_flush_young_notify pmdp_clear_flush_young 473#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
474#define ptep_clear_young_notify ptep_test_and_clear_young
475#define pmdp_clear_young_notify pmdp_test_and_clear_young
430#define ptep_clear_flush_notify ptep_clear_flush 476#define ptep_clear_flush_notify ptep_clear_flush
431#define pmdp_huge_clear_flush_notify pmdp_huge_clear_flush 477#define pmdp_huge_clear_flush_notify pmdp_huge_clear_flush
432#define pmdp_huge_get_and_clear_notify pmdp_huge_get_and_clear 478#define pmdp_huge_get_and_clear_notify pmdp_huge_get_and_clear
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 41c93844fb1d..416509e26d6d 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -109,6 +109,10 @@ enum pageflags {
109#ifdef CONFIG_TRANSPARENT_HUGEPAGE 109#ifdef CONFIG_TRANSPARENT_HUGEPAGE
110 PG_compound_lock, 110 PG_compound_lock,
111#endif 111#endif
112#if defined(CONFIG_IDLE_PAGE_TRACKING) && defined(CONFIG_64BIT)
113 PG_young,
114 PG_idle,
115#endif
112 __NR_PAGEFLAGS, 116 __NR_PAGEFLAGS,
113 117
114 /* Filesystems */ 118 /* Filesystems */
@@ -289,6 +293,13 @@ PAGEFLAG_FALSE(HWPoison)
289#define __PG_HWPOISON 0 293#define __PG_HWPOISON 0
290#endif 294#endif
291 295
296#if defined(CONFIG_IDLE_PAGE_TRACKING) && defined(CONFIG_64BIT)
297TESTPAGEFLAG(Young, young)
298SETPAGEFLAG(Young, young)
299TESTCLEARFLAG(Young, young)
300PAGEFLAG(Idle, idle)
301#endif
302
292/* 303/*
293 * On an anonymous page mapped into a user virtual memory area, 304 * On an anonymous page mapped into a user virtual memory area,
294 * page->mapping points to its anon_vma, not to a struct address_space; 305 * page->mapping points to its anon_vma, not to a struct address_space;
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
index c42981cd99aa..17f118a82854 100644
--- a/include/linux/page_ext.h
+++ b/include/linux/page_ext.h
@@ -26,6 +26,10 @@ enum page_ext_flags {
26 PAGE_EXT_DEBUG_POISON, /* Page is poisoned */ 26 PAGE_EXT_DEBUG_POISON, /* Page is poisoned */
27 PAGE_EXT_DEBUG_GUARD, 27 PAGE_EXT_DEBUG_GUARD,
28 PAGE_EXT_OWNER, 28 PAGE_EXT_OWNER,
29#if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
30 PAGE_EXT_YOUNG,
31 PAGE_EXT_IDLE,
32#endif
29}; 33};
30 34
31/* 35/*
diff --git a/include/linux/page_idle.h b/include/linux/page_idle.h
new file mode 100644
index 000000000000..bf268fa92c5b
--- /dev/null
+++ b/include/linux/page_idle.h
@@ -0,0 +1,110 @@
1#ifndef _LINUX_MM_PAGE_IDLE_H
2#define _LINUX_MM_PAGE_IDLE_H
3
4#include <linux/bitops.h>
5#include <linux/page-flags.h>
6#include <linux/page_ext.h>
7
8#ifdef CONFIG_IDLE_PAGE_TRACKING
9
10#ifdef CONFIG_64BIT
11static inline bool page_is_young(struct page *page)
12{
13 return PageYoung(page);
14}
15
16static inline void set_page_young(struct page *page)
17{
18 SetPageYoung(page);
19}
20
21static inline bool test_and_clear_page_young(struct page *page)
22{
23 return TestClearPageYoung(page);
24}
25
26static inline bool page_is_idle(struct page *page)
27{
28 return PageIdle(page);
29}
30
31static inline void set_page_idle(struct page *page)
32{
33 SetPageIdle(page);
34}
35
36static inline void clear_page_idle(struct page *page)
37{
38 ClearPageIdle(page);
39}
40#else /* !CONFIG_64BIT */
41/*
42 * If there is not enough space to store Idle and Young bits in page flags, use
43 * page ext flags instead.
44 */
45extern struct page_ext_operations page_idle_ops;
46
47static inline bool page_is_young(struct page *page)
48{
49 return test_bit(PAGE_EXT_YOUNG, &lookup_page_ext(page)->flags);
50}
51
52static inline void set_page_young(struct page *page)
53{
54 set_bit(PAGE_EXT_YOUNG, &lookup_page_ext(page)->flags);
55}
56
57static inline bool test_and_clear_page_young(struct page *page)
58{
59 return test_and_clear_bit(PAGE_EXT_YOUNG,
60 &lookup_page_ext(page)->flags);
61}
62
63static inline bool page_is_idle(struct page *page)
64{
65 return test_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
66}
67
68static inline void set_page_idle(struct page *page)
69{
70 set_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
71}
72
73static inline void clear_page_idle(struct page *page)
74{
75 clear_bit(PAGE_EXT_IDLE, &lookup_page_ext(page)->flags);
76}
77#endif /* CONFIG_64BIT */
78
79#else /* !CONFIG_IDLE_PAGE_TRACKING */
80
81static inline bool page_is_young(struct page *page)
82{
83 return false;
84}
85
86static inline void set_page_young(struct page *page)
87{
88}
89
90static inline bool test_and_clear_page_young(struct page *page)
91{
92 return false;
93}
94
95static inline bool page_is_idle(struct page *page)
96{
97 return false;
98}
99
100static inline void set_page_idle(struct page *page)
101{
102}
103
104static inline void clear_page_idle(struct page *page)
105{
106}
107
108#endif /* CONFIG_IDLE_PAGE_TRACKING */
109
110#endif /* _LINUX_MM_PAGE_IDLE_H */
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 2110a81c5e2a..317e16de09e5 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -19,8 +19,8 @@
19 * under normal circumstances, used to verify that nobody uses 19 * under normal circumstances, used to verify that nobody uses
20 * non-initialized list entries. 20 * non-initialized list entries.
21 */ 21 */
22#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) 22#define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA)
23#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA) 23#define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA)
24 24
25/********** include/linux/timer.h **********/ 25/********** include/linux/timer.h **********/
26/* 26/*
@@ -69,10 +69,6 @@
69#define ATM_POISON_FREE 0x12 69#define ATM_POISON_FREE 0x12
70#define ATM_POISON 0xdeadbeef 70#define ATM_POISON 0xdeadbeef
71 71
72/********** net/ **********/
73#define NEIGHBOR_DEAD 0xdeadbeef
74#define NETFILTER_LINK_POISON 0xdead57ac
75
76/********** kernel/mutexes **********/ 72/********** kernel/mutexes **********/
77#define MUTEX_DEBUG_INIT 0x11 73#define MUTEX_DEBUG_INIT 0x11
78#define MUTEX_DEBUG_FREE 0x22 74#define MUTEX_DEBUG_FREE 0x22
@@ -83,7 +79,4 @@
83/********** security/ **********/ 79/********** security/ **********/
84#define KEY_DESTROY 0xbd 80#define KEY_DESTROY 0xbd
85 81
86/********** sound/oss/ **********/
87#define OSS_POISON_FREE 0xAB
88
89#endif 82#endif
diff --git a/include/linux/printk.h b/include/linux/printk.h
index a6298b27ac99..9729565c25ff 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -404,10 +404,10 @@ do { \
404 static DEFINE_RATELIMIT_STATE(_rs, \ 404 static DEFINE_RATELIMIT_STATE(_rs, \
405 DEFAULT_RATELIMIT_INTERVAL, \ 405 DEFAULT_RATELIMIT_INTERVAL, \
406 DEFAULT_RATELIMIT_BURST); \ 406 DEFAULT_RATELIMIT_BURST); \
407 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 407 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, pr_fmt(fmt)); \
408 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ 408 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \
409 __ratelimit(&_rs)) \ 409 __ratelimit(&_rs)) \
410 __dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__); \ 410 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \
411} while (0) 411} while (0)
412#elif defined(DEBUG) 412#elif defined(DEBUG)
413#define pr_debug_ratelimited(fmt, ...) \ 413#define pr_debug_ratelimited(fmt, ...) \
@@ -456,11 +456,17 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
456 groupsize, buf, len, ascii) \ 456 groupsize, buf, len, ascii) \
457 dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ 457 dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
458 groupsize, buf, len, ascii) 458 groupsize, buf, len, ascii)
459#else 459#elif defined(DEBUG)
460#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \ 460#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
461 groupsize, buf, len, ascii) \ 461 groupsize, buf, len, ascii) \
462 print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \ 462 print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
463 groupsize, buf, len, ascii) 463 groupsize, buf, len, ascii)
464#endif /* defined(CONFIG_DYNAMIC_DEBUG) */ 464#else
465static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
466 int rowsize, int groupsize,
467 const void *buf, size_t len, bool ascii)
468{
469}
470#endif
465 471
466#endif 472#endif
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index d4c7271382cb..adeadbd6d7bf 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -122,6 +122,10 @@ int seq_write(struct seq_file *seq, const void *data, size_t len);
122__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...); 122__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
123__printf(2, 0) int seq_vprintf(struct seq_file *, const char *, va_list args); 123__printf(2, 0) int seq_vprintf(struct seq_file *, const char *, va_list args);
124 124
125void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
126 int rowsize, int groupsize, const void *buf, size_t len,
127 bool ascii);
128
125int seq_path(struct seq_file *, const struct path *, const char *); 129int seq_path(struct seq_file *, const struct path *, const char *);
126int seq_file_path(struct seq_file *, struct file *, const char *); 130int seq_file_path(struct seq_file *, struct file *, const char *);
127int seq_dentry(struct seq_file *, struct dentry *, const char *); 131int seq_dentry(struct seq_file *, struct dentry *, const char *);
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 71f711db4500..dabe643eb5fa 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -48,24 +48,24 @@ static inline int string_unescape_any_inplace(char *buf)
48#define ESCAPE_HEX 0x20 48#define ESCAPE_HEX 0x20
49 49
50int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, 50int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz,
51 unsigned int flags, const char *esc); 51 unsigned int flags, const char *only);
52 52
53static inline int string_escape_mem_any_np(const char *src, size_t isz, 53static inline int string_escape_mem_any_np(const char *src, size_t isz,
54 char *dst, size_t osz, const char *esc) 54 char *dst, size_t osz, const char *only)
55{ 55{
56 return string_escape_mem(src, isz, dst, osz, ESCAPE_ANY_NP, esc); 56 return string_escape_mem(src, isz, dst, osz, ESCAPE_ANY_NP, only);
57} 57}
58 58
59static inline int string_escape_str(const char *src, char *dst, size_t sz, 59static inline int string_escape_str(const char *src, char *dst, size_t sz,
60 unsigned int flags, const char *esc) 60 unsigned int flags, const char *only)
61{ 61{
62 return string_escape_mem(src, strlen(src), dst, sz, flags, esc); 62 return string_escape_mem(src, strlen(src), dst, sz, flags, only);
63} 63}
64 64
65static inline int string_escape_str_any_np(const char *src, char *dst, 65static inline int string_escape_str_any_np(const char *src, char *dst,
66 size_t sz, const char *esc) 66 size_t sz, const char *only)
67{ 67{
68 return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, esc); 68 return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only);
69} 69}
70 70
71#endif 71#endif
diff --git a/include/linux/zpool.h b/include/linux/zpool.h
index c924a28d9805..42f8ec992452 100644
--- a/include/linux/zpool.h
+++ b/include/linux/zpool.h
@@ -36,6 +36,8 @@ enum zpool_mapmode {
36 ZPOOL_MM_DEFAULT = ZPOOL_MM_RW 36 ZPOOL_MM_DEFAULT = ZPOOL_MM_RW
37}; 37};
38 38
39bool zpool_has_pool(char *type);
40
39struct zpool *zpool_create_pool(char *type, char *name, 41struct zpool *zpool_create_pool(char *type, char *name,
40 gfp_t gfp, const struct zpool_ops *ops); 42 gfp_t gfp, const struct zpool_ops *ops);
41 43
diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h
index a6c4962e5d46..5da5f8751ce7 100644
--- a/include/uapi/linux/kernel-page-flags.h
+++ b/include/uapi/linux/kernel-page-flags.h
@@ -33,6 +33,7 @@
33#define KPF_THP 22 33#define KPF_THP 22
34#define KPF_BALLOON 23 34#define KPF_BALLOON 23
35#define KPF_ZERO_PAGE 24 35#define KPF_ZERO_PAGE 24
36#define KPF_IDLE 25
36 37
37 38
38#endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ 39#endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */