diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-02-15 17:47:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-02-19 02:05:53 -0500 |
commit | cdc4e86b58a95005ef500916b4a8e91a0037a822 (patch) | |
tree | 208e5eaf42c25fae3dfe5d086687c2a2fa30418b /kernel/sched/cputime.c | |
parent | 993db4b45fd99949d8f6e004a7744b523dca473a (diff) |
cputime: Remove irqsave from seqlock readers
The reader side code has no requirement to disable interrupts while
sampling data. The sequence counter is enough to ensure consistency.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/cputime.c')
-rw-r--r-- | kernel/sched/cputime.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index ccff2752725a..9857329ed280 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c | |||
@@ -729,18 +729,17 @@ void vtime_init_idle(struct task_struct *t) | |||
729 | 729 | ||
730 | cputime_t task_gtime(struct task_struct *t) | 730 | cputime_t task_gtime(struct task_struct *t) |
731 | { | 731 | { |
732 | unsigned long flags; | ||
733 | unsigned int seq; | 732 | unsigned int seq; |
734 | cputime_t gtime; | 733 | cputime_t gtime; |
735 | 734 | ||
736 | do { | 735 | do { |
737 | seq = read_seqbegin_irqsave(&t->vtime_seqlock, flags); | 736 | seq = read_seqbegin(&t->vtime_seqlock); |
738 | 737 | ||
739 | gtime = t->gtime; | 738 | gtime = t->gtime; |
740 | if (t->flags & PF_VCPU) | 739 | if (t->flags & PF_VCPU) |
741 | gtime += vtime_delta(t); | 740 | gtime += vtime_delta(t); |
742 | 741 | ||
743 | } while (read_seqretry_irqrestore(&t->vtime_seqlock, seq, flags)); | 742 | } while (read_seqretry(&t->vtime_seqlock, seq)); |
744 | 743 | ||
745 | return gtime; | 744 | return gtime; |
746 | } | 745 | } |
@@ -756,7 +755,6 @@ fetch_task_cputime(struct task_struct *t, | |||
756 | cputime_t *u_src, cputime_t *s_src, | 755 | cputime_t *u_src, cputime_t *s_src, |
757 | cputime_t *udelta, cputime_t *sdelta) | 756 | cputime_t *udelta, cputime_t *sdelta) |
758 | { | 757 | { |
759 | unsigned long flags; | ||
760 | unsigned int seq; | 758 | unsigned int seq; |
761 | unsigned long long delta; | 759 | unsigned long long delta; |
762 | 760 | ||
@@ -764,7 +762,7 @@ fetch_task_cputime(struct task_struct *t, | |||
764 | *udelta = 0; | 762 | *udelta = 0; |
765 | *sdelta = 0; | 763 | *sdelta = 0; |
766 | 764 | ||
767 | seq = read_seqbegin_irqsave(&t->vtime_seqlock, flags); | 765 | seq = read_seqbegin(&t->vtime_seqlock); |
768 | 766 | ||
769 | if (u_dst) | 767 | if (u_dst) |
770 | *u_dst = *u_src; | 768 | *u_dst = *u_src; |
@@ -788,7 +786,7 @@ fetch_task_cputime(struct task_struct *t, | |||
788 | if (t->vtime_snap_whence == VTIME_SYS) | 786 | if (t->vtime_snap_whence == VTIME_SYS) |
789 | *sdelta = delta; | 787 | *sdelta = delta; |
790 | } | 788 | } |
791 | } while (read_seqretry_irqrestore(&t->vtime_seqlock, seq, flags)); | 789 | } while (read_seqretry(&t->vtime_seqlock, seq)); |
792 | } | 790 | } |
793 | 791 | ||
794 | 792 | ||