[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 1/6] virtio/console: Add splice_write suppor
From: |
Masami Hiramatsu |
Subject: |
Re: [Qemu-devel] [RFC PATCH 1/6] virtio/console: Add splice_write support |
Date: |
Thu, 09 Aug 2012 18:12:39 +0900 |
User-agent: |
Mozilla/5.0 (Windows NT 5.2; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 |
(2012/08/09 18:00), Amit Shah wrote:
> On (Tue) 24 Jul 2012 [11:37:07], Yoshihiro YUNOMAE wrote:
>> From: Masami Hiramatsu <address@hidden>
>>
>> Enable to use splice_write from pipe to virtio-console port.
>> This steals pages from pipe and directly send it to host.
>>
>> Note that this may accelerate only the guest to host path.
>>
>> Signed-off-by: Masami Hiramatsu <address@hidden>
>> Cc: Amit Shah <address@hidden>
>> Cc: Arnd Bergmann <address@hidden>
>> Cc: Greg Kroah-Hartman <address@hidden>
>> ---
>
>> +/* Faster zero-copy write by splicing */
>> +static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
>> + struct file *filp, loff_t *ppos,
>> + size_t len, unsigned int flags)
>> +{
>> + struct port *port = filp->private_data;
>> + struct sg_list sgl;
>> + ssize_t ret;
>> + struct splice_desc sd = {
>> + .total_len = len,
>> + .flags = flags,
>> + .pos = *ppos,
>> + .u.data = &sgl,
>> + };
>> +
>> + sgl.n = 0;
>> + sgl.len = 0;
>> + sgl.sg = kmalloc(sizeof(struct scatterlist) * MAX_SPLICE_PAGES,
>> + GFP_ATOMIC);
>
> Do you expect this function to be called from interrupt context?
No, not at all. Oops, that should be GFP_KERNEL...
Thank you for pointing it out.
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: address@hidden