Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2000 21:27:57 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Alfred Perlstein <bright@wintelcom.net>, freebsd-current@FreeBSD.ORG
Subject:   Why are all accesses to the cpl surrounded by a lock?
Message-ID:  <200003250527.VAA19096@apollo.backplane.com>

next in thread | raw e-mail | index | archive | help
    I've been doing more SMP cleanup and for the life of me I can't figure
    out why cpl operations are surrounded by its own [S]CPL_LOCK ??

    As far as I can tell, the cpl is only accessed/modified:

	* by mainline code while the MP lock is held 
	* by an interrupt while the MP lock is held

    Since any modification of the cpl within an interrupt is paired and
    thus from the point of view of mainline code the cpl does not change
    at all (i.e. s = splvm(); ... splx(s);), I don't see why the cpl needs 
    to be locked at all.  We shouldn't even need to use a 'lock' prefix.

    Now, I understand that we eventually want to get out from under the MP
    lock's thumb, but it needs to be pointed out that the cpl mechanism
    itself is likely to be depreciated in favor of something more 
    thread-friendly.  I don't see any point in trying to make the cpl
    operate independantly of the MP lock at this time.

    Does anyone know why all the locking was added to the cpl code?

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


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




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