All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"julien@xen.org" <julien@xen.org>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Artem Mygaiev <Artem_Mygaiev@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Rahul Singh <rahul.singh@arm.com>,
	Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Subject: Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure
Date: Tue, 15 Feb 2022 08:39:09 +0000	[thread overview]
Message-ID: <ec0c24f5-911b-e347-ba5b-6535e1f92aaa@epam.com> (raw)
In-Reply-To: <YgtkkAoYZ3MZsygD@Air-de-Roger>



On 15.02.22 10:30, Roger Pau Monné wrote:
> On Mon, Feb 14, 2022 at 02:00:26PM +0000, Oleksandr Andrushchenko wrote:
>> /*
>> * FIXME: apply_map is called from dom0 specific init code when
>> * system_state < SYS_STATE_active, so there is no race condition
>> * possible between this code and vpci_process_pending. So, neither
>> * vpci_process_pending may try to acquire the lock in read mode and
>> * also destroy pdev->vpci in its error path nor pdev may be disposed yet.
>> * This means that it is not required to check if the relevant pdev
>> * still exists after re-acquiring the lock.
> I'm not sure why you need to mention vpci_process_pending here:
> apply_map and defer_map are mutually exclusive, so given the current
> code it's impossible to get in a situation where apply_map is called
> while there's pending work on the vCPU (ie: v->vpci.mem != NULL).
>
> Also there's no need for a FIXME tag: the current approach doesn't
> require any fixes unless we start using apply_map in a different
> context.
>
> Hence I think the comment should be along the lines of:
>
> /*
>   * It's safe to drop and reacquire the lock in this context without
>   * risking pdev disappearing because devices cannot be removed until the
>   * initial domain has been started.
>   */
Urgh, I've just sent v2. I'll move this there and answer
>
> Thanks, Roger.
>
Thank you,
Oleksandr

  reply	other threads:[~2022-02-15  8:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 13:36 [PATCH] vpci: introduce per-domain lock to protect vpci structure Oleksandr Andrushchenko
2022-02-10 16:16 ` Roger Pau Monné
2022-02-11  7:27   ` Oleksandr Andrushchenko
2022-02-11 11:40     ` Roger Pau Monné
2022-02-11 12:13       ` Oleksandr Andrushchenko
2022-02-11 15:44         ` Roger Pau Monné
2022-02-14  6:33           ` Oleksandr Andrushchenko
2022-02-14  8:47             ` Roger Pau Monné
2022-02-14  8:53               ` Oleksandr Andrushchenko
2022-02-14  9:36       ` Oleksandr Andrushchenko
2022-02-14 10:34         ` Roger Pau Monné
2022-02-14 10:53           ` Oleksandr Andrushchenko
2022-02-14 11:11             ` Roger Pau Monné
2022-02-14 11:15               ` Oleksandr Andrushchenko
2022-02-14 11:25                 ` Roger Pau Monné
2022-02-14 11:37                   ` Oleksandr Andrushchenko
2022-02-14 12:57                     ` Jan Beulich
2022-02-14 13:13                       ` Oleksandr Andrushchenko
2022-02-14 13:22                         ` Jan Beulich
2022-02-14 13:27                           ` Oleksandr Andrushchenko
2022-02-14 13:48                             ` Jan Beulich
2022-02-14 14:00                               ` Oleksandr Andrushchenko
2022-02-14 14:09                                 ` Jan Beulich
2022-02-15  8:30                                 ` Roger Pau Monné
2022-02-15  8:39                                   ` Oleksandr Andrushchenko [this message]
2022-02-11  8:46   ` Oleksandr Andrushchenko
2022-02-11 11:51     ` Roger Pau Monné
2022-02-11 12:14       ` Oleksandr Andrushchenko
2022-02-14 14:19 ` Jan Beulich
2022-02-14 14:26   ` Oleksandr Andrushchenko
2022-02-14 14:31     ` Jan Beulich
2022-02-14 14:34       ` Oleksandr Andrushchenko

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=ec0c24f5-911b-e347-ba5b-6535e1f92aaa@epam.com \
    --to=oleksandr_andrushchenko@epam.com \
    --cc=Artem_Mygaiev@epam.com \
    --cc=Oleksandr_Tyshchenko@epam.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=rahul.singh@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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.