[Bug 1809] New: SMP : Lock/Unlock critical Section

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue May 24 14:36:17 UTC 2011


           Summary: SMP : Lock/Unlock critical Section
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: frederic.brault at kalray.eu

Created an attachment (id=1190)
 --> (https://www.rtems.org/bugzilla/attachment.cgi?id=1190)
lock/unlock critical sections

This is a rather big patch, impacting many files.

It adds a call to _Lock_Critical_Section and _Unlock_Critical_Section around
critical sections. Until then, those sections were mostly protected by calls to

At first, the approach we took was just to overload ISR_Enable/Disable and add
a lock in this macro. But it turned out this approach is counterproductive
since it mixes up two things which are fundamentaly different : locking to
protect critical code sections in an SMP contetx, and setting interrupt level.

So this patch does it the hard way and adds two macros :

- _Lock_Critical_Section
- _Unlock_Critical_Section

For now, they are left blank. In our implementation, we use a
"Big_Kernel_Lock", but that's another topic. 

This patch can be seen as a first attempt to identify critical section in SMP

Most of the time, it's basically just adding a _Lock_Critical_Section() right
next to ISR_Disable, and _Unlock next to ISR_Disable.

However, we have started in some places to move locks around for correctness
and/or optimization.

Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the bugs mailing list