All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/perf: use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
@ 2011-01-10 16:04 Jiri Pirko
  2011-01-10 16:11 ` Arnaldo Carvalho de Melo
  2011-01-11 11:11 ` [tip:perf/urgent] perf sched: Use " tip-bot for Jiri Pirko
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Pirko @ 2011-01-10 16:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: a.p.zijlstra, paulus, mingo, acme

on ppc64:
/usr/include/bits/local_lim.h:#define PTHREAD_STACK_MIN	131072

therefore following set of commands:
# perf sched record date
# perf sched report

gives:
perf.2.6.37test: builtin-sched.c:493: create_tasks: Assertion `!(err)' failed.

So make sure we do not set stack size lower than PTHREAD_STACK_MIN.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 7a4ebeb..bec0161 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -489,7 +489,8 @@ static void create_tasks(void)
 
 	err = pthread_attr_init(&attr);
 	BUG_ON(err);
-	err = pthread_attr_setstacksize(&attr, (size_t)(16*1024));
+	err = pthread_attr_setstacksize(&attr,
+			(size_t) max(16 * 1024, PTHREAD_STACK_MIN));
 	BUG_ON(err);
 	err = pthread_mutex_lock(&start_work_mutex);
 	BUG_ON(err);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/perf: use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
  2011-01-10 16:04 [PATCH] tools/perf: use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail Jiri Pirko
@ 2011-01-10 16:11 ` Arnaldo Carvalho de Melo
  2011-01-11 11:11 ` [tip:perf/urgent] perf sched: Use " tip-bot for Jiri Pirko
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-01-10 16:11 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: linux-kernel, a.p.zijlstra, paulus, mingo

Em Mon, Jan 10, 2011 at 05:04:18PM +0100, Jiri Pirko escreveu:
> on ppc64:
> /usr/include/bits/local_lim.h:#define PTHREAD_STACK_MIN	131072
> 
> therefore following set of commands:
> # perf sched record date
> # perf sched report
> 
> gives:
> perf.2.6.37test: builtin-sched.c:493: create_tasks: Assertion `!(err)' failed.
> 
> So make sure we do not set stack size lower than PTHREAD_STACK_MIN.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>

Thanks, applying.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/urgent] perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
  2011-01-10 16:04 [PATCH] tools/perf: use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail Jiri Pirko
  2011-01-10 16:11 ` Arnaldo Carvalho de Melo
@ 2011-01-11 11:11 ` tip-bot for Jiri Pirko
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Pirko @ 2011-01-11 11:11 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, peterz, jpirko, tglx,
	mingo

Commit-ID:  12f7e0364375ba1ba55abcc5ac082b68fb526c80
Gitweb:     http://git.kernel.org/tip/12f7e0364375ba1ba55abcc5ac082b68fb526c80
Author:     Jiri Pirko <jpirko@redhat.com>
AuthorDate: Mon, 10 Jan 2011 14:14:23 -0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 10 Jan 2011 14:16:00 -0200

perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail

on ppc64:
/usr/include/bits/local_lim.h:#define PTHREAD_STACK_MIN	131072

therefore following set of commands:

gives:
perf.2.6.37test: builtin-sched.c:493: create_tasks: Assertion `!(err)' failed.

So make sure we do not set stack size lower than PTHREAD_STACK_MIN.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20110110160417.GB2685@psychotron.brq.redhat.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-sched.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 54024d2..abd4b84 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -489,7 +489,8 @@ static void create_tasks(void)
 
 	err = pthread_attr_init(&attr);
 	BUG_ON(err);
-	err = pthread_attr_setstacksize(&attr, (size_t)(16*1024));
+	err = pthread_attr_setstacksize(&attr,
+			(size_t) max(16 * 1024, PTHREAD_STACK_MIN));
 	BUG_ON(err);
 	err = pthread_mutex_lock(&start_work_mutex);
 	BUG_ON(err);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-11 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10 16:04 [PATCH] tools/perf: use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail Jiri Pirko
2011-01-10 16:11 ` Arnaldo Carvalho de Melo
2011-01-11 11:11 ` [tip:perf/urgent] perf sched: Use " tip-bot for Jiri Pirko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.