Re: Improve hackbench

From: Zhang, Yanmin
Date: Sun Jan 06 2008 - 20:30:30 EST


On Fri, 2008-01-04 at 07:44 -0500, Lee Revell wrote:
> On Jan 4, 2008 3:10 AM, Ingo Molnar <mingo@xxxxxxx> wrote:
> > http://redhat.com/~mingo/cfs-scheduler/tools/hackbench.c
> >
>
> Why not lose the #ifdef and just use PTHREAD_STACK_MIN?
That's a good idea.

Thanks,
-yanmin

---

--- hackbench.c.orig 2008-01-10 08:24:36.000000000 +0800
+++ hackbench.c 2008-01-10 08:25:12.000000000 +0800
@@ -151,10 +151,8 @@ pthread_t create_worker(void *ctx, void
if (pthread_attr_init(&attr) != 0)
barf("pthread_attr_init:");

-#ifndef __ia64__
- if (pthread_attr_setstacksize(&attr, (size_t)(16*1024)) != 0)
+ if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0)
barf("pthread_attr_setstacksize");
-#endif

if ((err=pthread_create(&childid, &attr, func, ctx)) != 0) {
fprintf(stderr, "pthread_create failed: %s (%d)\n", strerror(err), err);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/