From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, CHARSET_FARAWAY_HEADER,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B419C433E0 for ; Wed, 3 Mar 2021 03:49:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9678364E66 for ; Wed, 3 Mar 2021 03:49:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9678364E66 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C3126E3F9; Wed, 3 Mar 2021 03:49:27 +0000 (UTC) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id B044A6E364 for ; Wed, 3 Mar 2021 03:14:24 +0000 (UTC) Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id 7F478D059B for ; Wed, 3 Mar 2021 11:14:20 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 0 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from chenli.uniontech.com (unknown [58.246.122.242]) by smtp.263.net (postfix) whith ESMTP id P32470T140679216879360S1614741260177186_; Wed, 03 Mar 2021 11:14:20 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <1e7a4519181d95e678eaeb3f6c1f6589> X-RL-SENDER: chenli@uniontech.com X-SENDER: chenli@uniontech.com X-LOGIN-NAME: chenli@uniontech.com X-FST-TO: alexdeucher@gmail.com X-SENDER-IP: 58.246.122.242 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 Date: Wed, 03 Mar 2021 11:14:19 +0800 Message-ID: <87wnupkjxw.wl-chenli@uniontech.com> From: Chen Li To: Alex Deucher Subject: Re: [PATCH v2 2/3] drm/amdgpu: Use kvmalloc for CS =?ISO-2022-JP?B?Y2h1bmtzGyRCIVobKEJTdXNwZWN0ZWQ=?= phishing email, please pay attention to password =?ISO-2022-JP?B?c2VjdXJpdHkbJEIhWxsoQg==?= In-Reply-To: References: <87tuptt2jk.wl-chenli@uniontech.com> <87r1kxt2fg.wl-chenli@uniontech.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 03 Mar 2021 03:49:26 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , amd-gfx list Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Wed, 03 Mar 2021 10:23:01 +0800, Alex Deucher wrote: > > On Tue, Mar 2, 2021 at 9:16 PM Chen Li 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 > > --- > > 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