How would NT ensure the spin lock would be safe for the SMP (HT) case? I
have a situation that 2 DISPATCH_LEVEL threads may try to touch the same HW
register in my PCI card. Will a spin lock suffice?
AH
Express yourself instantly with MSN Messenger! Download today - it’s FREE!
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Spin locks in essecence do the following for acquistion:
- Raise to DISPATCH_LEVEL
- loop doing an interlocked exchange of the lock value with 1 till
the lock returns zero
This is simplified but basically the spin lock makes sure no one else holds
the lock before returning from the acquire. Now on a uni-processor system,
no one else can be running with the lock, so step 2 is dropped.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
“Ta H.” wrote in message news:xxxxx@ntdev…
> How would NT ensure the spin lock would be safe for the SMP (HT) case? I
> have a situation that 2 DISPATCH_LEVEL threads may try to touch the same
HW
> register in my PCI card. Will a spin lock suffice?
>
> AH
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it’s FREE!
> hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
Yes. That is the point of executive spinlocks - they provide atomic
operations for both SMP and UP systems for all threads <= DISPATCH_LEVEL.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ta H.
Sent: Saturday, October 02, 2004 2:28 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] DISPATCH_LEVEL and SMP
How would NT ensure the spin lock would be safe for the SMP
(HT) case? I have a situation that 2 DISPATCH_LEVEL threads
may try to touch the same HW register in my PCI card. Will a
spin lock suffice?
AH
Express yourself instantly with MSN Messenger! Download today
- it’s FREE!
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com
Yes, spinlock is designed for this.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Ta H.”
To: “Windows System Software Devs Interest List”
Sent: Saturday, October 02, 2004 10:27 AM
Subject: [ntdev] DISPATCH_LEVEL and SMP
> How would NT ensure the spin lock would be safe for the SMP (HT) case? I
> have a situation that 2 DISPATCH_LEVEL threads may try to touch the same HW
> register in my PCI card. Will a spin lock suffice?
>
> AH
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it’s FREE!
> hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
Assuming your threads only ever run at DISPATCH_LEVEL, a spin lock is
precisely what is needed. However, if you are tempted to touch them at
DIRQL (if you have an interrupt) you should examine a
SynchronizeExecution routine as it may (or may not) be required
depending on your situation.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ta H.
Sent: Friday, October 01, 2004 11:28 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] DISPATCH_LEVEL and SMP
How would NT ensure the spin lock would be safe for the SMP (HT) case?
I
have a situation that 2 DISPATCH_LEVEL threads may try to touch the
same HW
register in my PCI card. Will a spin lock suffice?
AH
Express yourself instantly with MSN Messenger! Download today - it’s
FREE!
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@nvidia.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Thanks.
One more thing I am not sure if it is related. As far as I know,
KeAcquireSpinLock() is implemented by “lock prefix” for x86. Does “lock
prefix” for HT behave the same as it does for SMP?
AH
From: “Mark Roddy”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: RE: [ntdev] DISPATCH_LEVEL and SMP
>Date: Sat, 2 Oct 2004 08:06:44 -0400
>
>Yes. That is the point of executive spinlocks - they provide atomic
>operations for both SMP and UP systems for all threads <= DISPATCH_LEVEL.
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Ta H.
> > Sent: Saturday, October 02, 2004 2:28 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] DISPATCH_LEVEL and SMP
> >
> > How would NT ensure the spin lock would be safe for the SMP
> > (HT) case? I have a situation that 2 DISPATCH_LEVEL threads
> > may try to touch the same HW register in my PCI card. Will a
> > spin lock suffice?
> >
> > AH
> >
> >
> > Express yourself instantly with MSN Messenger! Download today
> > - it’s FREE!
> > hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@hollistech.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
Express yourself instantly with MSN Messenger! Download today - it’s FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Let me make this completely clear.
HT is the same as SMP, except for performance. Please forget worrying about
the difference.
–
Jake Oshins
Windows Kernel Group
This posting is provided “AS IS” with no warranties, and confers no rights.
“Ta H.” wrote in message news:xxxxx@ntdev…
> Thanks.
>
> One more thing I am not sure if it is related. As far as I know,
> KeAcquireSpinLock() is implemented by “lock prefix” for x86. Does “lock
> prefix” for HT behave the same as it does for SMP?
>
> AH
>
>
>>From: “Mark Roddy”
>>Reply-To: “Windows System Software Devs Interest List”
>>
>>To: “Windows System Software Devs Interest List”
>>Subject: RE: [ntdev] DISPATCH_LEVEL and SMP
>>Date: Sat, 2 Oct 2004 08:06:44 -0400
>>
>>Yes. That is the point of executive spinlocks - they provide atomic
>>operations for both SMP and UP systems for all threads <= DISPATCH_LEVEL.
>>
>>
>> > -----Original Message-----
>> > From: xxxxx@lists.osr.com
>> > [mailto:xxxxx@lists.osr.com] On Behalf Of Ta H.
>> > Sent: Saturday, October 02, 2004 2:28 AM
>> > To: Windows System Software Devs Interest List
>> > Subject: [ntdev] DISPATCH_LEVEL and SMP
>> >
>> > How would NT ensure the spin lock would be safe for the SMP
>> > (HT) case? I have a situation that 2 DISPATCH_LEVEL threads
>> > may try to touch the same HW register in my PCI card. Will a
>> > spin lock suffice?
>> >
>> > AH
>> >
>> >
>> > Express yourself instantly with MSN Messenger! Download today
>> > - it’s FREE!
>> > hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>> >
>> >
>> >
>> > —
>> > Questions? First check the Kernel Driver FAQ at
>> > http://www.osronline.com/article.cfm?id=256
>> >
>> > You are currently subscribed to ntdev as:
>> > xxxxx@hollistech.com To unsubscribe send a blank email to
>> > xxxxx@lists.osr.com
>> >
>>
>>
>>
>>
>>
>>—
>>Questions? First check the Kernel Driver FAQ at
>>http://www.osronline.com/article.cfm?id=256
>>
>>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> Express yourself instantly with MSN Messenger! Download today - it’s FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
KeAcquireSpinLock is implemented with the help of locked instructions but
not only by locked instructions. Step through spinlock acquire/release on a
SMP or HT system for the gory details. X86 locked instructions provide
identical behavior on HT systems as they do on SMP systems, at least as far
as observed behavior is concerned. As an SMP system can also be an HT
system, this is pretty much a requirement, right?
=====================
Mark Roddy
-----Original Message-----
From: Ta H. [mailto:xxxxx@hotmail.com]
Sent: Monday, October 04, 2004 5:29 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] DISPATCH_LEVEL and SMP
Thanks.
One more thing I am not sure if it is related. As far as I know,
KeAcquireSpinLock() is implemented by “lock prefix” for x86. Does “lock
prefix” for HT behave the same as it does for SMP?
AH
From: “Mark Roddy”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: RE: [ntdev] DISPATCH_LEVEL and SMP
>Date: Sat, 2 Oct 2004 08:06:44 -0400
>
>Yes. That is the point of executive spinlocks - they provide atomic
>operations for both SMP and UP systems for all threads <= DISPATCH_LEVEL.
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Ta H.
> > Sent: Saturday, October 02, 2004 2:28 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] DISPATCH_LEVEL and SMP
> >
> > How would NT ensure the spin lock would be safe for the SMP
> > (HT) case? I have a situation that 2 DISPATCH_LEVEL threads may
> > try to touch the same HW register in my PCI card. Will a spin lock
> > suffice?
> >
> > AH
> >
> >
> > Express yourself instantly with MSN Messenger! Download today
> > - it’s FREE!
> > hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@hollistech.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
Express yourself instantly with MSN Messenger! Download today - it’s FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com