From: Oded Gabbay <oded.gabbay@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "David Airlie" <airlied@linux.ie>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Jerome Glisse" <j.glisse@gmail.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
"John Bridgman" <John.Bridgman@amd.com>,
"Andrew Lewycky" <Andrew.Lewycky@amd.com>,
"Joerg Roedel" <joro@8bytes.org>, linux-mm <linux-mm@kvack.org>,
"Oded Gabbay" <oded.gabbay@amd.com>,
"Rik van Riel" <riel@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
"Mel Gorman" <mgorman@suse.de>,
"Peter Zijlstra" <peterz@infradead.org>,
"Joonsoo Kim" <iamjoonsoo.kim@lge.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Michel Lespinasse" <walken@google.com>
Subject: [PATCH 01/83] mm: Add kfd_process pointer to mm_struct
Date: Fri, 11 Jul 2014 00:47:26 +0300 [thread overview]
Message-ID: <1405028848-5660-1-git-send-email-oded.gabbay@amd.com> (raw)
This patch enables the KFD to retrieve the kfd_process
object from the process's mm_struct. This is needed because kfd_process
lifespan is bound to the process's mm_struct lifespan.
When KFD is notified about an mm_struct tear-down, it checks if the
kfd_process pointer is valid. If so, it releases the kfd_process object
and all relevant resources.
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
---
include/linux/mm_types.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 678097c..6179107 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -20,6 +20,10 @@
struct hmm;
#endif
+#ifdef CONFIG_HSA_RADEON
+struct kfd_process;
+#endif
+
#ifndef AT_VECTOR_SIZE_ARCH
#define AT_VECTOR_SIZE_ARCH 0
#endif
@@ -439,6 +443,16 @@ struct mm_struct {
*/
struct hmm *hmm;
#endif
+#if defined(CONFIG_HSA_RADEON) || defined(CONFIG_HSA_RADEON_MODULE)
+ /*
+ * kfd always register an mmu_notifier we rely on mmu notifier to keep
+ * refcount on mm struct as well as forbiding registering kfd on a
+ * dying mm
+ *
+ * This field is set with mmap_sem old in write mode.
+ */
+ struct kfd_process *kfd_process;
+#endif
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
pgtable_t pmd_huge_pte; /* protected by page_table_lock */
#endif
--
1.9.1
next reply other threads:[~2014-07-10 21:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-10 21:47 Oded Gabbay [this message]
2014-07-11 15:42 ` Jerome Glisse
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=1405028848-5660-1-git-send-email-oded.gabbay@amd.com \
--to=oded.gabbay@gmail.com \
--cc=Andrew.Lewycky@amd.com \
--cc=John.Bridgman@amd.com \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=j.glisse@gmail.com \
--cc=jglisse@redhat.com \
--cc=joro@8bytes.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=oded.gabbay@amd.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=walken@google.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
Powered by JetHome