From: Chen Li <chenli@uniontech.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Christian König" <christian.koenig@amd.com>,
"amd-gfx list" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 2/3] drm/amdgpu: Use kvmalloc for CS chunks【Suspected phishing email, please pay attention to password security】
Date: Wed, 03 Mar 2021 11:14:19 +0800 [thread overview]
Message-ID: <87wnupkjxw.wl-chenli@uniontech.com> (raw)
In-Reply-To: <CADnq5_PhQ-dtpDM6XDNc+kJt8+8zX7_GscWi7sg5iri-ZqWMRQ@mail.gmail.com>
On Wed, 03 Mar 2021 10:23:01 +0800,
Alex Deucher wrote:
>
> On Tue, Mar 2, 2021 at 9:16 PM Chen Li <chenli@uniontech.com> wrote:
> >
> >
> > The number of chunks/chunks_array may be passed in
> > by userspace and can be large.
> >
>
> We also need to kvfree these.
Thanks for pointing out this! I will a add it in v3.
>
> Alex
>
> > Signed-off-by: Chen Li <chenli@uniontech.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index 3e240b952e79..aefb7e68977d 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > @@ -117,7 +117,7 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs
> > if (cs->in.num_chunks == 0)
> > return 0;
> >
> > - chunk_array = kmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL);
> > + chunk_array = kvmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL);
> > if (!chunk_array)
> > return -ENOMEM;
> >
> > @@ -144,7 +144,7 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs
> > }
> >
> > p->nchunks = cs->in.num_chunks;
> > - p->chunks = kmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk),
> > + p->chunks = kvmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk),
> > GFP_KERNEL);
> > if (!p->chunks) {
> > ret = -ENOMEM;
> > --
> > 2.30.0
> >
> >
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2021-03-03 3:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 2:05 [PATCH v2 0/3] Use kvmalloc_array for radeon and amdgpu CS chunks Chen Li
2021-03-03 2:06 ` [PATCH v2 1/3] drm/radeon: Use kvmalloc for " Chen Li
2021-03-03 2:07 ` [PATCH v2 2/3] drm/amdgpu: " Chen Li
2021-03-03 2:23 ` Alex Deucher
2021-03-03 3:14 ` Chen Li [this message]
2021-03-03 2:08 ` [PATCH v2 3/3] drm/amdgpu: correct DRM_ERROR for kvmalloc_array Chen Li
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=87wnupkjxw.wl-chenli@uniontech.com \
--to=chenli@uniontech.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.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 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.