From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Subject: Re: Re: [RFC PATCH 1/6] virtio/console: Add splice_write support Date: Thu, 09 Aug 2012 18:12:39 +0900 Message-ID: <50237F07.2020907@hitachi.com> References: <20120724023657.6600.52706.stgit@ltc189.sdl.hitachi.co.jp> <20120724023707.6600.69536.stgit@ltc189.sdl.hitachi.co.jp> <20120809090015.GG3280@amit.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120809090015.GG3280@amit.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Amit Shah Cc: Arnd Bergmann , qemu-devel@nongnu.org, Frederic Weisbecker , yrl.pp-manager.tt@hitachi.com, linux-kernel@vger.kernel.org, Borislav Petkov , virtualization@lists.linux-foundation.org, Herbert Xu , "Franch Ch. Eigler" , Ingo Molnar , Mathieu Desnoyers , Steven Rostedt , Anthony Liguori , Greg Kroah-Hartman List-Id: virtualization@lists.linuxfoundation.org (2012/08/09 18:00), Amit Shah wrote: > On (Tue) 24 Jul 2012 [11:37:07], Yoshihiro YUNOMAE wrote: >> From: Masami Hiramatsu >> >> 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 >> Cc: Amit Shah >> Cc: Arnd Bergmann >> Cc: Greg Kroah-Hartman >> --- > >> +/* 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: masami.hiramatsu.pt@hitachi.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753716Ab2HIJMx (ORCPT ); Thu, 9 Aug 2012 05:12:53 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:48452 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822Ab2HIJMv (ORCPT ); Thu, 9 Aug 2012 05:12:51 -0400 X-AuditID: b753bd60-90ac1ba0000047ca-01-50237f108a2c X-AuditID: b753bd60-90ac1ba0000047ca-01-50237f108a2c Message-ID: <50237F07.2020907@hitachi.com> Date: Thu, 09 Aug 2012 18:12:39 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Amit Shah Cc: Yoshihiro YUNOMAE , linux-kernel@vger.kernel.org, Anthony Liguori , Arnd Bergmann , Borislav Petkov , "Franch Ch. Eigler" , Frederic Weisbecker , Greg Kroah-Hartman , Herbert Xu , Ingo Molnar , Mathieu Desnoyers , Steven Rostedt , virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org, yrl.pp-manager.tt@hitachi.com Subject: Re: Re: [RFC PATCH 1/6] virtio/console: Add splice_write support References: <20120724023657.6600.52706.stgit@ltc189.sdl.hitachi.co.jp> <20120724023707.6600.69536.stgit@ltc189.sdl.hitachi.co.jp> <20120809090015.GG3280@amit.redhat.com> In-Reply-To: <20120809090015.GG3280@amit.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (2012/08/09 18:00), Amit Shah wrote: > On (Tue) 24 Jul 2012 [11:37:07], Yoshihiro YUNOMAE wrote: >> From: Masami Hiramatsu >> >> 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 >> Cc: Amit Shah >> Cc: Arnd Bergmann >> Cc: Greg Kroah-Hartman >> --- > >> +/* 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: masami.hiramatsu.pt@hitachi.com From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzOnb-0006l9-1j for qemu-devel@nongnu.org; Thu, 09 Aug 2012 05:13:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzOnW-0006Ky-99 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 05:12:58 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:48460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzOnV-0006K4-Qu for qemu-devel@nongnu.org; Thu, 09 Aug 2012 05:12:54 -0400 Message-ID: <50237F07.2020907@hitachi.com> Date: Thu, 09 Aug 2012 18:12:39 +0900 From: Masami Hiramatsu MIME-Version: 1.0 References: <20120724023657.6600.52706.stgit@ltc189.sdl.hitachi.co.jp> <20120724023707.6600.69536.stgit@ltc189.sdl.hitachi.co.jp> <20120809090015.GG3280@amit.redhat.com> In-Reply-To: <20120809090015.GG3280@amit.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/6] virtio/console: Add splice_write support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Arnd Bergmann , qemu-devel@nongnu.org, Frederic Weisbecker , Yoshihiro YUNOMAE , yrl.pp-manager.tt@hitachi.com, linux-kernel@vger.kernel.org, Borislav Petkov , virtualization@lists.linux-foundation.org, Herbert Xu , "Franch Ch. Eigler" , Ingo Molnar , Mathieu Desnoyers , Steven Rostedt , Anthony Liguori , Greg Kroah-Hartman (2012/08/09 18:00), Amit Shah wrote: > On (Tue) 24 Jul 2012 [11:37:07], Yoshihiro YUNOMAE wrote: >> From: Masami Hiramatsu >> >> 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 >> Cc: Amit Shah >> Cc: Arnd Bergmann >> Cc: Greg Kroah-Hartman >> --- > >> +/* 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: masami.hiramatsu.pt@hitachi.com