sched: Clean unused fields from struct rq
PATCH v3 1/1 sched: Clean unused fields from struct rq
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed: yld_exp_empty, yld_act_empty and yld_both_empty.
Both Sched Debug and SCHEDSTAT_VERSION versions has also been incremented since ABIs have been changed.
--- kernel/sched.c | 3 --- kernel/sched_debug.c | 5 +---- kernel/sched_stats.h | 7 +++---- 3 files changed, 4 insertions(+), 11 deletions(-)
kernel/sched.c +0 -3
@@ -646,9 +646,6 @@ struct rq {/* could above be rq->cfs_rq.exec_clock + rq->rt_rq.rt_runtime ? */ /* sys_sched_yield() stats */ -unsigned int yld_exp_empty; -unsigned int yld_act_empty; -unsigned int yld_both_empty;unsigned int yld_count;/* schedule() stats */
kernel/sched_debug.c +1 -4
@@ -286,9 +286,6 @@ static void print_cpu(struct seq_file *m, int cpu)#ifdef CONFIG_SCHEDSTATS #define P (n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n); -P (yld_exp_empty); -P (yld_act_empty); -P (yld_both_empty);P (yld_count);P (sched_switch);
@@ -313,7 +310,7 @@ static int sched_debug_show(struct seq_file *m, void *v)u64 now =ktime_to_ns (ktime_get ());int cpu; -SEQ_printf (m,"Sched Debug Version: v0.08, %s %.*s\n" , +SEQ_printf (m,"Sched Debug Version: v0.09, %s %.*s\n" ,init_utsname ()->release, (int )strcspn (init_utsname ()->version," " ),init_utsname ()->version);
kernel/sched_stats.h +3 -4
@@ -4,7 +4,7 @@* bump this up when changing the output format or the meaning of an existing * format, so that tools can adapt (or abort) */ -#define SCHEDSTAT_VERSION 14 +#define SCHEDSTAT_VERSION 15static int show_schedstat (struct seq_file *seq,void *v) {
@@ -26,9 +26,8 @@ static int show_schedstat(struct seq_file *seq, void *v)/* runqueue-specific stats */ seq_printf(seq, - "cpu%d %u %u %u %u %u %u %u %u %u %llu %llu %lu", - cpu, rq->yld_both_empty, - rq->yld_act_empty, rq->yld_exp_empty, rq->yld_count, + "cpu%d %u %u %u %u %u %u %llu %llu %lu", + cpu, rq->yld_count, rq->sched_switch, rq->sched_count, rq->sched_goidle, rq->ttwu_count, rq->ttwu_local, rq->rq_cpu_time,
Signature · 5 lines
1.6.2 -- Luis Henriques
Quoted 78 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Signed-off-by Luis Henriques <[email protected]>--- kernel/sched.c | 3 --- kernel/sched_debug.c | 5 +---- kernel/sched_stats.h | 7 +++---- 3 files changed, 4 insertions(+), 11 deletions(-)kernel/sched.c +0
-3@@ -646,9 +646,6 @@ struct rq {/* could above be rq->cfs_rq.exec_clock + rq->rt_rq.rt_runtime ? */ /* sys_sched_yield() stats */ -unsigned int yld_exp_empty; -unsigned int yld_act_empty; -unsigned int yld_both_empty;unsigned int yld_count;/* schedule() stats */ kernel/sched_debug.c +1
-4@@ -286,9 +286,6 @@ static void print_cpu(struct seq_file *m, int cpu)#ifdef CONFIG_SCHEDSTATS #define P (n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n); -P (yld_exp_empty); -P (yld_act_empty); -P (yld_both_empty);P (yld_count);P (sched_switch);@@ -313,7 +310,7 @@ static int sched_debug_show(struct seq_file *m, void *v)u64 now =ktime_to_ns (ktime_get ());int cpu; -SEQ_printf (m,"Sched Debug Version: v0.08, %s %.*s\n" , +SEQ_printf (m,"Sched Debug Version: v0.09, %s %.*s\n" ,init_utsname ()->release, (int )strcspn (init_utsname ()->version," " ),init_utsname ()->version);kernel/sched_stats.h +3
-4@@ -4,7 +4,7 @@* bump this up when changing the output format or the meaning of an existing * format, so that tools can adapt (or abort) */ -#define SCHEDSTAT_VERSION 14 +#define SCHEDSTAT_VERSION 15static int show_schedstat (struct seq_file *seq,void *v) {@@ -26,9 +26,8 @@ static int show_schedstat(struct seq_file *seq, void *v)/* runqueue-specific stats */ seq_printf(seq, - "cpu%d %u %u %u %u %u %u %u %u %u %llu %llu %lu", - cpu, rq->yld_both_empty, - rq->yld_act_empty, rq->yld_exp_empty, rq->yld_count, + "cpu%d %u %u %u %u %u %u %llu %llu %lu", + cpu, rq->yld_count, rq->sched_switch, rq->sched_count, rq->sched_goidle, rq->ttwu_count, rq->ttwu_local, rq->rq_cpu_time,Signature · 1 line
1.6.2
Btw: I tried Greg schedtop with this patch and the app behaviour is as expected:
$ ./schedtop Exception: unsupported version
Regards,
Signature · 1 line
Luis Henriques
Quoted 82 lines · Luis Henriques
Quoted 78 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Signed-off-by Luis Henriques <[email protected]>--- kernel/sched.c | 3 --- kernel/sched_debug.c | 5 +---- kernel/sched_stats.h | 7 +++---- 3 files changed, 4 insertions(+), 11 deletions(-)kernel/sched.c +0
-3@@ -646,9 +646,6 @@ struct rq {/* could above be rq->cfs_rq.exec_clock + rq->rt_rq.rt_runtime ? */ /* sys_sched_yield() stats */ -unsigned int yld_exp_empty; -unsigned int yld_act_empty; -unsigned int yld_both_empty;unsigned int yld_count;/* schedule() stats */ kernel/sched_debug.c +1
-4@@ -286,9 +286,6 @@ static void print_cpu(struct seq_file *m, int cpu)#ifdef CONFIG_SCHEDSTATS #define P (n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n); -P (yld_exp_empty); -P (yld_act_empty); -P (yld_both_empty);P (yld_count);P (sched_switch);@@ -313,7 +310,7 @@ static int sched_debug_show(struct seq_file *m, void *v)u64 now =ktime_to_ns (ktime_get ());int cpu; -SEQ_printf (m,"Sched Debug Version: v0.08, %s %.*s\n" , +SEQ_printf (m,"Sched Debug Version: v0.09, %s %.*s\n" ,init_utsname ()->release, (int )strcspn (init_utsname ()->version," " ),init_utsname ()->version);kernel/sched_stats.h +3
-4@@ -4,7 +4,7 @@* bump this up when changing the output format or the meaning of an existing * format, so that tools can adapt (or abort) */ -#define SCHEDSTAT_VERSION 14 +#define SCHEDSTAT_VERSION 15static int show_schedstat (struct seq_file *seq,void *v) {@@ -26,9 +26,8 @@ static int show_schedstat(struct seq_file *seq, void *v)/* runqueue-specific stats */ seq_printf(seq, - "cpu%d %u %u %u %u %u %u %u %u %u %llu %llu %lu", - cpu, rq->yld_both_empty, - rq->yld_act_empty, rq->yld_exp_empty, rq->yld_count, + "cpu%d %u %u %u %u %u %u %llu %llu %lu", + cpu, rq->yld_count, rq->sched_switch, rq->sched_count, rq->sched_goidle, rq->ttwu_count, rq->ttwu_local, rq->rq_cpu_time,Signature · 1 line
1.6.2Btw: I tried Greg schedtop with this patch and the app behaviour is as expected:
Quoted 2 lines
$ ./schedtop Exception: unsupported version
Mind updating the app too and post it here please? It's the only app that relies on this file AFAIK.
Ingo
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Luis Henriques
Quoted 9 lines
Quoted 5 lines
Btw: I tried Greg schedtop with this patch and the app behaviour is as expected:
$ ./schedtop Exception: unsupported versionMind updating the app too and post it here please? It's the only app that relies on this file AFAIK.
I can take care of the update if Luis can just confirm that this patch works as expected against his new ABI?
--
commit 336a22f597769bb5759d561773d05ce666019677
Author: Gregory Haskins <[email protected]> Date: Thu Mar 19 07:54:10 2009 -0400
Update to proposed v15 ABI
schedtop.cc +0 -0
@@ -114,7 +114,7 @@ public: throw std::runtime_error("error parsing
version");
lis >> m_version;
- if (m_version != 14)
+ if ((m_version < 14) || (m_version > 15))
throw std::runtime_error("unsupported version");
state = state_timestamp;
@@ -219,9 +219,11 @@ private:
std::string basename("/" + FormIndex("cpu", m_cpu) + "/rq/");
Importer importer(m_smap, is, basename);- importer += "yld_both_empty";
- importer += "yld_act_empty";
- importer += "yld_exp_empty";
+ if (m_version < 15){
+ importer += "yld_both_empty";
+ importer += "yld_act_empty";
+ importer += "yld_exp_empty";
+ }
importer += "yld_count";
importer += "sched_switch";
importer += "sched_count";----------------
If this patch works, you have my "Acked-by" for Luis' kernel-side patch.
-Greg
Quoted 11 lines · Gregory Haskins
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Luis Henriques
Btw: I tried Greg schedtop with this patch and the app behaviour is as expected:
$ ./schedtop Exception: unsupported version
Quoted 6 lines
Quoted 3 lines
Mind updating the app too and post it here please? It's the only app that relies on this file AFAIK.
I can take care of the update if Luis can just confirm that this patch works as expected against his new ABI?
Thanks, Greg. I just tested your patch to schedtop and I can confirm that it works just fine in both versions (for v14 and v15).
With respect to the changes to the sched_debug ABI, from what I understood no one is using it at the moment, right?
Quoted 43 lines
--
commit336a22f597769bb5759d561773d05ce666019677Author: Gregory Haskins <[email protected]> Date: Thu Mar 19 07:54:10 2009 -0400Update to proposed v15 ABI
Signed-off-by Gregory Haskins <[email protected]>schedtop.cc +1
-1@@ -114,7 +114,7 @@ public: throw std::runtime_error("error parsing version"); lis >> m_version; - if (m_version != 14) + if ((m_version < 14) || (m_version > 15)) throw std::runtime_error("unsupported version");state = state_timestamp;schedtop.cc +5
-4@@ -219,9 +219,11 @@ private: std::string basename("/" + FormIndex("cpu", m_cpu) + "/rq/"); Importer importer(m_smap, is, basename); - importer += "yld_both_empty"; - importer += "yld_act_empty"; - importer += "yld_exp_empty"; + if (m_version < 15){ + importer += "yld_both_empty"; + importer += "yld_act_empty"; + importer += "yld_exp_empty"; + } importer += "yld_count"; importer += "sched_switch"; importer += "sched_count"; ----------------
Quoted 1 line
If this patch works, you have my "Acked-by" for Luis' kernel-side patch.
Great! :-)
Regards,
Signature · 1 line
Luis Henriques
Quoted 5 lines · Luis Henriques
With respect to the changes to the
sched_debugABI, from what I understood no one is using it at the moment, right?
I am not aware of any users personally, but that doesn't mean a whole heck of a lot ;) Ingo and Peter probably have better insight here.
However, you did the proper thing from my perspective and bumped the version number. So even if there are users out there, it stands to reason they will likely pick up on the change in a deterministic manner anyway. Therefore, IMO you are all set.
Thanks Luis,
-Greg
Gregory Haskins
Acked-byQuoted 11 lines · Luis Henriques
Quoted 9 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Signed-off-by Luis Henriques <[email protected]>
Quoted 79 lines
Quoted 71 lines
--- kernel/sched.c | 3 --- kernel/sched_debug.c | 5 +---- kernel/sched_stats.h | 7 +++---- 3 files changed, 4 insertions(+), 11 deletions(-)kernel/sched.c +0
-3@@ -646,9 +646,6 @@ struct rq {/* could above be rq->cfs_rq.exec_clock + rq->rt_rq.rt_runtime ? */ /* sys_sched_yield() stats */ -unsigned int yld_exp_empty; -unsigned int yld_act_empty; -unsigned int yld_both_empty;unsigned int yld_count;/* schedule() stats */ kernel/sched_debug.c +1
-4@@ -286,9 +286,6 @@ static void print_cpu(struct seq_file *m, int cpu)#ifdef CONFIG_SCHEDSTATS #define P (n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n); -P (yld_exp_empty); -P (yld_act_empty); -P (yld_both_empty);P (yld_count);P (sched_switch);@@ -313,7 +310,7 @@ static int sched_debug_show(struct seq_file *m, void *v)u64 now =ktime_to_ns (ktime_get ());int cpu; -SEQ_printf (m,"Sched Debug Version: v0.08, %s %.*s\n" , +SEQ_printf (m,"Sched Debug Version: v0.09, %s %.*s\n" ,init_utsname ()->release, (int )strcspn (init_utsname ()->version," " ),init_utsname ()->version);kernel/sched_stats.h +3
-4@@ -4,7 +4,7 @@* bump this up when changing the output format or the meaning of an existing * format, so that tools can adapt (or abort) */ -#define SCHEDSTAT_VERSION 14 +#define SCHEDSTAT_VERSION 15static int show_schedstat (struct seq_file *seq,void *v) {@@ -26,9 +26,8 @@ static int show_schedstat(struct seq_file *seq, void *v)/* runqueue-specific stats */ seq_printf(seq, - "cpu%d %u %u %u %u %u %u %u %u %u %llu %llu %lu", - cpu, rq->yld_both_empty, - rq->yld_act_empty, rq->yld_exp_empty, rq->yld_count, + "cpu%d %u %u %u %u %u %u %llu %llu %lu", + cpu, rq->yld_count, rq->sched_switch, rq->sched_count, rq->sched_goidle, rq->ttwu_count, rq->ttwu_local, rq->rq_cpu_time,Signature · 1 line
1.6.2Btw: I tried Greg schedtop with this patch and the app behaviour is as expected:
$ ./schedtop Exception: unsupported versionRegards,
Quoted 7 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.
Hi Ingo,
Sorry to bother you but I can not find this patch in -tip. Just would like to confirm with you that it was NACK'ed or you just forgot to merge it to the tree.
Thanks,
Signature · 1 line
Luis Henriques
Quoted 9 lines · Luis Henriques
Quoted 7 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.
Quoted 5 lines
Hi Ingo,
Sorry to bother you but I can not find this patch in -tip. Just would like to confirm with you that it was NACK'ed or you just forgot to merge it to the tree.
Was held up by the schedstat tool discussions. Please resend the patch with a link to the updated tool in the commit log perhaps (if such a link exists), and with Gregory's ack in place.
Thanks,
Ingo
Quoted 20 lines · Ingo Molnar
Quoted 10 lines · Luis Henriques
Quoted 8 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Quoted 6 lines
Hi Ingo,
Sorry to bother you but I can not find this patch in -tip. Just would like to confirm with you that it was NACK'ed or you just forgot to merge it to the tree.
Quoted 8 lines
Was held up by the schedstat tool discussions. Please resend the patch with a link to the updated tool in the commit log perhaps (if such a link exists), and with Gregory's ack in place.
Thanks,
Ingo
Hi Ingo,
I was waiting to merge the tool patch until I was sure this would be
your blessed v15 of the ABI. If you are comfy with the kernel patch but want the tool updated before the kernel, I can do that, no problem. The only thing that I ask is that if for some reason this kernel patch doesn't make it in, please require any future patches that change this ABI to be versioned > 15 ;)
Thanks!
-Greg
Quoted 29 lines · Gregory Haskins
Quoted 20 lines · Ingo Molnar
Quoted 10 lines · Luis Henriques
Quoted 8 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Quoted 6 lines
Hi Ingo,
Sorry to bother you but I can not find this patch in -tip. Just would like to confirm with you that it was NACK'ed or you just forgot to merge it to the tree.
Quoted 8 lines
Was held up by the schedstat tool discussions. Please resend the patch with a link to the updated tool in the commit log perhaps (if such a link exists), and with Gregory's ack in place.
Thanks,
Ingo
Quoted 7 lines
Hi Ingo,
I was waiting to merge the tool patch until I was sure this would be
your blessed v15 of the ABI. If you are comfy with the kernel patch but want the tool updated before the kernel, I can do that, no problem. The only thing that I ask is that if for some reason this kernel patch doesn't make it in, please require any future patches that change this ABI to be versioned > 15 ;)
How about moving schedstat to Documentation/sched/schedstat.c or so? It's small and trivial enough, and that way changes would go hand in hand with the app.
Ingo
Quoted 46 lines · Ingo Molnar
Quoted 34 lines · Gregory Haskins
Quoted 23 lines · Ingo Molnar
Quoted 12 lines · Luis Henriques
Quoted 9 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Quoted 7 lines
Hi Ingo,
Sorry to bother you but I can not find this patch in -tip. Just would like to confirm with you that it was NACK'ed or you just forgot to merge it to the tree.
Quoted 9 lines
Was held up by the schedstat tool discussions. Please resend the patch with a link to the updated tool in the commit log perhaps (if such a link exists), and with Gregory's ack in place.
Thanks,
Ingo
Quoted 8 lines
Hi Ingo,
I was waiting to merge the tool patch until I was sure this would be
your blessed v15 of the ABI. If you are comfy with the kernel patch but want the tool updated before the kernel, I can do that, no problem. The only thing that I ask is that if for some reason this kernel patch doesn't make it in, please require any future patches that change this ABI to be versioned > 15 ;)
Quoted 4 lines
How about moving schedstat to
Documentation/sched/schedstat.cor so? It's small and trivial enough, and that way changes would go hand in hand with the app.
Oh, I misunderstood. The tool patch I was referencing is for my
schedtop tool that is in a separate tree and written in C++. In
retrospect, you probably don't care about the relative state of my tool coincident with the kernel side change, then. I agree that this other schedstat tool should probably be in-tree and patched at the same time as Luis' kernel patch.
FWIW: I have no problem with schedtop.cc going into the kernel as well if that is what you would like, but I figured I would be burned at the stake for suggestion such heresy as C++ in the tree ;)
-Greg
Hi,
Quoted 11 lines · Gregory Haskins
Quoted 4 lines
How about moving schedstat to
Documentation/sched/schedstat.cor so? It's small and trivial enough, and that way changes would go hand in hand with the app.Oh, I misunderstood. The tool patch I was referencing is for my
schedtop tool that is in a separate tree and written in C++. In
retrospect, you probably don't care about the relative state of my tool coincident with the kernel side change, then. I agree that this other schedstat tool should probably be in-tree and patched at the same time as Luis' kernel patch.
Quoted 3 lines
FWIW: I have no problem with schedtop.cc going into the kernel as well if that is what you would like, but I figured I would be burned at the stake for suggestion such heresy as C++ in the tree ;)
I also agree that there will be issues adding schedtop to the kernel tree, for two reasons: 1) it is written in C++ 2) it has dependencies on external libraries (libboost). So, unless the tool is re-written, I guess it will be difficult have it accepted. But that's just me saying this :-)
Now, to summarise and to check I understood everything correctly: I need to resend my patch (the kernel patch), adding a reference to the URL where schedtop can be obtained. Is this correct? Shall I use the URL to the git repository or to the rt wiki? Or both?
Signature · 1 line
Luis Henriques
Quoted 59 lines · Gregory Haskins
Quoted 46 lines · Ingo Molnar
Quoted 34 lines · Gregory Haskins
Quoted 23 lines · Ingo Molnar
Quoted 12 lines · Luis Henriques
Quoted 9 lines · Luis Henriques
Since they are used on in statistics and are always set to zero, the following fields from struct rq have been removed:
yld_exp_empty,yld_act_emptyandyld_both_empty.Both Sched Debug and
SCHEDSTAT_VERSIONversions has also been incremented since ABIs have been changed.Quoted 7 lines
Hi Ingo,
Sorry to bother you but I can not find this patch in -tip. Just would like to confirm with you that it was NACK'ed or you just forgot to merge it to the tree.
Quoted 9 lines
Was held up by the schedstat tool discussions. Please resend the patch with a link to the updated tool in the commit log perhaps (if such a link exists), and with Gregory's ack in place.
Thanks,
Ingo
Quoted 8 lines
Hi Ingo,
I was waiting to merge the tool patch until I was sure this would be
your blessed v15 of the ABI. If you are comfy with the kernel patch but want the tool updated before the kernel, I can do that, no problem. The only thing that I ask is that if for some reason this kernel patch doesn't make it in, please require any future patches that change this ABI to be versioned > 15 ;)Quoted 4 lines
How about moving schedstat to
Documentation/sched/schedstat.cor so? It's small and trivial enough, and that way changes would go hand in hand with the app.Oh, I misunderstood. The tool patch I was referencing is for my schedtop tool that is in a separate tree and written in C++. In retrospect, you probably don't care about the relative state of my tool coincident with the kernel side change, then. I agree that this other schedstat tool should probably be in-tree and patched at the same time as Luis' kernel patch.
Quoted 4 lines
FWIW: I have no problem with schedtop.cc going into the kernel as well if that is what you would like, but I figured I would be burned at the stake for suggestion such heresy as C++ in the tree ;)
i'd not mind it being added to the kernel tree, were it not for the extremely serious danger of irreversible mental contamination :)
Ingo