Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463961
| From | Catalin Marinas <catalin.marinas@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping |
| Date | 2016-08-16 19:40 +0200 |
| Message-ID | <s6Qvf-61D-5@gated-at.bofh.it> (permalink) |
| References | <s6Ots-4M4-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Aug 16, 2016 at 04:20:56PM +0100, Catalin Marinas wrote:
> diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
> index 4894c6888bc6..380f72bc3657 100644
> --- a/include/linux/kmemleak.h
> +++ b/include/linux/kmemleak.h
> @@ -21,6 +21,7 @@
> #ifndef __KMEMLEAK_H
> #define __KMEMLEAK_H
>
> +#include <linux/mm.h>
Given the kbuild-robot reports, this #include doesn't go well on some
architectures.
> #include <linux/slab.h>
>
> #ifdef CONFIG_DEBUG_KMEMLEAK
> @@ -109,4 +110,29 @@ static inline void kmemleak_no_scan(const void *ptr)
>
> #endif /* CONFIG_DEBUG_KMEMLEAK */
>
> +static inline void kmemleak_alloc_phys(phys_addr_t phys, size_t size,
> + int min_count, gfp_t gfp)
> +{
> + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory))
> + kmemleak_alloc(__va(phys), size, min_count, gfp);
> +}
> +
> +static inline void kmemleak_free_part_phys(phys_addr_t phys, size_t size)
> +{
> + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory))
> + kmemleak_free_part(__va(phys), size);
> +}
> +
> +static inline void kmemleak_not_leak_phys(phys_addr_t phys)
> +{
> + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory))
> + kmemleak_not_leak(__va(phys));
> +}
> +
> +static inline void kmemleak_ignore_phys(phys_addr_t phys)
> +{
> + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory))
> + kmemleak_ignore(__va(phys));
> +}
I'll move these functions out of line and re-post the patch.
--
Catalin
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping Catalin Marinas <catalin.marinas@arm.com> - 2016-08-16 17:30 +0200
Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping kbuild test robot <lkp@intel.com> - 2016-08-16 19:20 +0200
Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping Catalin Marinas <catalin.marinas@arm.com> - 2016-08-16 19:40 +0200
Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping kbuild test robot <lkp@intel.com> - 2016-08-16 19:30 +0200
Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping Catalin Marinas <catalin.marinas@arm.com> - 2016-08-16 19:40 +0200
Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping kbuild test robot <lkp@intel.com> - 2016-08-16 19:50 +0200
Re: [lkp] [mm] 122708b1b9: PANIC: early exception Catalin Marinas <catalin.marinas@arm.com> - 2016-08-17 18:20 +0200
Re: [lkp] [mm] 122708b1b9: PANIC: early exception Andrew Morton <akpm@linux-foundation.org> - 2016-08-17 21:20 +0200
Re: [lkp] [mm] 122708b1b9: PANIC: early exception Catalin Marinas <catalin.marinas@arm.com> - 2016-08-17 22:40 +0200
csiph-web