Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exi386InterlockedExchangeUlong

1 view
Skip to first unread message

Garfield A. Lewis

unread,
Sep 25, 1997, 3:00:00 AM9/25/97
to

This is a multi-part message in MIME format.
--------------530C391052DD518DD2F904B5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

During some performance tuning I have come across the subject function
as a major time consumer while viewing through VTune.
I am unfamiliar with this functiion and cannot find any reference to it
in MSDEV or in MS TecNet. Could someone please let me
know what this function is, when it gets called, where I can find it
documented and any other info I can get about it. I am using
NT 4.00.1381.

--
Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------530C391052DD518DD2F904B5
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------530C391052DD518DD2F904B5--


Garfield A. Lewis

unread,
Sep 26, 1997, 3:00:00 AM9/26/97
to

This is a multi-part message in MIME format.
--------------AD18C42BB8F65642615C453B

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Garfield A. Lewis wrote:

> Hi,
>
> During some performance tuning I have come across the subject function
> as a major time consumer while viewing through VTune.
> I am unfamiliar with this functiion and cannot find any reference to it
> in MSDEV or in MS TecNet. Could someone please let me
> know what this function is, when it gets called, where I can find it
> documented and any other info I can get about it. I am using
> NT 4.00.1381.
>

Is there anyone from MS (or anywhere else) out there that could answer my question?????????

--
Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------AD18C42BB8F65642615C453B


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------AD18C42BB8F65642615C453B--


Eliyas Yakub

unread,
Sep 26, 1997, 3:00:00 AM9/26/97
to

Exi386InterlockedExchangeUlong is i386 architectural specific version of
ExInterlockedExchangeUlong.
ExInterlockedExchangeUlong is macroed to Exi386 when built on i386. No
source calls it directly.

Eliyas


Eliyas Yakub

unread,
Sep 26, 1997, 3:00:00 AM9/26/97
to

small correction here:

Some of the Ex arithmatice functions are macroed to Exi386 optimized
version when built on x86.

Eliyas


Garfield A. Lewis

unread,
Sep 29, 1997, 3:00:00 AM9/29/97
to

This is a multi-part message in MIME format.
--------------FFFED2512708DF730F1ACCD2

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Eliyas Yakub wrote:

Where would I find more information about these Ex functions? I would
like to know why we are using them so much.

--
Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------FFFED2512708DF730F1ACCD2


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------FFFED2512708DF730F1ACCD2--


Eliyas Yakub

unread,
Sep 29, 1997, 3:00:00 AM9/29/97
to

Check the reference section of MSDN Kernel-mode drivers design guide.

Tom Stonecypher

unread,
Sep 29, 1997, 3:00:00 AM9/29/97
to

In article <342BE934...@vnet.ibm.com>, "Garfield A. Lewis" <gal...@vnet.ibm.com> says:
>> During some performance tuning I have come across the subject function
>> as a major time consumer while viewing through VTune.

I have seen this problem when using the kernel profiler. The problem
is that you don't have sufficient resolution in the symbols that are
built in to the NT executables. I'm not sure how VTune works with
symbols, but installing the full symbol tree from the installation
fixed the problem for kernprof.

Here's how:
Copy the appropriate expanded symbol tree onto the system under test,
from the installation CD or from the service pack, if you're running
a service pack. Define environment variable _NT_SYMBOL_PATH
to point to the symbol tree. Don't forget to copy 'correcthal'.dbg
to symbols\dll\hal.dbg and, if you're running on a multiprocessor,
copy symbols\exe\ntkrnlmp.dbg to symbols\exe\ntoskrnl.dbg.

Jan Beulich

unread,
Sep 30, 1997, 3:00:00 AM9/30/97
to

Garfield A. Lewis wrote:
>
> Garfield A. Lewis wrote:
>
> > Hi,
> >
> > During some performance tuning I have come across the subject function
> > as a major time consumer while viewing through VTune.
> > I am unfamiliar with this functiion and cannot find any reference to it
> > in MSDEV or in MS TecNet. Could someone please let me
> > know what this function is, when it gets called, where I can find it
> > documented and any other info I can get about it. I am using
> > NT 4.00.1381.
> >
>
> Is there anyone from MS (or anywhere else) out there that could answer my question?????????
>
> --
> Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
> DB2 Performance (416) 448-3438 T/L: 778-3438
> IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>
>
> ---------------------------------------------------------------
>
> Name: vcard.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for Garfield Lewis
The function does what its name says: It exchanges the long value stored
in memory with a new value, not allowing bus accesses from other bus
masters (eg. a second CPU) during this operation to guarantee atomicity
of the operation. Look at Win32's InterlockedExchange() for what this
function does, your function is just a kernel-internal, i386 specific
equivalent of it. It can be called by anyone at any time, but it
definitely takes no longer than a few clocks to execute, the only
performance-wise bad thing is the bus lock lasting for a few cycles. But
I doubt any profiler would point out this function as problematic.
--
-----------------------------
Jan Beulich
Novell Developer Support
email: DevSu...@Novell.com

