Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Apr 2000 13:19:44 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        freebsd-hackers@freebsd.org
Subject:   Removing synchronizing instruction from MP unlock
Message-ID:  <200004262019.NAA97309@apollo.backplane.com>
References:   <Pine.BSF.4.21.0004260233030.47952-100000@achilles.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
    I had added a synchronizing instruction to the MP unlock code in
    November after the issue was brought up in the lists and linux folks
    thought there might be a synchronization issue.

    It turns out that there is no issue.  This was refered to me by
    Mike Silbersack:

    http://kernelnotes.org/lnxlists/linux-kernel/lk_0004_04/msg00332.html

    I have decided to remove the synchronizing instruction from the MP 
    unlock code.  There are three cases:

    * single cpu using the MP lock.

	- 200 nS faster with the synchronizing instruction removed.

    * two cpu's using the MP lock, in contention (one holds it while the
      other is trying to get it)

	- 700 nS SLOWER with the synchronizing instruction removed.

    * two cpu's using the MP lock, NOT in contention (one holds it and
      releases it, then sometime later the other holds it and releases
      it).

	- 400 ns FASTER.


    Since our goal is to reduce lock contention in the first place by
    removing the MP lock, and since the most common instance of MP
    use eats some user time and does not result in billions of short-term
    MP locks being simultaniously contended for by more then one cpu
    (this is different from long-term contention, where 700 nS doesn't
    matter anyway), I have decided to remove the synchronizing instruction
    from the unlock code for FreeBSD.

    Linus has indicated (if you follow the thread in the above URL),
    that he will be doing the same thing for the Linux MP unlock code
    as well.

    This is just a head's up.  No review is necessary.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004262019.NAA97309>