[Devel] Re: [RFC cr-pipe-v13][PATCH 2/3] Checkpoint open pipes

Cedric Le Goater clg at fr.ibm.com
Fri Feb 6 09:20:27 PST 2009


Dave Hansen wrote:
> On Thu, 2009-02-05 at 20:26 -0600, Nathan Lynch wrote:
>> On Thu, 05 Feb 2009 10:45:55 +0100
>> Cedric Le Goater <clg at fr.ibm.com> wrote:
>>>> +/* cr_write_pipebuf - dump contents of a pipe/fifo (assume i_mutex taken) */
>>>> +static int cr_write_pipebuf(struct cr_ctx *ctx, struct pipe_inode_info *pipe)
>>>> +{
>>>> +	struct cr_hdr h;
>>>> +	void *kbuf, *addr;
>>>> +	int i, ret = 0;
>>>> +
>>>> +	kbuf = (void *) __get_free_page(GFP_KERNEL);
>>> this can sleep and inode->i_mutex is locked.
>> Generally, it is okay to perform operations that may sleep while
>> holding a mutex (not so with spinlocks, though).  Unless the page
>> allocator could try to acquire the same inode->i_mutex, this code
>> should be fine, no?
> 
> Sleeping inside mutexes is OK.  In general, they're drop-in compatible
> with semaphore behavior.

what about the vfs_write() ? 

C.
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list