public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Pirko <jpirko@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@redhat.com, peterz@infradead.org,
	jpirko@redhat.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/urgent] perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
Date: Tue, 11 Jan 2011 11:11:03 GMT	[thread overview]
Message-ID: <tip-12f7e0364375ba1ba55abcc5ac082b68fb526c80@git.kernel.org> (raw)
In-Reply-To: <20110110160417.GB2685@psychotron.brq.redhat.com>

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);

      parent reply	other threads:[~2011-01-11 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-12f7e0364375ba1ba55abcc5ac082b68fb526c80@git.kernel.org \
    --to=jpirko@redhat.com \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox