From: Shantonu Sen <email@hidden>
To: sheetal phirke <email@hidden>
Cc: email@hidden
Sent: Wednesday, 16 November 2011 11:05 PM
Subject: Re: IOMalloc / IOFree while holding a mutex
There's some layers of sublety here. You can do a lot of things at a technical level. Certainly there are no assertions or consistency checks that prevent you from holding an IOLock/lck_mtx_t. However if
you are writing a storage driver that is on the paging path, consider what happens if you take the lock (or run under a command gate), attempt the IOMalloc, which in turn needs to free up pages by paging out user data, which issues an I/O, which tries to acquire the mutex previously acquired? You can try to massage the code to accept an asyncReadWrite() without taking any locks, so you don't end up deadlocking, but it requires some thought. This is one of the reasons why memory allocations on the I/O path is frowned upon.
Shantonu Sen
email@hiddenOn Nov 16, 2011, at 6:17 AM, chas williams - CONTRACTOR wrote:
> On Wed, 16 Nov 2011 11:09:07 +0530 (IST)
> sheetal phirke <
email@hidden> wrote:
>
>> Can I call
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden