ExQueueWorkItem Problem.

Hi,

I have tracked a problem with the machine hanging down to a work item which
is queued but never gets called. At the moment the problem is only exhibited
when filtering LanmanRedirector.

I am calling ExQueueWorkItem from the completion routine for an
IRP_MJ_CREATE request.
Normally after the work item is queued the completion routine returns
STATUS_MORE_PROCESSING_REQUIRED, and the worker would the irp.

Under what circumstances will a queued worker not get called? (and cause the
machine to hang)

Rob Linegar
Software Engineer
Data Encryption Systems Limited

If you for. eg specify bad routine address - into nonpaged system
address space
where every page fault comes to BSOD.

Try to verify what you’re passing to the ExQueueWorkItem.

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Linegar
Sent: Friday, September 22, 2000 3:51 PM
To: File Systems Developers
Subject: [ntfsd] ExQueueWorkItem Problem.

Hi,

I have tracked a problem with the machine hanging down to a work item
which
is queued but never gets called. At the moment the problem is only
exhibited
when filtering LanmanRedirector.

I am calling ExQueueWorkItem from the completion routine for an
IRP_MJ_CREATE request.
Normally after the work item is queued the completion routine returns
STATUS_MORE_PROCESSING_REQUIRED, and the worker would the irp.

Under what circumstances will a queued worker not get called? (and cause
the
machine to hang)

Rob Linegar
Software Engineer
Data Encryption Systems Limited


You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

The driver is non paged, so the routine address is correct.
The machine doesn’t BSOD, it just hangs, things running still work for a
bit.
In my case the problem only occurs when i receive 5 opens in quick
succession.
The worker routine does re call into the target driver to perform a read.
I suspect that this may be due to a reentrancy issue of some kind.

Rob Linegar
Software Engineer
Data Encryption Systems Limited

-----Original Message-----
From: Hrdina Pavel [mailto:xxxxx@COMPELSON.COM]
Sent: 22 September 2000 15:56
To: File Systems Developers
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

If you for. eg specify bad routine address - into nonpaged system address
space
where every page fault comes to BSOD.
Try to verify what you’re passing to the ExQueueWorkItem.
Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Linegar
Sent: Friday, September 22, 2000 3:51 PM
To: File Systems Developers
Subject: [ntfsd] ExQueueWorkItem Problem.

Hi,
I have tracked a problem with the machine hanging down to a work item which
is queued but never gets called. At the moment the problem is only exhibited

when filtering LanmanRedirector.
I am calling ExQueueWorkItem from the completion routine for an
IRP_MJ_CREATE request.
Normally after the work item is queued the completion routine returns
STATUS_MORE_PROCESSING_REQUIRED, and the worker would the irp.
Under what circumstances will a queued worker not get called? (and cause the

machine to hang)
Rob Linegar
Software Engineer
Data Encryption Systems Limited

You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

You have a worker thread deadlock - you are blocking worker threads, and
queuing a work item to the queue. Since the worker threads are waiting for
you and you are waiting for them, you have introduced a deadlock.

In general, it is a “bad idea” to use the system work queues when calling
the OS file systems - they also use the system work queues, and this
introduces deadlocks that show up in exactly the type of situations you
describe.

This issue has been resolved in Windows 2000 because the OS will now grow
the number of worker threads as needed to avoid this type of deadlock.

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Rob Linegar [mailto:xxxxx@des.co.uk]
Sent: Friday, September 22, 2000 11:15 AM
To: File Systems Developers
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

The driver is non paged, so the routine address is correct.
The machine doesn’t BSOD, it just hangs, things running still work for a
bit.
In my case the problem only occurs when i receive 5 opens in quick
succession.
The worker routine does re call into the target driver to perform a read.
I suspect that this may be due to a reentrancy issue of some kind.

Rob Linegar
Software Engineer
Data Encryption Systems Limited

-----Original Message-----
From: Hrdina Pavel [mailto:xxxxx@COMPELSON.COM]
Sent: 22 September 2000 15:56
To: File Systems Developers
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

If you for. eg specify bad routine address - into nonpaged system address
space
where every page fault comes to BSOD.
Try to verify what you’re passing to the ExQueueWorkItem.
Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Linegar
Sent: Friday, September 22, 2000 3:51 PM
To: File Systems Developers
Subject: [ntfsd] ExQueueWorkItem Problem.

Hi,
I have tracked a problem with the machine hanging down to a work item which
is queued but never gets called. At the moment the problem is only exhibited

when filtering LanmanRedirector.
I am calling ExQueueWorkItem from the completion routine for an
IRP_MJ_CREATE request.
Normally after the work item is queued the completion routine returns
STATUS_MORE_PROCESSING_REQUIRED, and the worker would the irp.
Under what circumstances will a queued worker not get called? (and cause the

machine to hang)
Rob Linegar
Software Engineer
Data Encryption Systems Limited

You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

At minimum, it is a bad idea to use more than 1 at a time. Do not queue
an indefinite number of workitems to a worker queue, otherwise they can
saturate it and you get exactly the deadlocks Tony describes. Use single
workitems that process an internal queue of requests you maintain.

-----Original Message-----
From: Tony Mason [mailto:xxxxx@osr.com]
Sent: Friday, September 22, 2000 8:19 AM
To: File Systems Developers
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

You have a worker thread deadlock - you are blocking worker threads, and
queuing a work item to the queue. Since the worker threads are waiting
for
you and you are waiting for them, you have introduced a deadlock.