Please, respond to news group messages only by another posting, not by
email.

Stephan Wolf

unread,
Sep 30, 1997, 3:00:00 AM9/30/97
to

On 29 Sep 97 16:45:29 GMT, Tom.Sto...@ColumbiaSC.ncr.com.no-spams
(Tom Stonecypher) wrote:

...


> Don't forget to copy 'correcthal'.dbg
>to symbols\dll\hal.dbg and, if you're running on a multiprocessor,
>copy symbols\exe\ntkrnlmp.dbg to symbols\exe\ntoskrnl.dbg.

AFAIK, renaming the 'WhateverHal'.dbg to hal.dbg or renaming
'WhatverKernel'.dbg to ntoskrnl.dbg is *not* necessary as the correct
(i.e. original) name of the .dbg file is actually contained in the
executable file (hal.dll and ntoskrnl.exe).

(In other words, the executables are always renamed to hal.dll and
ntoskrnl.exe when you install NT, but renaming the .dbg files is never
necessary.)

Stephan Wolf <sw...@syskonnect.de> http://www.syskonnect.de
SysKonnect - The Server Connectivity Company

Geoff Chappell

unread,
Sep 30, 1997, 3:00:00 AM9/30/97
to

Garfield A. Lewis <gal...@vnet.ibm.com> wrote in article
<342AF104...@vnet.ibm.com>...
> ... Could someone please let me

> know what this function is, when it gets called, where I can find it
> documented and any other info I can get about it. I am using
> NT 4.00.1381.

The x86 NTOSKRNL also exports the Exfi386InterlockedExchangeUlong as
simply InterlockedExchange. In turn, this function is documented in the NT
DDK - in the section headed Executive Support Routines.

This documentation describes the ExInterlockedExchangeUlong function as
obsolete and the NTDDK.H header defines ExInterlockedExchangeUlong as a
macro that expands to Exfi386InterlockedExchangeUlong.

--
Geoff Chappell
Software Analyst

For email address change host to ozemail.com.au
Web site in directory ~geoffch at www.ozemail.com.au

Garfield A. Lewis

unread,
Sep 30, 1997, 3:00:00 AM9/30/97
to

This is a multi-part message in MIME format.
--------------59486B9DDA07C50203EA56C6

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Tom Stonecypher wrote:

> I have seen this problem when using the kernel profiler. The problem
> is that you don't have sufficient resolution in the symbols that are
> built in to the NT executables. I'm not sure how VTune works with
> symbols, but installing the full symbol tree from the installation
> fixed the problem for kernprof.
>
> Here's how:
> Copy the appropriate expanded symbol tree onto the system under test,
> from the installation CD or from the service pack, if you're running
> a service pack. Define environment variable _NT_SYMBOL_PATH

> to point to the symbol tree. Don't forget to copy 'correcthal'.dbg


> to symbols\dll\hal.dbg and, if you're running on a multiprocessor,
> copy symbols\exe\ntkrnlmp.dbg to symbols\exe\ntoskrnl.dbg.

Sorry Tom,

I'm confused how does the symbol files help me to find out why this function is so hot? Is there
a way of gathering information regarding who is calling a particular function? I thought the only
info you could get was what function is being called not the callee info?

--
Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------59486B9DDA07C50203EA56C6


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------59486B9DDA07C50203EA56C6--


Garfield A. Lewis

unread,
Sep 30, 1997, 3:00:00 AM9/30/97
to

This is a multi-part message in MIME format.
--------------7F2451B819264DD48FCF01FB

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Eliyas Yakub wrote:

> Check the reference section of MSDN Kernel-mode drivers design guide.

