#include #include #include #include #include "slab.h" #include void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) { struct page *shadow; int pages; int i; pages = 1 << order; /* * With kmemcheck enabled, we need to allocate a memory area for the * shadow bits as well. */ shadow = alloc_pages_node(node, flags | __GFP_NOTRACK, order); if (!shadow) { if (printk_ratelimit()) pr_err("kmemcheck: failed to allocate shadow bitmap\n"); return; } for(i = 0; i < pages; ++i) page[i].shadow = page_address(&shadow[i]); /* * Mark it as non-present for the MMU so that our accesses to * this memory will trigger a page fault and let us analyze * the memory accesses. */ kmemcheck_hide_pages(page, pages); } void kmemcheck_free_shadow(struct page *page, int order) { struct page *shadow; int pages; int i; if (!kmemcheck_page_is_tracked(page)) return; pages = 1 << order; kmemcheck_show_pages(page, pages); shadow = virt_to_page(page[0].shadow); for(i = 0; i < pages; ++i) page[i].shadow = NULL; __free_pages(shadow, order); } void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, size_t size) { if (unlikely(!object)) /* Skip object if allocation failed */ return; /* * Has already been memset(), which initializes the shadow for us * as well. */ if (gfpflags & __GFP_ZERO) return; /* No need to initialize the shadow of a non-tracked slab. */ if (s->flags & SLAB_NOTRACK) return; if (!kmemcheck_enabled || gfpflags & __GFP_NOTRACK) { /* * Allow notracked objects to be allocated from * tracked caches. Note however that these objects * will still get page faults on access, they just * won't ever be flagged as uninitialized. If page * faults are not acceptable, the slab cache itself * should be marked NOTRACK. */ kmemcheck_mark_initialized(object, size); } else if (!s->ctor) { /* * New objects should be marked uninitialized before * they're returned to the called. */ kmemcheck_mark_uninitialized(object, size); } } void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size) { /* TODO: RCU freeing is unsupported for now; hide false positives. */ if (!s->ctor && !(s->flags & SLAB_DESTROY_BY_RCU)) kmemcheck_mark_freed(object, size); } void kmemcheck_pagealloc_alloc(struct page *page, unsigned int order, gfp_t gfpflags) { int pages; if (gfpflags & (__GFP_HIGHMEM | __GFP_NOTRACK)) return; pages = 1 << order; /* * NOTE: We choose to track GFP_ZERO pages too; in fact, they * can become uninitialized by copying uninitialized memory * into them. */ /* XXX: Can use zone->node for node? */ kmemcheck_alloc_shadow(page, order, gfpflags, -1); if (gfpflags & __GFP_ZERO) kmemcheck_mark_initialized_pages(page, pages); else kmemcheck_mark_uninitialized_pages(page, pages); } include/uapi?id=883af14e67e8b8702b5560aa64c888c0cd0bd66c'>uapi/scsi/scsi_netlink.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
commit883af14e67e8b8702b5560aa64c888c0cd0bd66c (patch)
tree74e3a6b53f5fad9f7848ab1b9f6921b7012940a4 /include/uapi/scsi/scsi_netlink.h
parent0263d4ebd94b36280608e296cba39b924b6e832b (diff)
parentaab45453ff5c77200c6da4ac909f7a4392aed17e (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "26 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (26 commits) MAINTAINERS: add Dan Streetman to zbud maintainers MAINTAINERS: add Dan Streetman to zswap maintainers mm: do not export ioremap_page_range symbol for external module mn10300: fix build error of missing fpu_save() romfs: use different way to generate fsid for BLOCK or MTD frv: add missing atomic64 operations mm, page_alloc: fix premature OOM when racing with cpuset mems update mm, page_alloc: move cpuset seqcount checking to slowpath mm, page_alloc: fix fast-path race with cpuset update or removal mm, page_alloc: fix check for NULL preferred_zone kernel/panic.c: add missing \n fbdev: color map copying bounds checking frv: add atomic64_add_unless() mm/mempolicy.c: do not put mempolicy before using its nodemask radix-tree: fix private list warnings Documentation/filesystems/proc.txt: add VmPin mm, memcg: do not retry precharge charges proc: add a schedule point in proc_pid_readdir() mm: alloc_contig: re-allow CMA to compact FS pages mm/slub.c: trace free objects at KERN_INFO ...
Diffstat (limited to 'include/uapi/scsi/scsi_netlink.h')