In general, it is a “bad idea” to use the system work queues when
calling
the OS file systems - they also use the system work queues, and this
introduces deadlocks that show up in exactly the type of situations you
describe.

This issue has been resolved in Windows 2000 because the OS will now
grow
the number of worker threads as needed to avoid this type of deadlock.

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Rob Linegar [mailto:xxxxx@des.co.uk]
Sent: Friday, September 22, 2000 11:15 AM
To: File Systems Developers
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

The driver is non paged, so the routine address is correct.
The machine doesn’t BSOD, it just hangs, things running still work for a
bit.
In my case the problem only occurs when i receive 5 opens in quick
succession.
The worker routine does re call into the target driver to perform a
read.
I suspect that this may be due to a reentrancy issue of some kind.

Rob Linegar
Software Engineer
Data Encryption Systems Limited

-----Original Message-----
From: Hrdina Pavel [mailto:xxxxx@COMPELSON.COM]
Sent: 22 September 2000 15:56
To: File Systems Developers
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

If you for. eg specify bad routine address - into nonpaged system
address
space
where every page fault comes to BSOD.
Try to verify what you’re passing to the ExQueueWorkItem.
Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Linegar
Sent: Friday, September 22, 2000 3:51 PM
To: File Systems Developers
Subject: [ntfsd] ExQueueWorkItem Problem.

Hi,
I have tracked a problem with the machine hanging down to a work item
which
is queued but never gets called. At the moment the problem is only
exhibited

when filtering LanmanRedirector.
I am calling ExQueueWorkItem from the completion routine for an
IRP_MJ_CREATE request.
Normally after the work item is queued the completion routine returns
STATUS_MORE_PROCESSING_REQUIRED, and the worker would the irp.
Under what circumstances will a queued worker not get called? (and cause
the

machine to hang)
Rob Linegar
Software Engineer
Data Encryption Systems Limited

You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Use PsCreateSystemThread() and build your own work queue manager.

Jamey

----- Original Message -----
From: Daniel Lovinger
To: File Systems Developers
Sent: Friday, September 22, 2000 8:30 AM
Subject: [ntfsd] RE: ExQueueWorkItem Problem.

> At minimum, it is a bad idea to use more than 1 at a time. Do not queue
> an indefinite number of workitems to a worker queue, otherwise they can
> saturate it and you get exactly the deadlocks Tony describes. Use single
> workitems that process an internal queue of requests you maintain.
>
> -----Original Message-----
> From: Tony Mason [mailto:xxxxx@osr.com]
> Sent: Friday, September 22, 2000 8:19 AM
> To: File Systems Developers
> Subject: [ntfsd] RE: ExQueueWorkItem Problem.
>
>
> You have a worker thread deadlock - you are blocking worker threads, and
> queuing a work item to the queue. Since the worker threads are waiting
> for
> you and you are waiting for them, you have introduced a deadlock.
>
> In general, it is a “bad idea” to use the system work queues when
> calling
> the OS file systems - they also use the system work queues, and this
> introduces deadlocks that show up in exactly the type of situations you
> describe.
>
> This issue has been resolved in Windows 2000 because the OS will now
> grow
> the number of worker threads as needed to avoid this type of deadlock.
>
> Regards,
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
>
> -----Original Message-----
> From: Rob Linegar [mailto:xxxxx@des.co.uk]
> Sent: Friday, September 22, 2000 11:15 AM
> To: File Systems Developers
> Subject: [ntfsd] RE: ExQueueWorkItem Problem.
>
>
> The driver is non paged, so the routine address is correct.
> The machine doesn’t BSOD, it just hangs, things running still work for a
> bit.
> In my case the problem only occurs when i receive 5 opens in quick
> succession.
> The worker routine does re call into the target driver to perform a
> read.
> I suspect that this may be due to a reentrancy issue of some kind.
>
> Rob Linegar
> Software Engineer
> Data Encryption Systems Limited
>
> -----Original Message-----
> From: Hrdina Pavel [mailto:xxxxx@COMPELSON.COM]
> Sent: 22 September 2000 15:56
> To: File Systems Developers
> Subject: [ntfsd] RE: ExQueueWorkItem Problem.
>
>
> If you for. eg specify bad routine address - into nonpaged system
> address
> space
> where every page fault comes to BSOD.
> Try to verify what you’re passing to the ExQueueWorkItem.
> Paul
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Rob Linegar
> Sent: Friday, September 22, 2000 3:51 PM
> To: File Systems Developers
> Subject: [ntfsd] ExQueueWorkItem Problem.
>
>
> Hi,
> I have tracked a problem with the machine hanging down to a work item
> which
> is queued but never gets called. At the moment the problem is only
> exhibited
>
> when filtering LanmanRedirector.
> I am calling ExQueueWorkItem from the completion routine for an
> IRP_MJ_CREATE request.
> Normally after the work item is queued the completion routine returns
> STATUS_MORE_PROCESSING_REQUIRED, and the worker would the irp.
> Under what circumstances will a queued worker not get called? (and cause
> the
>
> machine to hang)
> Rob Linegar
> Software Engineer
> Data Encryption Systems Limited
> —
> You are currently subscribed to ntfsd as: xxxxx@compelson.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
> —
> You are currently subscribed to ntfsd as: xxxxx@osr.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
> —
> You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)