All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] memory: transaction API
Date: Thu, 21 Jul 2011 18:11:19 +0300	[thread overview]
Message-ID: <4E284197.8000903@redhat.com> (raw)
In-Reply-To: <4E28404D.1080002@siemens.com>

On 07/21/2011 06:05 PM, Jan Kiszka wrote:
> >
> >  The point is _update() can only make changes for one region atomic,
> >  while _commit() is more general.  You can sometimes batch all changes
> >  into a single container region, but sometimes it is clumsy, and
> >  sometimes impossible.
> >
> >  Deletion and creation are needed because we can't update an alias'
> >  offset.  I guess I can add that functionality.  But it still isn't as
> >  general as _commit().
>
> OK. What about providing _update wrappers? They could be implemented
> internally by the memory API in terms of begin - remove region - change
> region object - re-add region - end. That would avoid boilerplate code
> on the user side and still keep the option to do open-coded transaction
> also outside the core.

It's pretty easy to do updates without resorting to transactions.  If 
it's just some property, you simply call m_r_update_topology().  Things 
like priority need a bit more logic to keep the list in sorted order, 
but it's not really difficult.

> >
> >>>
> >>>>   I also think now that describing a memory region offline via a struct
> >>>>   and then passing that to an atomic add/del/update would be a more handy
> >>>>   and future-proof API than an increasing number set functions.
> >>>
> >>>   Maybe.  But it's not sufficient for atomic changes involving multiple
> >>>   regions.
> >>
> >>  Right. The question is still if there are use cases where this matters
> >>  (ie. update frequencies comparable to graphic scenarios).
> >
> >  Does even cirrus update this often?  I would guess cirrus usually uses
> >  the linear framebuffer, no?
>
> Not sure how this mode is called, but when vram is mapped linearly into
> the 0xa0000 range via two 32K banks, you get quite a few updates on
> larger screen changes.
>

Ok.  grub2 again?  or another guest?

> >
> >>  But such an IOCTL would resolve our problem with dropping a logged
> >>  region as well, right?
> >
> >  Yes, if done right.  Still we need to support older kernels.
>
> We will need workarounds like we have today, e.g. confining PAM memory
> region fragmentation to certain patterns that known OSes require. Full,
> correct support would remain the privilege of host kernels that allow to
> combine multi-region updates to an atomic operation (+ returning or
> preserving dirty logs).

An atomic update + dirty log fetch can be emulated by temporarily 
freezing all vcpus.


-- 
error compiling committee.c: too many arguments to function


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [PATCH] memory: transaction API
Date: Thu, 21 Jul 2011 18:11:19 +0300	[thread overview]
Message-ID: <4E284197.8000903@redhat.com> (raw)
In-Reply-To: <4E28404D.1080002@siemens.com>

On 07/21/2011 06:05 PM, Jan Kiszka wrote:
> >
> >  The point is _update() can only make changes for one region atomic,
> >  while _commit() is more general.  You can sometimes batch all changes
> >  into a single container region, but sometimes it is clumsy, and
> >  sometimes impossible.
> >
> >  Deletion and creation are needed because we can't update an alias'
> >  offset.  I guess I can add that functionality.  But it still isn't as
> >  general as _commit().
>
> OK. What about providing _update wrappers? They could be implemented
> internally by the memory API in terms of begin - remove region - change
> region object - re-add region - end. That would avoid boilerplate code
> on the user side and still keep the option to do open-coded transaction
> also outside the core.

It's pretty easy to do updates without resorting to transactions.  If 
it's just some property, you simply call m_r_update_topology().  Things 
like priority need a bit more logic to keep the list in sorted order, 
but it's not really difficult.

> >
> >>>
> >>>>   I also think now that describing a memory region offline via a struct
> >>>>   and then passing that to an atomic add/del/update would be a more handy
> >>>>   and future-proof API than an increasing number set functions.
> >>>
> >>>   Maybe.  But it's not sufficient for atomic changes involving multiple
> >>>   regions.
> >>
> >>  Right. The question is still if there are use cases where this matters
> >>  (ie. update frequencies comparable to graphic scenarios).
> >
> >  Does even cirrus update this often?  I would guess cirrus usually uses
> >  the linear framebuffer, no?
>
> Not sure how this mode is called, but when vram is mapped linearly into
> the 0xa0000 range via two 32K banks, you get quite a few updates on
> larger screen changes.
>

Ok.  grub2 again?  or another guest?

> >
> >>  But such an IOCTL would resolve our problem with dropping a logged
> >>  region as well, right?
> >
> >  Yes, if done right.  Still we need to support older kernels.
>
> We will need workarounds like we have today, e.g. confining PAM memory
> region fragmentation to certain patterns that known OSes require. Full,
> correct support would remain the privilege of host kernels that allow to
> combine multi-region updates to an atomic operation (+ returning or
> preserving dirty logs).

An atomic update + dirty log fetch can be emulated by temporarily 
freezing all vcpus.


-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2011-07-21 15:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 10:21 [PATCH] memory: transaction API Avi Kivity
2011-07-21 10:38 ` Jan Kiszka
2011-07-21 12:05   ` Avi Kivity
2011-07-21 12:08     ` Avi Kivity
2011-07-21 12:09     ` Jan Kiszka
2011-07-21 12:13       ` Avi Kivity
2011-07-21 12:52         ` Jan Kiszka
2011-07-21 12:58           ` Avi Kivity
2011-07-21 13:17             ` Jan Kiszka
2011-07-21 13:50               ` Avi Kivity
2011-07-21 14:32                 ` Jan Kiszka
2011-07-21 14:39                   ` Avi Kivity
2011-07-21 15:05                     ` Jan Kiszka
2011-07-21 15:05                       ` [Qemu-devel] " Jan Kiszka
2011-07-21 15:11                       ` Avi Kivity [this message]
2011-07-21 15:11                         ` Avi Kivity
2011-07-21 11:04 ` Ferry Huberts
2011-07-21 12:07   ` Avi Kivity
2011-07-21 12:26     ` Ferry Huberts
2011-07-21 12:46       ` Avi Kivity
2011-07-21 12:56         ` Ferry Huberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E284197.8000903@redhat.com \
    --to=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.