diff options
-rw-r--r-- | arch/x86/kernel/ds.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index 5fd53333c1df..b1d6e1f502fa 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c | |||
@@ -255,8 +255,13 @@ static inline struct ds_context *ds_get_context(struct task_struct *task) | |||
255 | struct ds_context *new_context = NULL; | 255 | struct ds_context *new_context = NULL; |
256 | unsigned long irq; | 256 | unsigned long irq; |
257 | 257 | ||
258 | /* Chances are small that we already have a context. */ | 258 | /* |
259 | new_context = kzalloc(sizeof(*new_context), GFP_KERNEL); | 259 | * Chances are small that we already have a context. |
260 | * | ||
261 | * Contexts for per-cpu tracing are allocated using | ||
262 | * smp_call_function(). We must not sleep. | ||
263 | */ | ||
264 | new_context = kzalloc(sizeof(*new_context), GFP_ATOMIC); | ||
260 | if (!new_context) | 265 | if (!new_context) |
261 | return NULL; | 266 | return NULL; |
262 | 267 | ||
@@ -662,8 +667,12 @@ struct bts_tracer *ds_request_bts(struct task_struct *task, | |||
662 | if (ovfl) | 667 | if (ovfl) |
663 | goto out; | 668 | goto out; |
664 | 669 | ||
670 | /* | ||
671 | * Per-cpu tracing is typically requested using smp_call_function(). | ||
672 | * We must not sleep. | ||
673 | */ | ||
665 | error = -ENOMEM; | 674 | error = -ENOMEM; |
666 | tracer = kzalloc(sizeof(*tracer), GFP_KERNEL); | 675 | tracer = kzalloc(sizeof(*tracer), GFP_ATOMIC); |
667 | if (!tracer) | 676 | if (!tracer) |
668 | goto out; | 677 | goto out; |
669 | tracer->ovfl = ovfl; | 678 | tracer->ovfl = ovfl; |
@@ -722,8 +731,12 @@ struct pebs_tracer *ds_request_pebs(struct task_struct *task, | |||
722 | if (ovfl) | 731 | if (ovfl) |
723 | goto out; | 732 | goto out; |
724 | 733 | ||
734 | /* | ||
735 | * Per-cpu tracing is typically requested using smp_call_function(). | ||
736 | * We must not sleep. | ||
737 | */ | ||
725 | error = -ENOMEM; | 738 | error = -ENOMEM; |
726 | tracer = kzalloc(sizeof(*tracer), GFP_KERNEL); | 739 | tracer = kzalloc(sizeof(*tracer), GFP_ATOMIC); |
727 | if (!tracer) | 740 | if (!tracer) |
728 | goto out; | 741 | goto out; |
729 | tracer->ovfl = ovfl; | 742 | tracer->ovfl = ovfl; |