public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kwankhede@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mdev: Send uevents around parent device registration
Date: Mon, 1 Jul 2019 10:06:32 +0200	[thread overview]
Message-ID: <20190701100632.31fe96db.cohuck@redhat.com> (raw)
In-Reply-To: <20190628095608.7762d6d0@x1.home>

On Fri, 28 Jun 2019 09:56:08 -0600
Alex Williamson <alex.williamson@redhat.com> wrote:

> On Thu, 27 Jun 2019 10:19:14 +0200
> Cornelia Huck <cohuck@redhat.com> wrote:
> 
> > On Wed, 26 Jun 2019 08:27:58 -0600
> > Alex Williamson <alex.williamson@redhat.com> wrote:

> > > @@ -243,6 +247,8 @@ void mdev_unregister_device(struct device *dev)
> > >  	up_write(&parent->unreg_sem);
> > >  
> > >  	mdev_put_parent(parent);
> > > +
> > > +	kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);    
> > 
> > I'm wondering whether we should indicate this uevent earlier: Once we
> > have detached from the parent list, we're basically done for all
> > practical purposes. So maybe move this right before we grab the
> > unreg_sem?  
> 
> That would make it a "this thing is about to go away" (ie.
> "unregistering") rather than "this thing is gone" ("unregistered").  I
> was aiming for the latter as the former just seems like it might make
> userspace race to remove devices.  Note that I don't actually make use
> of this event in mdevctl currently, so we could maybe save it for
> later, but the symmetry seemed preferable.  Thanks,
> 
> Alex

Fair enough. I was thinking about signaling that it does not make much
sense to register new devices after that point, but if that might
trigger userspace to actually try and remove devices, not much is
gained.

  reply	other threads:[~2019-07-01  8:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 14:27 [PATCH] mdev: Send uevents around parent device registration Alex Williamson
2019-06-26 17:53 ` Kirti Wankhede
2019-06-26 18:05   ` Alex Williamson
2019-06-26 19:03     ` Kirti Wankhede
2019-06-27  8:21       ` Cornelia Huck
2019-06-27 14:12         ` Kirti Wankhede
2019-07-01  8:10           ` Cornelia Huck
2019-06-27  8:19 ` Cornelia Huck
2019-06-28 15:56   ` Alex Williamson
2019-07-01  8:06     ` Cornelia Huck [this message]
2019-07-01  8:11 ` Cornelia Huck

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=20190701100632.31fe96db.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox