From: Hillf Danton <hdanton@sina.com>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Cc: Dave Airlie <airlied@gmail.com>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
"Koenig, Christian" <Christian.Koenig@amd.com>,
Harry Wentland <harry.wentland@amd.com>,
amd-gfx list <amd-gfx@lists.freedesktop.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: The issue with page allocation 5.3 rc1-rc2 (seems drm culprit here)
Date: Tue, 6 Aug 2019 09:48:30 +0800 [thread overview]
Message-ID: <20190806014830.7424-1-hdanton@sina.com> (raw)
On Tue, 6 Aug 2019 01:15:01 +0800 Mikhail Gavrilov wrote:
>
> Unfortunately couldn't check this patch because, with the patch, the
> kernel did not compile.
> Here is compile error messages:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function
> 'dc_create_state':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1178:13: error:
> implicit declaration of function 'kvzalloc'; did you mean 'kzalloc'?
> [-Werror=implicit-function-declaration]
> 1178 | context = kvzalloc(sizeof(struct dc_state),
> | ^~~~~~~~
> | kzalloc
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1178:11: warning:
> assignment to 'struct dc_state *' from 'int' makes pointer from
> integer without a cast [-Wint-conversion]
> 1178 | context = kvzalloc(sizeof(struct dc_state),
> | ^
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'dc_copy_state':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1203:13: error:
> implicit declaration of function 'kvmalloc'; did you mean 'kmalloc'?
> [-Werror=implicit-function-declaration]
> 1203 | new_ctx = kvmalloc(sizeof(*new_ctx), GFP_KERNEL);
> | ^~~~~~~~
> | kmalloc
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1203:11: warning:
> assignment to 'struct dc_state *' from 'int' makes pointer from
> integer without a cast [-Wint-conversion]
> 1203 | new_ctx = kvmalloc(sizeof(*new_ctx), GFP_KERNEL);
> | ^
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'dc_state_free':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1242:2: error:
> implicit declaration of function 'kvfree'; did you mean 'kzfree'?
> [-Werror=implicit-function-declaration]
> 1242 | kvfree(context);
> | ^~~~~~
> | kzfree
> cc1: some warnings being treated as errors
> make[4]: *** [scripts/Makefile.build:274:
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> make[3]: *** [scripts/Makefile.build:490: drivers/gpu/drm/amd/amdgpu] Error 2
> make[3]: *** Waiting for unfinished jobs....
> make: *** [Makefile:1084: drivers] Error 2
My bad, respin with one header file added.
Hillf
-----8<---
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -23,6 +23,7 @@
*/
#include <linux/slab.h>
+#include <linux/mm.h>
#include "dm_services.h"
@@ -1174,8 +1175,12 @@ struct dc_state *dc_create_state(struct
struct dc_state *context = kzalloc(sizeof(struct dc_state),
GFP_KERNEL);
- if (!context)
- return NULL;
+ if (!context) {
+ context = kvzalloc(sizeof(struct dc_state),
+ GFP_KERNEL);
+ if (!context)
+ return NULL;
+ }
/* Each context must have their own instance of VBA and in order to
* initialize and obtain IP and SOC the base DML instance from DC is
* initially copied into every context
@@ -1195,8 +1200,13 @@ struct dc_state *dc_copy_state(struct dc
struct dc_state *new_ctx = kmemdup(src_ctx,
sizeof(struct dc_state), GFP_KERNEL);
- if (!new_ctx)
- return NULL;
+ if (!new_ctx) {
+ new_ctx = kvmalloc(sizeof(*new_ctx), GFP_KERNEL);
+ if (new_ctx)
+ *new_ctx = *src_ctx;
+ else
+ return NULL;
+ }
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *cur_pipe = &new_ctx->res_ctx.pipe_ctx[i];
@@ -1230,7 +1240,7 @@ static void dc_state_free(struct kref *k
{
struct dc_state *context = container_of(kref, struct dc_state, refcount);
dc_resource_state_destruct(context);
- kfree(context);
+ kvfree(context);
}
void dc_release_state(struct dc_state *context)
--
next reply other threads:[~2019-08-06 1:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 1:48 Hillf Danton [this message]
2019-08-08 3:48 ` Mikhail Gavrilov
2019-08-08 5:31 ` Alex Deucher
2019-08-08 8:12 ` Michel Dänzer
2019-08-08 14:26 ` Alex Deucher
2019-08-09 18:55 ` Mikhail Gavrilov
2019-08-10 16:08 ` Mikhail Gavrilov
-- strict thread matches above, loose matches on Subject: below --
2019-08-08 7:42 Hillf Danton
2019-08-05 3:21 Hillf Danton
2019-08-05 17:14 ` Mikhail Gavrilov
2019-08-04 22:23 Mikhail Gavrilov
2019-08-05 1:03 ` Dave Airlie
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=20190806014830.7424-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=Alexander.Deucher@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=airlied@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mikhail.v.gavrilov@gmail.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