This function is being called by ntoskrnl.exe (on 4-way SMP running NT 4.0
SP3). What is it doing in ntoskrnl.exe? It is taking up >90% of my
processing time. Could you please tell me what it is doing? I have no way
of knowing what ntoskrnl.exe is doing. I've looked at the MSDN reference
and it simply states that this updates a Target with some value. Why/when
is this happening? If this api was being called by my code it would be
easy but I do not have any source for ntoskrnl.exe so I can't find this
myself and as I've stated earlier looking at the MSDN reference is
basically a waste of time.

Intrestingly I do not get this problem on a UNI running NT 4.0 with no
service packs (haven't been able to apply any SPs because my boot drive is
too small). Also, if I boot up with 1 processor on the 4-way the calls to
ntoskrnl.exe drops dramatically to <16%. I'm now wondering if this a
problem with my application or the OS Kernel itself?

--
Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------7F2451B819264DD48FCF01FB


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------7F2451B819264DD48FCF01FB--


Geoff Chappell

unread,
Oct 2, 1997, 3:00:00 AM10/2/97
to

Garfield A. Lewis <gal...@vnet.ibm.com> wrote in article
<343186E5...@vnet.ibm.com>...

> I'm confused how does the symbol files help me to find out why this
function is so hot?

I think the argument here is that the function is being misidentified
(i.e., reported to you as Exi386InterlockedExchangeUlong when it is really
some other function) because the profiler is using an incorrect symbol
file.

Perhaps if you could post the relevant line or lines of output, it may be
possible to get a better idea of whether the function has been identified
correctly. I haven't used the profiler, but if it gives addresses as well
as symbols, what address was given alongside the symbol?

Garfield A. Lewis

unread,
Oct 6, 1997, 3:00:00 AM10/6/97
to

This is a multi-part message in MIME format.
--------------267E111066F2F99543F8F6B5

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Geoff Chappell wrote:

Goeff,

I am not using the WinNT profiler, I am using a tool from Intel called VTune.
It is a GUI tool which reports, among other things, hot spots within your code
and throughout the system. It does not require the symbol files for this
information. At any rate I've tried with the symbol files and get the same
thing. However, I will dump the data from the GUI into a file and the verify
that the correct addresses are given as you suggested.

Thx...

--
Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------267E111066F2F99543F8F6B5


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------267E111066F2F99543F8F6B5--


gal...@vnet.ibm.com

unread,
Oct 7, 1997, 3:00:00 AM10/7/97
to

This is a multi-part message in MIME format.
--------------9A2723F1EFBF37D2442DBEBA

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Tom,

Thx, for your help. After installing the symbol files the bottle neck now points to KiIdleLoop
which for my machine seems logical. I am now going to verify my results again but I can see in
the Task Manager that the idle process is using >95% of the CPU. Again, Tom and all others who
posted, thanks for you help.

Tom Stonecypher wrote:

> In article <342BE934...@vnet.ibm.com>, "Garfield A. Lewis" <gal...@vnet.ibm.com> says:

> >> During some performance tuning I have come across the subject function
> >> as a major time consumer while viewing through VTune.
>

> I have seen this problem when using the kernel profiler. The problem
> is that you don't have sufficient resolution in the symbols that are
> built in to the NT executables. I'm not sure how VTune works with
> symbols, but installing the full symbol tree from the installation
> fixed the problem for kernprof.
>
> Here's how:
> Copy the appropriate expanded symbol tree onto the system under test,
> from the installation CD or from the service pack, if you're running
> a service pack. Define environment variable _NT_SYMBOL_PATH
> to point to the symbol tree. Don't forget to copy 'correcthal'.dbg
> to symbols\dll\hal.dbg and, if you're running on a multiprocessor,
> copy symbols\exe\ntkrnlmp.dbg to symbols\exe\ntoskrnl.dbg.

--


Garfield A. Lewis <mailto:gal...@vnet.ibm.com>
DB2 Performance (416) 448-3438 T/L: 778-3438
IBM SWS Toronto Laboratory <http://w3.torolab.ibm.com/~garfield>


--------------9A2723F1EFBF37D2442DBEBA


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Garfield Lewis
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Garfield Lewis
n: Lewis;Garfield
org: IBM SWS Toronto Laboratory
adr: II50 Eglinton Ave. East;;;Toronto;Ontario;M3C-1H7;Canada
email;internet: gal...@vnet.ibm.com
title: DB2 Performance
tel;work: (416) 448-3438
tel;fax: (416) 448-4414
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------9A2723F1EFBF37D2442DBEBA--


0 new messages