[tip:core/urgent] objtool: Fix memory leak in decode_instructions()
Commit-ID: b703798386fb7288d5a995bd2284a984a5e24f3c Gitweb: https://git.kernel.org/tip/b703798386fb7288d5a995bd2284a984a5e24f3c Author: Kamalesh BabulalAuthorDate: Thu, 19 Oct 2017 11:27:24 -0500 Committer: Ingo Molnar CommitDate: Fri, 20 Oct 2017 09:43:21 +0200 objtool: Fix memory leak in decode_instructions() When an error occurs before adding an allocated insn to the list, free it before returning. Signed-off-by: Kamalesh Babulal Signed-off-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/336da800bf6070eae11f4e0a3b9ca64c27658114.1508430423.git.jpoim...@redhat.com Signed-off-by: Ingo Molnar --- tools/objtool/check.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a0c518e..c0e26ad 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -267,12 +267,13 @@ static int decode_instructions(struct objtool_file *file) >immediate, >stack_op); if (ret) - return ret; + goto err; if (!insn->type || insn->type > INSN_LAST) { WARN_FUNC("invalid instruction type %d", insn->sec, insn->offset, insn->type); - return -1; + ret = -1; + goto err; } hash_add(file->insn_hash, >hash, insn->offset); @@ -296,6 +297,10 @@ static int decode_instructions(struct objtool_file *file) } return 0; + +err: + free(insn); + return ret; } /*
[tip:core/urgent] objtool: Fix memory leak in decode_instructions()
Commit-ID: b703798386fb7288d5a995bd2284a984a5e24f3c Gitweb: https://git.kernel.org/tip/b703798386fb7288d5a995bd2284a984a5e24f3c Author: Kamalesh Babulal AuthorDate: Thu, 19 Oct 2017 11:27:24 -0500 Committer: Ingo Molnar CommitDate: Fri, 20 Oct 2017 09:43:21 +0200 objtool: Fix memory leak in decode_instructions() When an error occurs before adding an allocated insn to the list, free it before returning. Signed-off-by: Kamalesh Babulal Signed-off-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/336da800bf6070eae11f4e0a3b9ca64c27658114.1508430423.git.jpoim...@redhat.com Signed-off-by: Ingo Molnar --- tools/objtool/check.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a0c518e..c0e26ad 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -267,12 +267,13 @@ static int decode_instructions(struct objtool_file *file) >immediate, >stack_op); if (ret) - return ret; + goto err; if (!insn->type || insn->type > INSN_LAST) { WARN_FUNC("invalid instruction type %d", insn->sec, insn->offset, insn->type); - return -1; + ret = -1; + goto err; } hash_add(file->insn_hash, >hash, insn->offset); @@ -296,6 +297,10 @@ static int decode_instructions(struct objtool_file *file) } return 0; + +err: + free(insn); + return ret; } /*
[tip:core/objtool] objtool: Print top level commands on incorrect usage
Commit-ID: 6a93bb7e4a7d6670677d5b0eb980936eb9cc5d2e Gitweb: https://git.kernel.org/tip/6a93bb7e4a7d6670677d5b0eb980936eb9cc5d2e Author: Kamalesh BabulalAuthorDate: Sat, 14 Oct 2017 20:17:54 +0530 Committer: Ingo Molnar CommitDate: Wed, 18 Oct 2017 15:22:26 +0200 objtool: Print top level commands on incorrect usage Print top-level objtool commands, along with the error on incorrect command line usage. Objtool command line parser exit's with code 129, for incorrect usage. Convert the cmd_usage() exit code also, to maintain consistency across objtool. After the patch: $ ./objtool -j Unknown option: -j usage: objtool COMMAND [ARGS] Commands: check Perform stack metadata validation on an object file orc Generate in-place ORC unwind tables for an object file $ echo $? 129 Signed-off-by: Kamalesh Babulal Acked-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1507992474-16142-1-git-send-email-kamal...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- tools/objtool/objtool.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c index 31e0f91..07f3299 100644 --- a/tools/objtool/objtool.c +++ b/tools/objtool/objtool.c @@ -70,7 +70,7 @@ static void cmd_usage(void) printf("\n"); - exit(1); + exit(129); } static void handle_options(int *argc, const char ***argv) @@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv) break; } else { fprintf(stderr, "Unknown option: %s\n", cmd); - fprintf(stderr, "\n Usage: %s\n", - objtool_usage_string); - exit(1); + cmd_usage(); } (*argv)++;
[tip:core/objtool] objtool: Print top level commands on incorrect usage
Commit-ID: 6a93bb7e4a7d6670677d5b0eb980936eb9cc5d2e Gitweb: https://git.kernel.org/tip/6a93bb7e4a7d6670677d5b0eb980936eb9cc5d2e Author: Kamalesh Babulal AuthorDate: Sat, 14 Oct 2017 20:17:54 +0530 Committer: Ingo Molnar CommitDate: Wed, 18 Oct 2017 15:22:26 +0200 objtool: Print top level commands on incorrect usage Print top-level objtool commands, along with the error on incorrect command line usage. Objtool command line parser exit's with code 129, for incorrect usage. Convert the cmd_usage() exit code also, to maintain consistency across objtool. After the patch: $ ./objtool -j Unknown option: -j usage: objtool COMMAND [ARGS] Commands: check Perform stack metadata validation on an object file orc Generate in-place ORC unwind tables for an object file $ echo $? 129 Signed-off-by: Kamalesh Babulal Acked-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1507992474-16142-1-git-send-email-kamal...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- tools/objtool/objtool.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c index 31e0f91..07f3299 100644 --- a/tools/objtool/objtool.c +++ b/tools/objtool/objtool.c @@ -70,7 +70,7 @@ static void cmd_usage(void) printf("\n"); - exit(1); + exit(129); } static void handle_options(int *argc, const char ***argv) @@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv) break; } else { fprintf(stderr, "Unknown option: %s\n", cmd); - fprintf(stderr, "\n Usage: %s\n", - objtool_usage_string); - exit(1); + cmd_usage(); } (*argv)++;
[tip:sched/core] sched/fair: Clean up update_sg_lb_stats() a bit
Commit-ID: 380c9077b38df2962a22f00f21f6cd0db62d3390 Gitweb: http://git.kernel.org/tip/380c9077b38df2962a22f00f21f6cd0db62d3390 Author: Kamalesh Babulal AuthorDate: Fri, 15 Nov 2013 15:06:52 +0530 Committer: Ingo Molnar CommitDate: Wed, 27 Nov 2013 13:50:57 +0100 sched/fair: Clean up update_sg_lb_stats() a bit Add rq->nr_running to sgs->sum_nr_running directly instead of assigning it through an intermediate variable nr_running. Signed-off-by: Kamalesh Babulal Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/1384508212-25032-1-git-send-email-kamal...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6cb36c7..a566c07 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5500,7 +5500,6 @@ static inline void update_sg_lb_stats(struct lb_env *env, struct sched_group *group, int load_idx, int local_group, struct sg_lb_stats *sgs) { - unsigned long nr_running; unsigned long load; int i; @@ -5509,8 +5508,6 @@ static inline void update_sg_lb_stats(struct lb_env *env, for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { struct rq *rq = cpu_rq(i); - nr_running = rq->nr_running; - /* Bias balancing toward cpus of our domain */ if (local_group) load = target_load(i, load_idx); @@ -5518,7 +5515,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, load = source_load(i, load_idx); sgs->group_load += load; - sgs->sum_nr_running += nr_running; + sgs->sum_nr_running += rq->nr_running; #ifdef CONFIG_NUMA_BALANCING sgs->nr_numa_running += rq->nr_numa_running; sgs->nr_preferred_running += rq->nr_preferred_running; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Clean up update_sg_lb_stats() a bit
Commit-ID: 380c9077b38df2962a22f00f21f6cd0db62d3390 Gitweb: http://git.kernel.org/tip/380c9077b38df2962a22f00f21f6cd0db62d3390 Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Fri, 15 Nov 2013 15:06:52 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Wed, 27 Nov 2013 13:50:57 +0100 sched/fair: Clean up update_sg_lb_stats() a bit Add rq-nr_running to sgs-sum_nr_running directly instead of assigning it through an intermediate variable nr_running. Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Signed-off-by: Peter Zijlstra pet...@infradead.org Link: http://lkml.kernel.org/r/1384508212-25032-1-git-send-email-kamal...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar mi...@kernel.org --- kernel/sched/fair.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6cb36c7..a566c07 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5500,7 +5500,6 @@ static inline void update_sg_lb_stats(struct lb_env *env, struct sched_group *group, int load_idx, int local_group, struct sg_lb_stats *sgs) { - unsigned long nr_running; unsigned long load; int i; @@ -5509,8 +5508,6 @@ static inline void update_sg_lb_stats(struct lb_env *env, for_each_cpu_and(i, sched_group_cpus(group), env-cpus) { struct rq *rq = cpu_rq(i); - nr_running = rq-nr_running; - /* Bias balancing toward cpus of our domain */ if (local_group) load = target_load(i, load_idx); @@ -5518,7 +5515,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, load = source_load(i, load_idx); sgs-group_load += load; - sgs-sum_nr_running += nr_running; + sgs-sum_nr_running += rq-nr_running; #ifdef CONFIG_NUMA_BALANCING sgs-nr_numa_running += rq-nr_numa_running; sgs-nr_preferred_running += rq-nr_preferred_running; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Fix trivial typos in comments
Commit-ID: ed1b7732868035990f07aeb532b1d86272ea909e Gitweb: http://git.kernel.org/tip/ed1b7732868035990f07aeb532b1d86272ea909e Author: Kamalesh Babulal AuthorDate: Sun, 13 Oct 2013 23:06:15 +0530 Committer: Ingo Molnar CommitDate: Mon, 14 Oct 2013 09:22:55 +0200 sched/fair: Fix trivial typos in comments - 'load_icx' => 'load_idx' - 'calculcate_imbalance' => 'calculate_imbalance' Signed-off-by: Kamalesh Babulal Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/1381685775-3544-1-git-send-email-kamal...@linux.vnet.ibm.com [ Also, don't capitalize 'idle' unnecessarily. ] Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8274679..4aa0b10 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5206,7 +5206,7 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds) /** * get_sd_load_idx - Obtain the load index for a given sched domain. * @sd: The sched_domain whose load_idx is to be obtained. - * @idle: The Idle status of the CPU for whose sd load_icx is obtained. + * @idle: The idle status of the CPU for whose sd load_idx is obtained. * * Return: The load index. */ @@ -5412,7 +5412,7 @@ fix_small_capacity(struct sched_domain *sd, struct sched_group *group) * moving tasks due to affinity constraints. * * When this is so detected; this group becomes a candidate for busiest; see - * update_sd_pick_busiest(). And calculcate_imbalance() and + * update_sd_pick_busiest(). And calculate_imbalance() and * find_busiest_group() avoid some of the usual balance conditions to allow it * to create an effective group imbalance. * -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Fix trivial typos in comments
Commit-ID: ed1b7732868035990f07aeb532b1d86272ea909e Gitweb: http://git.kernel.org/tip/ed1b7732868035990f07aeb532b1d86272ea909e Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Sun, 13 Oct 2013 23:06:15 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Mon, 14 Oct 2013 09:22:55 +0200 sched/fair: Fix trivial typos in comments - 'load_icx' = 'load_idx' - 'calculcate_imbalance' = 'calculate_imbalance' Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/1381685775-3544-1-git-send-email-kamal...@linux.vnet.ibm.com [ Also, don't capitalize 'idle' unnecessarily. ] Signed-off-by: Ingo Molnar mi...@kernel.org --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8274679..4aa0b10 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5206,7 +5206,7 @@ static inline void init_sd_lb_stats(struct sd_lb_stats *sds) /** * get_sd_load_idx - Obtain the load index for a given sched domain. * @sd: The sched_domain whose load_idx is to be obtained. - * @idle: The Idle status of the CPU for whose sd load_icx is obtained. + * @idle: The idle status of the CPU for whose sd load_idx is obtained. * * Return: The load index. */ @@ -5412,7 +5412,7 @@ fix_small_capacity(struct sched_domain *sd, struct sched_group *group) * moving tasks due to affinity constraints. * * When this is so detected; this group becomes a candidate for busiest; see - * update_sd_pick_busiest(). And calculcate_imbalance() and + * update_sd_pick_busiest(). And calculate_imbalance() and * find_busiest_group() avoid some of the usual balance conditions to allow it * to create an effective group imbalance. * -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/debug: Fix formatting of /proc//sched
Commit-ID: add332a1523a09cf6d429933f1e2fb4ccdfe6479 Gitweb: http://git.kernel.org/tip/add332a1523a09cf6d429933f1e2fb4ccdfe6479 Author: Kamalesh Babulal AuthorDate: Thu, 27 Jun 2013 22:20:05 +0530 Committer: Ingo Molnar CommitDate: Fri, 28 Jun 2013 11:13:35 +0200 sched/debug: Fix formatting of /proc//sched This patch alters format string's width, to align all statistics at par with the longest struct sched_statistic member name under /proc//sched. Signed-off-by: Kamalesh Babulal Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/20130627165005.ga15...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- kernel/sched/debug.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 62632098..1595614 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -493,15 +493,16 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, get_nr_threads(p)); SEQ_printf(m, - "-\n"); + "-" + "--\n"); #define __P(F) \ - SEQ_printf(m, "%-35s:%21Ld\n", #F, (long long)F) + SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F) #define P(F) \ - SEQ_printf(m, "%-35s:%21Ld\n", #F, (long long)p->F) + SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)p->F) #define __PN(F) \ - SEQ_printf(m, "%-35s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F)) + SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F)) #define PN(F) \ - SEQ_printf(m, "%-35s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F)) + SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F)) PN(se.exec_start); PN(se.vruntime); @@ -560,9 +561,9 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) } #endif __P(nr_switches); - SEQ_printf(m, "%-35s:%21Ld\n", + SEQ_printf(m, "%-45s:%21Ld\n", "nr_voluntary_switches", (long long)p->nvcsw); - SEQ_printf(m, "%-35s:%21Ld\n", + SEQ_printf(m, "%-45s:%21Ld\n", "nr_involuntary_switches", (long long)p->nivcsw); P(se.load.weight); @@ -585,7 +586,7 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) t0 = cpu_clock(this_cpu); t1 = cpu_clock(this_cpu); - SEQ_printf(m, "%-35s:%21Ld\n", + SEQ_printf(m, "%-45s:%21Ld\n", "clock-delta", (long long)(t1-t0)); } } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/debug: Fix formatting of /proc/PID/sched
Commit-ID: add332a1523a09cf6d429933f1e2fb4ccdfe6479 Gitweb: http://git.kernel.org/tip/add332a1523a09cf6d429933f1e2fb4ccdfe6479 Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Thu, 27 Jun 2013 22:20:05 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Fri, 28 Jun 2013 11:13:35 +0200 sched/debug: Fix formatting of /proc/PID/sched This patch alters format string's width, to align all statistics at par with the longest struct sched_statistic member name under /proc/PID/sched. Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/20130627165005.ga15...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar mi...@kernel.org --- kernel/sched/debug.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 62632098..1595614 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -493,15 +493,16 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) SEQ_printf(m, %s (%d, #threads: %d)\n, p-comm, p-pid, get_nr_threads(p)); SEQ_printf(m, - -\n); + - + --\n); #define __P(F) \ - SEQ_printf(m, %-35s:%21Ld\n, #F, (long long)F) + SEQ_printf(m, %-45s:%21Ld\n, #F, (long long)F) #define P(F) \ - SEQ_printf(m, %-35s:%21Ld\n, #F, (long long)p-F) + SEQ_printf(m, %-45s:%21Ld\n, #F, (long long)p-F) #define __PN(F) \ - SEQ_printf(m, %-35s:%14Ld.%06ld\n, #F, SPLIT_NS((long long)F)) + SEQ_printf(m, %-45s:%14Ld.%06ld\n, #F, SPLIT_NS((long long)F)) #define PN(F) \ - SEQ_printf(m, %-35s:%14Ld.%06ld\n, #F, SPLIT_NS((long long)p-F)) + SEQ_printf(m, %-45s:%14Ld.%06ld\n, #F, SPLIT_NS((long long)p-F)) PN(se.exec_start); PN(se.vruntime); @@ -560,9 +561,9 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) } #endif __P(nr_switches); - SEQ_printf(m, %-35s:%21Ld\n, + SEQ_printf(m, %-45s:%21Ld\n, nr_voluntary_switches, (long long)p-nvcsw); - SEQ_printf(m, %-35s:%21Ld\n, + SEQ_printf(m, %-45s:%21Ld\n, nr_involuntary_switches, (long long)p-nivcsw); P(se.load.weight); @@ -585,7 +586,7 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) t0 = cpu_clock(this_cpu); t1 = cpu_clock(this_cpu); - SEQ_printf(m, %-35s:%21Ld\n, + SEQ_printf(m, %-45s:%21Ld\n, clock-delta, (long long)(t1-t0)); } } -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/debug: Add load-tracking statistics to task
Commit-ID: 939fd731eb88a0cdd9058d0b0143563172a217d7 Gitweb: http://git.kernel.org/tip/939fd731eb88a0cdd9058d0b0143563172a217d7 Author: Kamalesh Babulal AuthorDate: Tue, 25 Jun 2013 13:33:36 +0530 Committer: Ingo Molnar CommitDate: Thu, 27 Jun 2013 10:07:46 +0200 sched/debug: Add load-tracking statistics to task At present we print per-entity load-tracking statistics for cfs_rq of cgroups/runqueues. Given that per task statistics is maintained, it can be used to know the contribution made by the task to its parenting cfs_rq level. This patch adds per-task load-tracking statistics to /proc//sched. Signed-off-by: Kamalesh Babulal Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/20130625080336.ga20...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- kernel/sched/debug.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index d803989..62632098 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -566,6 +566,12 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) "nr_involuntary_switches", (long long)p->nivcsw); P(se.load.weight); +#if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED) + P(se.avg.runnable_avg_sum); + P(se.avg.runnable_avg_period); + P(se.avg.load_avg_contrib); + P(se.avg.decay_count); +#endif P(policy); P(prio); #undef PN -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Fix typo describing flags in enqueue_entity
Commit-ID: 0fc576d592bd137437fdeb059738b789e642b744 Gitweb: http://git.kernel.org/tip/0fc576d592bd137437fdeb059738b789e642b744 Author: Kamalesh Babulal AuthorDate: Thu, 27 Jun 2013 11:24:18 +0530 Committer: Ingo Molnar CommitDate: Thu, 27 Jun 2013 10:18:25 +0200 sched/fair: Fix typo describing flags in enqueue_entity Fix spelling of 'calling' in description of se flags in enqueue_entity(). Signed-off-by: Kamalesh Babulal Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/20130627055418.ga18...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b43474a..f77f9c5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1760,7 +1760,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) { /* * Update the normalized vruntime before updating min_vruntime -* through callig update_curr(). +* through calling update_curr(). */ if (!(flags & ENQUEUE_WAKEUP) || (flags & ENQUEUE_WAKING)) se->vruntime += cfs_rq->min_vruntime; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched: Fix typo in struct sched_avg member description
Commit-ID: 239003ea2e30374d1cdfee788867e497cca2366c Gitweb: http://git.kernel.org/tip/239003ea2e30374d1cdfee788867e497cca2366c Author: Kamalesh Babulal AuthorDate: Thu, 27 Jun 2013 11:34:09 +0530 Committer: Ingo Molnar CommitDate: Thu, 27 Jun 2013 10:18:26 +0200 sched: Fix typo in struct sched_avg member description Remove extra 'for' from the description about member of struct sched_avg. Signed-off-by: Kamalesh Babulal Cc: p...@google.com Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/20130627060409.gb18...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 0019bef..ec80684 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -924,7 +924,7 @@ struct load_weight { struct sched_avg { /* * These sums represent an infinite geometric series and so are bound -* above by 1024/(1-y). Thus we only need a u32 to store them for for all +* above by 1024/(1-y). Thus we only need a u32 to store them for all * choices of y < 1-2^(-32)*1024. */ u32 runnable_avg_sum, runnable_avg_period; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Fix typo describing flags in enqueue_entity
Commit-ID: 0fc576d592bd137437fdeb059738b789e642b744 Gitweb: http://git.kernel.org/tip/0fc576d592bd137437fdeb059738b789e642b744 Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Thu, 27 Jun 2013 11:24:18 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Thu, 27 Jun 2013 10:18:25 +0200 sched/fair: Fix typo describing flags in enqueue_entity Fix spelling of 'calling' in description of se flags in enqueue_entity(). Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/20130627055418.ga18...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar mi...@kernel.org --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b43474a..f77f9c5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1760,7 +1760,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) { /* * Update the normalized vruntime before updating min_vruntime -* through callig update_curr(). +* through calling update_curr(). */ if (!(flags ENQUEUE_WAKEUP) || (flags ENQUEUE_WAKING)) se-vruntime += cfs_rq-min_vruntime; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched: Fix typo in struct sched_avg member description
Commit-ID: 239003ea2e30374d1cdfee788867e497cca2366c Gitweb: http://git.kernel.org/tip/239003ea2e30374d1cdfee788867e497cca2366c Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Thu, 27 Jun 2013 11:34:09 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Thu, 27 Jun 2013 10:18:26 +0200 sched: Fix typo in struct sched_avg member description Remove extra 'for' from the description about member of struct sched_avg. Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Cc: p...@google.com Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/20130627060409.gb18...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar mi...@kernel.org --- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 0019bef..ec80684 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -924,7 +924,7 @@ struct load_weight { struct sched_avg { /* * These sums represent an infinite geometric series and so are bound -* above by 1024/(1-y). Thus we only need a u32 to store them for for all +* above by 1024/(1-y). Thus we only need a u32 to store them for all * choices of y 1-2^(-32)*1024. */ u32 runnable_avg_sum, runnable_avg_period; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/debug: Add load-tracking statistics to task
Commit-ID: 939fd731eb88a0cdd9058d0b0143563172a217d7 Gitweb: http://git.kernel.org/tip/939fd731eb88a0cdd9058d0b0143563172a217d7 Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Tue, 25 Jun 2013 13:33:36 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Thu, 27 Jun 2013 10:07:46 +0200 sched/debug: Add load-tracking statistics to task At present we print per-entity load-tracking statistics for cfs_rq of cgroups/runqueues. Given that per task statistics is maintained, it can be used to know the contribution made by the task to its parenting cfs_rq level. This patch adds per-task load-tracking statistics to /proc/PID/sched. Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Signed-off-by: Peter Zijlstra pet...@infradead.org Link: http://lkml.kernel.org/r/20130625080336.ga20...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar mi...@kernel.org --- kernel/sched/debug.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index d803989..62632098 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -566,6 +566,12 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) nr_involuntary_switches, (long long)p-nivcsw); P(se.load.weight); +#if defined(CONFIG_SMP) defined(CONFIG_FAIR_GROUP_SCHED) + P(se.avg.runnable_avg_sum); + P(se.avg.runnable_avg_period); + P(se.avg.load_avg_contrib); + P(se.avg.decay_count); +#endif P(policy); P(prio); #undef PN -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Remove unused variable from expire_cfs_rq_runtime()
Commit-ID: 0de358f1c2642710d41190b73fbc295e675c4ab8 Gitweb: http://git.kernel.org/tip/0de358f1c2642710d41190b73fbc295e675c4ab8 Author: Kamalesh Babulal AuthorDate: Thu, 30 May 2013 14:34:20 +0530 Committer: Ingo Molnar CommitDate: Fri, 31 May 2013 13:02:29 +0200 sched/fair: Remove unused variable from expire_cfs_rq_runtime() Commit 78becc2709 ("sched: Use an accessor to read the rq clock") introduces rq_clock(), which obsoletes the use of the "rq" variable in expire_cfs_rq_runtime() and triggers this build warning: kernel/sched/fair.c: In function 'expire_cfs_rq_runtime': kernel/sched/fair.c:2159:13: warning: unused variable 'rq' [-Wunused-variable] Signed-off-by: Kamalesh Babulal Acked-by: Frederic Weisbecker Acked-by: Paul Turner Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/1369904660-14169-1-git-send-email-kamal...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3ee1c2e..143dcdb 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2156,7 +2156,6 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq) static void expire_cfs_rq_runtime(struct cfs_rq *cfs_rq) { struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg); - struct rq *rq = rq_of(cfs_rq); /* if the deadline is ahead of our clock, nothing to do */ if (likely((s64)(rq_clock(rq_of(cfs_rq)) - cfs_rq->runtime_expires) < 0)) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[tip:sched/core] sched/fair: Remove unused variable from expire_cfs_rq_runtime()
Commit-ID: 0de358f1c2642710d41190b73fbc295e675c4ab8 Gitweb: http://git.kernel.org/tip/0de358f1c2642710d41190b73fbc295e675c4ab8 Author: Kamalesh Babulal kamal...@linux.vnet.ibm.com AuthorDate: Thu, 30 May 2013 14:34:20 +0530 Committer: Ingo Molnar mi...@kernel.org CommitDate: Fri, 31 May 2013 13:02:29 +0200 sched/fair: Remove unused variable from expire_cfs_rq_runtime() Commit 78becc2709 (sched: Use an accessor to read the rq clock) introduces rq_clock(), which obsoletes the use of the rq variable in expire_cfs_rq_runtime() and triggers this build warning: kernel/sched/fair.c: In function 'expire_cfs_rq_runtime': kernel/sched/fair.c:2159:13: warning: unused variable 'rq' [-Wunused-variable] Signed-off-by: Kamalesh Babulal kamal...@linux.vnet.ibm.com Acked-by: Frederic Weisbecker fweis...@gmail.com Acked-by: Paul Turner p...@google.com Cc: pet...@infradead.org Link: http://lkml.kernel.org/r/1369904660-14169-1-git-send-email-kamal...@linux.vnet.ibm.com Signed-off-by: Ingo Molnar mi...@kernel.org --- kernel/sched/fair.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3ee1c2e..143dcdb 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2156,7 +2156,6 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq) static void expire_cfs_rq_runtime(struct cfs_rq *cfs_rq) { struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq-tg); - struct rq *rq = rq_of(cfs_rq); /* if the deadline is ahead of our clock, nothing to do */ if (likely((s64)(rq_clock(rq_of(cfs_rq)) - cfs_rq-runtime_expires) 0)) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/