All of lore.kernel.org
 help / color / mirror / Atom feed
From: "He, Roger" <Hongbo.He@amd.com>
To: "Grodzovsky, Andrey" <Andrey.Grodzovsky@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Koenig, Christian" <Christian.Koenig@amd.com>
Subject: RE: [PATCH 2/2] drm/amdgpu: Use new TTM flag to avoid OOM triggering.
Date: Tue, 16 Jan 2018 06:18:19 +0000	[thread overview]
Message-ID: <MWHPR1201MB012784C4B5F4E7E90FE49F2FFDEA0@MWHPR1201MB0127.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1515796118-18971-2-git-send-email-andrey.grodzovsky@amd.com>


-----Original Message-----
From: Andrey Grodzovsky [mailto:andrey.grodzovsky@amd.com] 
Sent: Saturday, January 13, 2018 6:29 AM
To: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org
Cc: Koenig, Christian <Christian.Koenig@amd.com>; He, Roger <Hongbo.He@amd.com>; Grodzovsky, Andrey <Andrey.Grodzovsky@amd.com>
Subject: [PATCH 2/2] drm/amdgpu: Use new TTM flag to avoid OOM triggering.

This to have a load time option to avoid OOM on RAM allocations.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 4 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index b7c181e..1387239 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -127,6 +127,7 @@ extern int amdgpu_job_hang_limit;  extern int amdgpu_lbpw;  extern int amdgpu_compute_multipipe;  extern int amdgpu_gpu_recovery;
+extern int amdgpu_alloc_no_oom;
 
 #ifdef CONFIG_DRM_AMDGPU_SI
 extern int amdgpu_si_support;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index d96f9ac..6e98189 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -130,6 +130,7 @@ int amdgpu_job_hang_limit = 0;  int amdgpu_lbpw = -1;  int amdgpu_compute_multipipe = -1;  int amdgpu_gpu_recovery = -1; /* auto */
+int amdgpu_alloc_no_oom = -1; /* auto */

How about turn it on as default?

Thanks
Roger(Hongbo.He)

MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");  module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); @@ -285,6 +286,9 @@ module_param_named(compute_multipipe, amdgpu_compute_multipipe, int, 0444);  MODULE_PARM_DESC(gpu_recovery, "Enable GPU recovery mechanism, (1 = enable, 0 = disable, -1 = auto");  module_param_named(gpu_recovery, amdgpu_gpu_recovery, int, 0444);
 
+MODULE_PARM_DESC(alloc_no_oom, "Allocate RAM without triggering OOM 
+killer, (1 = enable, 0 = disable, -1 = auto"); 
+module_param_named(alloc_no_oom, amdgpu_alloc_no_oom, int, 0444);
+
 #ifdef CONFIG_DRM_AMDGPU_SI
 
 #if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 5c4c3e0..fc27164 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -420,6 +420,10 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,  #endif
 
 	bo->tbo.bdev = &adev->mman.bdev;
+
+	if (amdgpu_alloc_no_oom == 1)
+		bo->tbo.bdev->no_retry = true;
+
 	amdgpu_ttm_placement_from_domain(bo, domain);
 
 	r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type,
--
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-01-16  6:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 22:28 [PATCH 1/2] drm/ttm: Allow page allocations w/o triggering OOM Andrey Grodzovsky
2018-01-12 22:28 ` [PATCH 2/2] drm/amdgpu: Use new TTM flag to avoid OOM triggering Andrey Grodzovsky
2018-01-16  6:18   ` He, Roger [this message]
     [not found]     ` <MWHPR1201MB012784C4B5F4E7E90FE49F2FFDEA0-3iK1xFAIwjq9imrIu4W8xGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-01-16  8:54       ` Christian König
2018-01-16 12:43         ` Andrey Grodzovsky
     [not found]           ` <2fb8142b-99c2-c682-d867-83da7327030b-5C7GfCeVMHo@public.gmane.org>
2018-01-16 12:46             ` Christian König
2018-01-17  2:09               ` He, Roger
2018-01-16 15:18         ` [PATCH v2 1/2] drm/ttm: Allow page allocations w/o triggering OOM Andrey Grodzovsky
     [not found]           ` <1516115906-26095-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-01-16 15:18             ` [PATCH v2 2/2] drm/amdgpu: Use new TTM flag to avoid OOM triggering Andrey Grodzovsky
     [not found]               ` <1516115906-26095-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-01-16 16:42                 ` Felix Kuehling
     [not found]                   ` <ce727655-b4cc-0e41-eeef-7e768fe958d6-5C7GfCeVMHo@public.gmane.org>
2018-01-16 17:28                     ` Andrey Grodzovsky
2018-01-16 19:50                       ` [PATCH v3] " Andrey Grodzovsky
     [not found]                         ` <1516132211-32035-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-01-16 20:00                           ` Felix Kuehling
2018-01-16 15:22             ` [PATCH v2 1/2] drm/ttm: Allow page allocations w/o triggering OOM Christian König
2018-01-17  2:21           ` He, Roger
2018-01-16  6:02 ` [PATCH " He, Roger
2018-01-16  8:53   ` Christian König

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=MWHPR1201MB012784C4B5F4E7E90FE49F2FFDEA0@MWHPR1201MB0127.namprd12.prod.outlook.com \
    --to=hongbo.he@amd.com \
    --cc=Andrey.Grodzovsky@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.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.