All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>,
	qemu-devel@nongnu.org, mst@redhat.com, jasowang@redhat.com,
	vkaplans@redhat.com, alex.williamson@redhat.com, wexu@redhat.com,
	cornelia.huck@de.ibm.com, dgibson@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 2/3] memory: generalize iommu_ops.notify_started to notifier_add
Date: Thu, 8 Sep 2016 18:22:40 +0800	[thread overview]
Message-ID: <20160908102240.GD28348@pxdev.xzpeter.org> (raw)
In-Reply-To: <d3c1830f-437c-1c7f-0f9e-c8b20fe91605@redhat.com>

On Wed, Sep 07, 2016 at 12:54:23PM +0200, Paolo Bonzini wrote:
> 
> 
> On 07/09/2016 08:05, David Gibson wrote:
> > On Wed, Sep 07, 2016 at 01:32:23PM +0800, Peter Xu wrote:
> >> Considering that we may have multiple IOMMU notifier consumers in the
> >> future, converting iommu_ops.notify_{started|stopped} into some more
> >> general form. Now we can trap all notifier registerations and
> >> deregistrations, rather than only the first ones.
> >>
> >> Power was leveraging the notifier_{started|stopped}, adding iommu_user
> >> field for counting on Power guests to achieve the same goal.
> > 
> > Requiring each vIOMMU frontend to reference count or whatever seems
> > like a pain.  The semantics of notify_started() were designed to avoid
> > that.
> > 
> > Instead I'd suggest a callback which gets tripped any time the logical
> > OR of the requested notifications for all current notifiers changes.
> 
> I like the suggestion.  Alternatively you could call notify_stopped if
> old & ~new is nonzero (and you pass old & ~new), and notify_started if
> new & ~old is nonzero (and you pass new & ~old).

I think now I understand the point... Then I'd prefer to use David's
suggestion. A single notify_changed() looks cleaner. To be more
explicit, I would prefer to rename it to notifier_flag_changed(),
since notify_changed() looks like to be called every time notifier
list changed, but actually it is for monitoring the flags.

Thanks,

-- peterx

  reply	other threads:[~2016-09-08 10:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  5:32 [Qemu-devel] [PATCH v3 0/3] Introduce IOMMUNotifier struct Peter Xu
2016-09-07  5:32 ` [Qemu-devel] [PATCH v3 1/3] memory: introduce IOMMUNotifier and its caps Peter Xu
2016-09-07  6:02   ` David Gibson
2016-09-07  7:09     ` Peter Xu
2016-09-07 10:20       ` David Gibson
2016-09-08 10:00         ` Peter Xu
2016-09-07  5:32 ` [Qemu-devel] [PATCH v3 2/3] memory: generalize iommu_ops.notify_started to notifier_add Peter Xu
2016-09-07  6:05   ` David Gibson
2016-09-07  7:23     ` Peter Xu
2016-09-07 10:23       ` David Gibson
2016-09-07 10:54     ` Paolo Bonzini
2016-09-08 10:22       ` Peter Xu [this message]
2016-09-12  1:17         ` David Gibson
2016-09-12  5:54           ` Peter Xu
2016-09-07  5:32 ` [Qemu-devel] [PATCH v3 3/3] intel_iommu: allow invalidation typed notifiers Peter Xu

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=20160908102240.GD28348@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgibson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vkaplans@redhat.com \
    --cc=wexu@redhat.com \
    /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.