linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
To: David Laight <David.Laight@ACULAB.COM>,
	"'Michael Ellerman'" <mpe@ellerman.id.au>,
	"linuxppc-dev\@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: Frank Haverkamp <HAVERKAM@de.ibm.com>,
	"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
	"imunsie\@au1.ibm.com" <imunsie@au1.ibm.com>,
	vaibhav@linux.vnet.ibm.com
Subject: RE: cxl: Fix DSI misses when the context owning task exits
Date: Thu, 14 Jan 2016 13:20:55 +0530	[thread overview]
Message-ID: <87fuy0fvkw.fsf@vajain21.in.ibm.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CCC4462@AcuExch.aculab.com>


Hi David,


David Laight <David.Laight@ACULAB.COM> writes:

> I don't even claim to understand the linux model for handling process
> address maps, nor what the cxl driver is doing, but the above looks
> more than dodgy.
>
> 	David

Thanks for reviewing the patch.

Yes, It does look dodgy but is needed to handle a very corner case wherein
the task_struct that had originally allocated the cxl context exit
without freeing it. In case of a multi threaded user-space process this
context can still be used by other threads.

A cxl_context holds pid of the task that allocated it since we need
access to the mm_struct associated with the task to handle storage
faults reported by the capi accelerator. Now in case of a MT process if
the thread that allocated the context exits the pid becomes invalid and
we are no more able to handle faults from the accelerator even though
the process is still alive.

In such a case the patch tries to use the task group leader pid to find
the next alive task in the task group which can be used to handle the
storage fault.

We could have instead used only the task group leader for handling the
faults but there is a possibility that even the task group leader has
exited in which case the mm_struct associated with it will also be NULL.

Hope this clarifies things,

Cheers,
~ Vaibhav

  parent reply	other threads:[~2016-01-14  7:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 10:56 [PATCH] cxl: Fix DSI misses when the context owning task exits Vaibhav Jain
2015-11-25  2:05 ` Ian Munsie
2015-11-25  8:57 ` Frederic Barrat
2015-11-25 16:17 ` Matthew R. Ochs
2016-01-11  9:14 ` Michael Ellerman
2016-01-12 13:29   ` David Laight
2016-01-12 22:59     ` Michael Ellerman
2016-01-14  7:50     ` Vaibhav Jain [this message]
2016-01-14 10:11       ` David Laight

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=87fuy0fvkw.fsf@vajain21.in.ibm.com \
    --to=vaibhav@linux.vnet.ibm.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=HAVERKAM@de.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=mrochs@linux.vnet.ibm.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).