linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Alistair Popple <alistair@popple.id.au>, linuxppc-dev@lists.ozlabs.org
Cc: Alistair Popple <alistair@popple.id.au>,
	mhairgrove@nvidia.com, arbab@linux.ibm.com
Subject: Re: [1/2] powernv/npu: Add lock to prevent race in concurrent context init/destroy
Date: Tue, 24 Apr 2018 13:48:26 +1000 (AEST)	[thread overview]
Message-ID: <40VTnk1qkgz9rvt@ozlabs.org> (raw)
In-Reply-To: <20180411063855.5451-1-alistair@popple.id.au>

On Wed, 2018-04-11 at 06:38:54 UTC, Alistair Popple wrote:
> The pnv_npu2_init_context() and pnv_npu2_destroy_context() functions are
> used to allocate/free contexts to allow address translation and shootdown
> by the NPU on a particular GPU. Context initialisation is implicitly safe
> as it is protected by the requirement mmap_sem be held in write mode,
> however pnv_npu2_destroy_context() does not require mmap_sem to be held and
> it is not safe to call with a concurrent initialisation for a different
> GPU.
> 
> It was assumed the driver would ensure destruction was not called
> concurrently with initialisation. However the driver may be simplified by
> allowing concurrent initialisation and destruction for different GPUs. As
> npu context creation/destruction is not a performance critical path and the
> critical section is not large a single spinlock is used for simplicity.
> 
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> Reviewed-by: Mark Hairgrove <mhairgrove@nvidia.com>
> Tested-by: Mark Hairgrove <mhairgrove@nvidia.com>
> Reviewed-by: Balbir Singh <bsingharora@gmail.com>

Series applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/28a5933e8d362766462ea9e5f135e1

cheers

      parent reply	other threads:[~2018-04-24  3:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11  6:38 [PATCH 1/2] powernv/npu: Add lock to prevent race in concurrent context init/destroy Alistair Popple
2018-04-11  6:38 ` [PATCH 2/2] powernv/npu: Prevent overwriting of pnv_npu2_init_contex() callback parameters Alistair Popple
2018-04-13  2:02   ` Mark Hairgrove
2018-04-13 11:21     ` Balbir Singh
2018-04-20  3:51   ` Alistair Popple
2018-04-13  2:02 ` [PATCH 1/2] powernv/npu: Add lock to prevent race in concurrent context init/destroy Mark Hairgrove
2018-04-13 11:18 ` Balbir Singh
2018-04-20  3:50 ` Alistair Popple
2018-04-24  3:48 ` Michael Ellerman [this message]

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=40VTnk1qkgz9rvt@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=alistair@popple.id.au \
    --cc=arbab@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mhairgrove@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).