Re: horrible disk thorughput on itanium

Dan Kegel (dank@kegel.com)
Thu, 06 Dec 2001 22:42:03 -0800


Linus wrote:
> >> As far as I can see bonnie++ doesn't use putc_unlocked, but putc.
> >
> >Plain old Bonnie suffered from the same thing. I long ago made it
> >use putc_unlocked() here because throughput was horrible otherwise.
>
> Oh, yeah, blame it on bonnie.
>
> "Our C library 'putc' is horribly sucky"
>
> "Well, then, use something else then".
>
> Isn't somebody ashamed of glibc and willing to try to fix it? It might
> be as simple as just testing a static flag "have I used pthread_create"
> or even a function pointer that gets switched around at pthread_create..

That sounds racy. Better to make the change at compile time, maybe?
Say,

#ifdef __USE_REENTRANT
#define putc(_ch, _fp) _IO_putc (_ch, _fp)
#else
#define putc(_ch, _fp) _IO_putc_unlocked (_ch, _fp)
#endif

That's pedantically safe, I think.

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