linux-mips
[Top] [All Lists]

Re: [PATCH] fast path for rdhwr emulation for TLS

To: ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 15 Sep 2006 12:09:07 +0900 (JST)
Cc: linux-mips@linux-mips.org, macro@linux-mips.org
In-reply-to: <20060914172805.GA1756@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060709.011259.92587435.anemo@mba.ocn.ne.jp> <20060710.234010.07457279.anemo@mba.ocn.ne.jp> <20060914172805.GA1756@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 14 Sep 2006 18:28:05 +0100, Ralf Baechle <ralf@linux-mips.org> wrote:
> > Add special short path for emulationg RDHWR which is used to support
> > TLS.  The handle_tlbl synthesizer takes a care for
> > cpu_has_vtag_icache.
> 
> I'm just wondering if we actually need such optimizations.  Have you ran
> any application benchmarks?

I've measured time of NPTL pthread_mutex_lock/pthread_mutex_unlock loop.

        pthread_mutex_init(&m, NULL);
        gettimeofday(&start, NULL);
        for (i = 0; i < 1000000; i++) {
                pthread_mutex_lock(&m);
                pthread_mutex_unlock(&m);
        }
        gettimeofday(&end, NULL);


Without optimization:
        0.826407 sec / 1000000 loop

With optimization:
        0.415667 sec / 1000000 loop

It would be worth to do.
---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>