From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc3F8-0005zf-0M for qemu-devel@nongnu.org; Tue, 05 Jun 2012 19:34:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc34y-0003ac-D9 for qemu-devel@nongnu.org; Tue, 05 Jun 2012 19:25:59 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:46191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc34y-0003aL-6y for qemu-devel@nongnu.org; Tue, 05 Jun 2012 19:22:24 -0400 Received: by pbbro12 with SMTP id ro12so8787606pbb.4 for ; Tue, 05 Jun 2012 16:22:21 -0700 (PDT) Date: Wed, 6 Jun 2012 08:22:10 +0900 From: Greg Kroah-Hartman Message-ID: <20120605232210.GA8858@kroah.com> References: <20120605104954.15442.62695.stgit@ltc189.sdl.hitachi.co.jp> <20120605130117.15479.32680.stgit@ltc189.sdl.hitachi.co.jp> <20120605131031.GF13495@aftab.osrc.amd.com> <4FCE902A.3060603@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FCE902A.3060603@codemonkey.ws> Subject: Re: [Qemu-devel] [RFC PATCH 1/2] ivring: Add a ring-buffer driver on IVShmem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Ohad Ben-Cohen , Arnaldo Carvalho de Melo , Borislav Petkov , Joerg Roedel , Yoshihiro YUNOMAE , Rusty Russell , qemu-devel@nongnu.org, Borislav Petkov , linux-kernel@vger.kernel.org, Grant Likely , MyungJoo Ham , systemtap@sourceware.org, yrl.pp-manager.tt@hitachi.com, Masami Hiramatsu , Akihiro Nagai , Cam Macdonell , Linus Walleij On Wed, Jun 06, 2012 at 07:03:06AM +0800, Anthony Liguori wrote: > On 06/05/2012 09:10 PM, Borislav Petkov wrote: > >On Tue, Jun 05, 2012 at 10:01:17PM +0900, Yoshihiro YUNOMAE wrote: > >>This patch adds a ring-buffer driver for IVShmem device, a virtual RAM device in > >>QEMU. This driver can be used as a ring-buffer for kernel logging or tracing of > >>a guest OS by recording kernel programing or SystemTap. > >> > >>This ring-buffer driver is implemented very simple. First 4kB of shared memory > >>region is control structure of a ring-buffer. In this region, some values for > >>managing the ring-buffer is stored such as bits and mask of whole memory size, > >>writing position, threshold value for notification to a reader on a host OS. > >>This region is used by the reader to know writing position. Then, "total > >>memory size - 4kB" equals to usable memory region for recording data. > >>This ring-buffer driver records any data from start to end of the writable > >>memory region. > >> > >>When writing size exceeds a threshold value, this driver can notify a reader > >>to read data by using writel(). As this later patch, reader does not have any > >>function for receiving the notification. This notification feature will be used > >>near the future. > >> > >>As a writer records data in this ring-buffer, spinlock function is used to > >>avoid competing by some writers in multi CPU environment. Not to use spinlock, > >>lockless ring-buffer like as ftrace and one ring-buffer one CPU will be > >>implemented near the future. > > > >Yet another ring buffer? > > > >We already have an ftrace and perf ring buffer, can't you use one of those? > > Not to mention virtio :-) > > Why not just make a virtio device for this kind of thing? Yeah, that's exactly what I was thinking, why reinvent things again? greg k-h