This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/6932] c->busy can be non-atomic.
- From: "mhiramat at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 13 Nov 2008 16:05:10 -0000
- Subject: [Bug translator/6932] c->busy can be non-atomic.
- References: <20081001203800.6932.mhiramat@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From mhiramat at redhat dot com 2008-11-13 16:05 -------
hmm, if we use per-cpu variable for nesting flag, I think
interrupts don't need to check it atomically.(as far as I know,
the preemption is disabled there...)
The operation can be separated into 4 phases
---
1. read flag
2. write flag=1 if (flag == 0)
3. doing some
4. write flag=0
---
If an interrupt occurs between 2 and 4,
---
1. read flag
2. write flag=1 if (flag == 0)
>>
1. read flag
2. return due to flag == 1
<<
3. doing some
>>
1. read flag
2. return due to flag == 1
<<
4. write flag=0
---
This case, the flag is operated correctly.
If an interrupt occurs between 1 and 2,
---
1. read flag
>>
1. read flag
2. write flag=1 if (flag == 0)
3. doing some
4. write flag=0
<<
2. write flag=1 if (flag == 0)
3. doing some
4. write flag=0
---
Even this case, the flag is correctly operated, because this
case is same as an interrupt happens right before 1.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6932
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.