diff options
| author | Ingo Molnar <mingo@kernel.org> | 2012-04-13 03:50:21 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2012-04-13 03:50:21 -0400 |
| commit | 659c36fcda403013a01b85da07cf2d9711e6d6c7 (patch) | |
| tree | ece2e7d0e2c19ea5a3d0ec172ad0b81a8a19021d /include/asm-generic | |
| parent | 9521d830b6341d1887dcfc2aebde23fbfa5f1473 (diff) | |
| parent | 5a7ed29c7572d00a75e8c4529e30c5ac2ef82271 (diff) | |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Fixes and improvements for perf/core:
. Overhaul the tools/ makefiles, gluing them to the top level Makefile, from
Borislav Petkov.
. Move the UI files from tools/perf/util/ui/ to tools/perf/ui/. Also move
the GTK+ browser to tools/perf/ui/gtk/, from Namhyung Kim.
. Only fallback to sw cycles counter on ENOENT for the hw cycles, from
Robert Richter
. Trivial fixes from Robert Richter
. Handle the autogenerated bison/flex files better, from Namhyung and Jiri Olsa.
. Navigate jump instructions in the annotate browser, just press enter or ->,
still needs support for a jump navigation history, i.e. to go back.
. Search string in the annotate browser: same keys as vim:
/ forward
n next backward/forward
? backward
. Clarify number of events/samples in the report header, from Ashay Rane
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/asm-generic')
| -rw-r--r-- | include/asm-generic/bug.h | 6 | ||||
| -rw-r--r-- | include/asm-generic/dma-mapping-common.h | 1 | ||||
| -rw-r--r-- | include/asm-generic/getorder.h | 53 | ||||
| -rw-r--r-- | include/asm-generic/mman-common.h | 4 | ||||
| -rw-r--r-- | include/asm-generic/pci-bridge.h | 6 | ||||
| -rw-r--r-- | include/asm-generic/pci.h | 24 | ||||
| -rw-r--r-- | include/asm-generic/pgtable.h | 62 | ||||
| -rw-r--r-- | include/asm-generic/socket.h | 5 | ||||
| -rw-r--r-- | include/asm-generic/tlbflush.h | 2 | ||||
| -rw-r--r-- | include/asm-generic/vmlinux.lds.h | 1 |
10 files changed, 129 insertions, 35 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 84458b0c38d1..2520a6e241dc 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -134,7 +134,7 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
| 134 | #endif | 134 | #endif |
| 135 | 135 | ||
| 136 | #define WARN_ON_ONCE(condition) ({ \ | 136 | #define WARN_ON_ONCE(condition) ({ \ |
| 137 | static bool __warned; \ | 137 | static bool __section(.data.unlikely) __warned; \ |
| 138 | int __ret_warn_once = !!(condition); \ | 138 | int __ret_warn_once = !!(condition); \ |
| 139 | \ | 139 | \ |
| 140 | if (unlikely(__ret_warn_once)) \ | 140 | if (unlikely(__ret_warn_once)) \ |
| @@ -144,7 +144,7 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
| 144 | }) | 144 | }) |
| 145 | 145 | ||
| 146 | #define WARN_ONCE(condition, format...) ({ \ | 146 | #define WARN_ONCE(condition, format...) ({ \ |
| 147 | static bool __warned; \ | 147 | static bool __section(.data.unlikely) __warned; \ |
| 148 | int __ret_warn_once = !!(condition); \ | 148 | int __ret_warn_once = !!(condition); \ |
| 149 | \ | 149 | \ |
| 150 | if (unlikely(__ret_warn_once)) \ | 150 | if (unlikely(__ret_warn_once)) \ |
| @@ -154,7 +154,7 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
| 154 | }) | 154 | }) |
| 155 | 155 | ||
| 156 | #define WARN_TAINT_ONCE(condition, taint, format...) ({ \ | 156 | #define WARN_TAINT_ONCE(condition, taint, format...) ({ \ |
| 157 | static bool __warned; \ | 157 | static bool __section(.data.unlikely) __warned; \ |
| 158 | int __ret_warn_once = !!(condition); \ | 158 | int __ret_warn_once = !!(condition); \ |
| 159 | \ | 159 | \ |
| 160 | if (unlikely(__ret_warn_once)) \ | 160 | if (unlikely(__ret_warn_once)) \ |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index 9fa3f96e38cf..2e248d8924dc 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _ASM_GENERIC_DMA_MAPPING_H | 2 | #define _ASM_GENERIC_DMA_MAPPING_H |
| 3 | 3 | ||
| 4 | #include <linux/kmemcheck.h> | 4 | #include <linux/kmemcheck.h> |
| 5 | #include <linux/bug.h> | ||
| 5 | #include <linux/scatterlist.h> | 6 | #include <linux/scatterlist.h> |
| 6 | #include <linux/dma-debug.h> | 7 | #include <linux/dma-debug.h> |
| 7 | #include <linux/dma-attrs.h> | 8 | #include <linux/dma-attrs.h> |
diff --git a/include/asm-generic/getorder.h b/include/asm-generic/getorder.h index 67e7245dc9b3..65e4468ac53d 100644 --- a/include/asm-generic/getorder.h +++ b/include/asm-generic/getorder.h | |||
| @@ -4,21 +4,58 @@ | |||
| 4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
| 5 | 5 | ||
| 6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
| 7 | #include <linux/log2.h> | ||
| 7 | 8 | ||
| 8 | /* Pure 2^n version of get_order */ | 9 | /* |
| 9 | static inline __attribute_const__ int get_order(unsigned long size) | 10 | * Runtime evaluation of get_order() |
| 11 | */ | ||
| 12 | static inline __attribute_const__ | ||
| 13 | int __get_order(unsigned long size) | ||
| 10 | { | 14 | { |
| 11 | int order; | 15 | int order; |
| 12 | 16 | ||
| 13 | size = (size - 1) >> (PAGE_SHIFT - 1); | 17 | size--; |
| 14 | order = -1; | 18 | size >>= PAGE_SHIFT; |
| 15 | do { | 19 | #if BITS_PER_LONG == 32 |
| 16 | size >>= 1; | 20 | order = fls(size); |
| 17 | order++; | 21 | #else |
| 18 | } while (size); | 22 | order = fls64(size); |
| 23 | #endif | ||
| 19 | return order; | 24 | return order; |
| 20 | } | 25 | } |
| 21 | 26 | ||
| 27 | /** | ||
| 28 | * get_order - Determine the allocation order of a memory size | ||
| 29 | * @size: The size for which to get the order | ||
| 30 | * | ||
| 31 | * Determine the allocation order of a particular sized block of memory. This | ||
| 32 | * is on a logarithmic scale, where: | ||
| 33 | * | ||
| 34 | * 0 -> 2^0 * PAGE_SIZE and below | ||
| 35 | * 1 -> 2^1 * PAGE_SIZE to 2^0 * PAGE_SIZE + 1 | ||
| 36 | * 2 -> 2^2 * PAGE_SIZE to 2^1 * PAGE_SIZE + 1 | ||
| 37 | * 3 -> 2^3 * PAGE_SIZE to 2^2 * PAGE_SIZE + 1 | ||
| 38 | * 4 -> 2^4 * PAGE_SIZE to 2^3 * PAGE_SIZE + 1 | ||
| 39 | * ... | ||
| 40 | * | ||
| 41 | * The order returned is used to find the smallest allocation granule required | ||
| 42 | * to hold an object of the specified size. | ||
| 43 | * | ||
| 44 | * The result is undefined if the size is 0. | ||
| 45 | * | ||
| 46 | * This function may be used to initialise variables with compile time | ||
| 47 | * evaluations of constants. | ||
| 48 | */ | ||
| 49 | #define get_order(n) \ | ||
| 50 | ( \ | ||
| 51 | __builtin_constant_p(n) ? ( \ | ||
| 52 | ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \ | ||
| 53 | (((n) < (1UL << PAGE_SHIFT)) ? 0 : \ | ||
| 54 | ilog2((n) - 1) - PAGE_SHIFT + 1) \ | ||
| 55 | ) : \ | ||
| 56 | __get_order(n) \ | ||
| 57 | ) | ||
| 58 | |||
| 22 | #endif /* __ASSEMBLY__ */ | 59 | #endif /* __ASSEMBLY__ */ |
| 23 | 60 | ||
| 24 | #endif /* __ASM_GENERIC_GETORDER_H */ | 61 | #endif /* __ASM_GENERIC_GETORDER_H */ |
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 787abbb6d867..d030d2c2647a 100644 --- a/include/asm-generic/mman-common.h +++ b/include/asm-generic/mman-common.h | |||
| @@ -48,6 +48,10 @@ | |||
| 48 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | 48 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ |
| 49 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | 49 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ |
| 50 | 50 | ||
| 51 | #define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, | ||
| 52 | overrides the coredump filter bits */ | ||
| 53 | #define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */ | ||
| 54 | |||
| 51 | /* compatibility flags */ | 55 | /* compatibility flags */ |
| 52 | #define MAP_FILE 0 | 56 | #define MAP_FILE 0 |
| 53 | 57 | ||
diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h index 4a5aca2a2c94..a5b5d5a89a4f 100644 --- a/include/asm-generic/pci-bridge.h +++ b/include/asm-generic/pci-bridge.h | |||
| @@ -45,6 +45,11 @@ static inline void pci_add_flags(int flags) | |||
| 45 | pci_flags |= flags; | 45 | pci_flags |= flags; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | static inline void pci_clear_flags(int flags) | ||
| 49 | { | ||
| 50 | pci_flags &= ~flags; | ||
| 51 | } | ||
| 52 | |||
| 48 | static inline int pci_has_flag(int flag) | 53 | static inline int pci_has_flag(int flag) |
| 49 | { | 54 | { |
| 50 | return pci_flags & flag; | 55 | return pci_flags & flag; |
| @@ -52,6 +57,7 @@ static inline int pci_has_flag(int flag) | |||
| 52 | #else | 57 | #else |
| 53 | static inline void pci_set_flags(int flags) { } | 58 | static inline void pci_set_flags(int flags) { } |
| 54 | static inline void pci_add_flags(int flags) { } | 59 | static inline void pci_add_flags(int flags) { } |
| 60 | static inline void pci_clear_flags(int flags) { } | ||
| 55 | static inline int pci_has_flag(int flag) | 61 | static inline int pci_has_flag(int flag) |
| 56 | { | 62 | { |
| 57 | return 0; | 63 | return 0; |
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index 26373cff4546..e80a0495e5b0 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h | |||
| @@ -6,30 +6,6 @@ | |||
| 6 | #ifndef _ASM_GENERIC_PCI_H | 6 | #ifndef _ASM_GENERIC_PCI_H |
| 7 | #define _ASM_GENERIC_PCI_H | 7 | #define _ASM_GENERIC_PCI_H |
| 8 | 8 | ||
| 9 | /** | ||
| 10 | * pcibios_resource_to_bus - convert resource to PCI bus address | ||
| 11 | * @dev: device which owns this resource | ||
| 12 | * @region: converted bus-centric region (start,end) | ||
| 13 | * @res: resource to convert | ||
| 14 | * | ||
| 15 | * Convert a resource to a PCI device bus address or bus window. | ||
| 16 | */ | ||
| 17 | static inline void | ||
| 18 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | ||
| 19 | struct resource *res) | ||
| 20 | { | ||
| 21 | region->start = res->start; | ||
| 22 | region->end = res->end; | ||
| 23 | } | ||
| 24 | |||
| 25 | static inline void | ||
| 26 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
| 27 | struct pci_bus_region *region) | ||
| 28 | { | ||
| 29 | res->start = region->start; | ||
| 30 | res->end = region->end; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline struct resource * | 9 | static inline struct resource * |
| 34 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | 10 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) |
| 35 | { | 11 | { |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 76bff2bff15e..125c54e98517 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #ifdef CONFIG_MMU | 5 | #ifdef CONFIG_MMU |
| 6 | 6 | ||
| 7 | #include <linux/mm_types.h> | 7 | #include <linux/mm_types.h> |
| 8 | #include <linux/bug.h> | ||
| 8 | 9 | ||
| 9 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 10 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
| 10 | extern int ptep_set_access_flags(struct vm_area_struct *vma, | 11 | extern int ptep_set_access_flags(struct vm_area_struct *vma, |
| @@ -425,6 +426,8 @@ extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn, | |||
| 425 | unsigned long size); | 426 | unsigned long size); |
| 426 | #endif | 427 | #endif |
| 427 | 428 | ||
| 429 | #ifdef CONFIG_MMU | ||
| 430 | |||
| 428 | #ifndef CONFIG_TRANSPARENT_HUGEPAGE | 431 | #ifndef CONFIG_TRANSPARENT_HUGEPAGE |
| 429 | static inline int pmd_trans_huge(pmd_t pmd) | 432 | static inline int pmd_trans_huge(pmd_t pmd) |
| 430 | { | 433 | { |
| @@ -441,7 +444,66 @@ static inline int pmd_write(pmd_t pmd) | |||
| 441 | return 0; | 444 | return 0; |
| 442 | } | 445 | } |
| 443 | #endif /* __HAVE_ARCH_PMD_WRITE */ | 446 | #endif /* __HAVE_ARCH_PMD_WRITE */ |
| 447 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | ||
| 448 | |||
| 449 | /* | ||
| 450 | * This function is meant to be used by sites walking pagetables with | ||
| 451 | * the mmap_sem hold in read mode to protect against MADV_DONTNEED and | ||
| 452 | * transhuge page faults. MADV_DONTNEED can convert a transhuge pmd | ||
| 453 | * into a null pmd and the transhuge page fault can convert a null pmd | ||
| 454 | * into an hugepmd or into a regular pmd (if the hugepage allocation | ||
| 455 | * fails). While holding the mmap_sem in read mode the pmd becomes | ||
| 456 | * stable and stops changing under us only if it's not null and not a | ||
| 457 | * transhuge pmd. When those races occurs and this function makes a | ||
| 458 | * difference vs the standard pmd_none_or_clear_bad, the result is | ||
| 459 | * undefined so behaving like if the pmd was none is safe (because it | ||
| 460 | * can return none anyway). The compiler level barrier() is critically | ||
| 461 | * important to compute the two checks atomically on the same pmdval. | ||
| 462 | */ | ||
| 463 | static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd) | ||
| 464 | { | ||
| 465 | /* depend on compiler for an atomic pmd read */ | ||
| 466 | pmd_t pmdval = *pmd; | ||
| 467 | /* | ||
| 468 | * The barrier will stabilize the pmdval in a register or on | ||
| 469 | * the stack so that it will stop changing under the code. | ||
| 470 | */ | ||
| 471 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
| 472 | barrier(); | ||
| 473 | #endif | ||
| 474 | if (pmd_none(pmdval)) | ||
| 475 | return 1; | ||
| 476 | if (unlikely(pmd_bad(pmdval))) { | ||
| 477 | if (!pmd_trans_huge(pmdval)) | ||
| 478 | pmd_clear_bad(pmd); | ||
| 479 | return 1; | ||
| 480 | } | ||
| 481 | return 0; | ||
| 482 | } | ||
| 483 | |||
| 484 | /* | ||
| 485 | * This is a noop if Transparent Hugepage Support is not built into | ||
| 486 | * the kernel. Otherwise it is equivalent to | ||
| 487 | * pmd_none_or_trans_huge_or_clear_bad(), and shall only be called in | ||
| 488 | * places that already verified the pmd is not none and they want to | ||
| 489 | * walk ptes while holding the mmap sem in read mode (write mode don't | ||
| 490 | * need this). If THP is not enabled, the pmd can't go away under the | ||
| 491 | * code even if MADV_DONTNEED runs, but if THP is enabled we need to | ||
| 492 | * run a pmd_trans_unstable before walking the ptes after | ||
| 493 | * split_huge_page_pmd returns (because it may have run when the pmd | ||
| 494 | * become null, but then a page fault can map in a THP and not a | ||
| 495 | * regular page). | ||
| 496 | */ | ||
| 497 | static inline int pmd_trans_unstable(pmd_t *pmd) | ||
| 498 | { | ||
| 499 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
| 500 | return pmd_none_or_trans_huge_or_clear_bad(pmd); | ||
| 501 | #else | ||
| 502 | return 0; | ||
| 444 | #endif | 503 | #endif |
| 504 | } | ||
| 505 | |||
| 506 | #endif /* CONFIG_MMU */ | ||
| 445 | 507 | ||
| 446 | #endif /* !__ASSEMBLY__ */ | 508 | #endif /* !__ASSEMBLY__ */ |
| 447 | 509 | ||
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h index 49c1704173e7..b1bea03274d5 100644 --- a/include/asm-generic/socket.h +++ b/include/asm-generic/socket.h | |||
| @@ -67,4 +67,9 @@ | |||
| 67 | 67 | ||
| 68 | #define SO_WIFI_STATUS 41 | 68 | #define SO_WIFI_STATUS 41 |
| 69 | #define SCM_WIFI_STATUS SO_WIFI_STATUS | 69 | #define SCM_WIFI_STATUS SO_WIFI_STATUS |
| 70 | #define SO_PEEK_OFF 42 | ||
| 71 | |||
| 72 | /* Instruct lower device to use last 4-bytes of skb data as FCS */ | ||
| 73 | #define SO_NOFCS 43 | ||
| 74 | |||
| 70 | #endif /* __ASM_GENERIC_SOCKET_H */ | 75 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/asm-generic/tlbflush.h b/include/asm-generic/tlbflush.h index c7af037024c7..d6d0a88430fe 100644 --- a/include/asm-generic/tlbflush.h +++ b/include/asm-generic/tlbflush.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #error need to implement an architecture specific asm/tlbflush.h | 9 | #error need to implement an architecture specific asm/tlbflush.h |
| 10 | #endif | 10 | #endif |
| 11 | 11 | ||
| 12 | #include <linux/bug.h> | ||
| 13 | |||
| 12 | static inline void flush_tlb_mm(struct mm_struct *mm) | 14 | static inline void flush_tlb_mm(struct mm_struct *mm) |
| 13 | { | 15 | { |
| 14 | BUG(); | 16 | BUG(); |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b5e2e4c6b017..798603e8ec38 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -167,6 +167,7 @@ | |||
| 167 | CPU_KEEP(exit.data) \ | 167 | CPU_KEEP(exit.data) \ |
| 168 | MEM_KEEP(init.data) \ | 168 | MEM_KEEP(init.data) \ |
| 169 | MEM_KEEP(exit.data) \ | 169 | MEM_KEEP(exit.data) \ |
| 170 | *(.data.unlikely) \ | ||
| 170 | STRUCT_ALIGN(); \ | 171 | STRUCT_ALIGN(); \ |
| 171 | *(__tracepoints) \ | 172 | *(__tracepoints) \ |
| 172 | /* implement dynamic printk debug */ \ | 173 | /* implement dynamic printk debug */ \ |
