diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 5 | ||||
-rw-r--r-- | mm/slab.c | 4 | ||||
-rw-r--r-- | mm/slob.c | 2 | ||||
-rw-r--r-- | mm/slub.c | 1 | ||||
-rw-r--r-- | mm/vmscan.c | 2 |
5 files changed, 14 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5c44ed49ca93..a3803ea8c27d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1479,6 +1479,8 @@ __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | |||
1479 | unsigned long did_some_progress; | 1479 | unsigned long did_some_progress; |
1480 | unsigned long pages_reclaimed = 0; | 1480 | unsigned long pages_reclaimed = 0; |
1481 | 1481 | ||
1482 | lockdep_trace_alloc(gfp_mask); | ||
1483 | |||
1482 | might_sleep_if(wait); | 1484 | might_sleep_if(wait); |
1483 | 1485 | ||
1484 | if (should_fail_alloc_page(gfp_mask, order)) | 1486 | if (should_fail_alloc_page(gfp_mask, order)) |
@@ -1578,12 +1580,15 @@ nofail_alloc: | |||
1578 | */ | 1580 | */ |
1579 | cpuset_update_task_memory_state(); | 1581 | cpuset_update_task_memory_state(); |
1580 | p->flags |= PF_MEMALLOC; | 1582 | p->flags |= PF_MEMALLOC; |
1583 | |||
1584 | lockdep_set_current_reclaim_state(gfp_mask); | ||
1581 | reclaim_state.reclaimed_slab = 0; | 1585 | reclaim_state.reclaimed_slab = 0; |
1582 | p->reclaim_state = &reclaim_state; | 1586 | p->reclaim_state = &reclaim_state; |
1583 | 1587 | ||
1584 | did_some_progress = try_to_free_pages(zonelist, order, gfp_mask); | 1588 | did_some_progress = try_to_free_pages(zonelist, order, gfp_mask); |
1585 | 1589 | ||
1586 | p->reclaim_state = NULL; | 1590 | p->reclaim_state = NULL; |
1591 | lockdep_clear_current_reclaim_state(); | ||
1587 | p->flags &= ~PF_MEMALLOC; | 1592 | p->flags &= ~PF_MEMALLOC; |
1588 | 1593 | ||
1589 | cond_resched(); | 1594 | cond_resched(); |
@@ -3318,6 +3318,8 @@ __cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, | |||
3318 | unsigned long save_flags; | 3318 | unsigned long save_flags; |
3319 | void *ptr; | 3319 | void *ptr; |
3320 | 3320 | ||
3321 | lockdep_trace_alloc(flags); | ||
3322 | |||
3321 | if (slab_should_failslab(cachep, flags)) | 3323 | if (slab_should_failslab(cachep, flags)) |
3322 | return NULL; | 3324 | return NULL; |
3323 | 3325 | ||
@@ -3394,6 +3396,8 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller) | |||
3394 | unsigned long save_flags; | 3396 | unsigned long save_flags; |
3395 | void *objp; | 3397 | void *objp; |
3396 | 3398 | ||
3399 | lockdep_trace_alloc(flags); | ||
3400 | |||
3397 | if (slab_should_failslab(cachep, flags)) | 3401 | if (slab_should_failslab(cachep, flags)) |
3398 | return NULL; | 3402 | return NULL; |
3399 | 3403 | ||
@@ -464,6 +464,8 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node) | |||
464 | unsigned int *m; | 464 | unsigned int *m; |
465 | int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); | 465 | int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN); |
466 | 466 | ||
467 | lockdep_trace_alloc(flags); | ||
468 | |||
467 | if (size < PAGE_SIZE - align) { | 469 | if (size < PAGE_SIZE - align) { |
468 | if (!size) | 470 | if (!size) |
469 | return ZERO_SIZE_PTR; | 471 | return ZERO_SIZE_PTR; |
@@ -1596,6 +1596,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1596 | unsigned long flags; | 1596 | unsigned long flags; |
1597 | unsigned int objsize; | 1597 | unsigned int objsize; |
1598 | 1598 | ||
1599 | lockdep_trace_alloc(gfpflags); | ||
1599 | might_sleep_if(gfpflags & __GFP_WAIT); | 1600 | might_sleep_if(gfpflags & __GFP_WAIT); |
1600 | 1601 | ||
1601 | if (should_failslab(s->objsize, gfpflags)) | 1602 | if (should_failslab(s->objsize, gfpflags)) |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 6177e3bcd66b..ae6f4c174a12 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1965,6 +1965,8 @@ static int kswapd(void *p) | |||
1965 | }; | 1965 | }; |
1966 | node_to_cpumask_ptr(cpumask, pgdat->node_id); | 1966 | node_to_cpumask_ptr(cpumask, pgdat->node_id); |
1967 | 1967 | ||
1968 | lockdep_set_current_reclaim_state(GFP_KERNEL); | ||
1969 | |||
1968 | if (!cpumask_empty(cpumask)) | 1970 | if (!cpumask_empty(cpumask)) |
1969 | set_cpus_allowed_ptr(tsk, cpumask); | 1971 | set_cpus_allowed_ptr(tsk, cpumask); |
1970 | current->reclaim_state = &reclaim_state; | 1972 | current->reclaim_state = &reclaim_state; |