dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sharat Masetty <smasetty@codeaurora.org>
To: freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [Freedreno] [PATCH 06/13] drm/msm: Use kzalloc for submit struct allocation
Date: Wed, 3 Oct 2018 16:20:32 +0530	[thread overview]
Message-ID: <fba633ff-5c9b-2765-73ea-f47ddee8b5c0@codeaurora.org> (raw)
In-Reply-To: <20181001181359.GC31641@jcrouse-lnx.qualcomm.com>



On 10/1/2018 11:43 PM, Jordan Crouse wrote:
> On Mon, Oct 01, 2018 at 06:01:38PM +0530, Sharat Masetty wrote:
>> This patch changes to kzalloc and avoids setting individual submit
>> struct fields to zero manually.
> 
> I don't think this one is worth it.  There are so many members in submit and so
> few that get reset to 0 - I don't think the extra cycles are worth it in this
> fast path.
The patch "drm/msm: Use the DRM common Scheduler" adds a few more fields 
to the bo struct, If not kzalloc, then I will have to run a loop or 
memset the bos area to 0 at least.
> 
>> Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
>> ---
>>   drivers/gpu/drm/msm/msm_gem_submit.c | 7 +------
>>   1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
>> index a7c8cbc..7931c2a 100644
>> --- a/drivers/gpu/drm/msm/msm_gem_submit.c
>> +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
>> @@ -41,24 +41,19 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev,
>>   	if (sz > SIZE_MAX)
>>   		return NULL;
>>   
>> -	submit = kmalloc(sz, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
>> +	submit = kzalloc(sz, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
>>   	if (!submit)
>>   		return NULL;
>>   
>>   	submit->dev = dev;
>>   	submit->gpu = gpu;
>>   	submit->ctx = ctx;
>> -	submit->hw_fence = NULL;
>>   	submit->out_fence_id = -1;
>>   	submit->pid = get_pid(task_pid(current));
>>   	submit->cmd = (void *)&submit->bos[nr_bos];
>>   	submit->queue = queue;
>>   	submit->ring = gpu->rb[queue->prio];
>>   
>> -	/* initially, until copy_from_user() and bo lookup succeeds: */
>> -	submit->nr_bos = 0;
>> -	submit->nr_cmds = 0;
>> -
>>   	INIT_LIST_HEAD(&submit->node);
>>   	INIT_LIST_HEAD(&submit->bo_list);
>>   	ww_acquire_init(&submit->ticket, &reservation_ww_class);
>> -- 
>> 1.9.1
>>
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-10-03 10:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 12:31 [PATCH 00/13] drm/msm: Hook up the DRM gpu scheduler Sharat Masetty
     [not found] ` <1538397105-19581-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 12:31   ` [PATCH 01/13] drm/msm: Track GPU fences with idr Sharat Masetty
     [not found]     ` <1538397105-19581-2-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 19:03       ` Jordan Crouse
     [not found]         ` <20181001190333.GE31641-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-10-01 21:49           ` Rob Clark
2018-10-01 12:31   ` [PATCH 02/13] drm/msm: Change msm_gpu_submit() API Sharat Masetty
     [not found]     ` <1538397105-19581-3-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 18:00       ` Jordan Crouse
2018-10-01 12:31   ` [PATCH 03/13] drm/msm: Save the ring name in the ring structure Sharat Masetty
     [not found]     ` <1538397105-19581-4-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 18:01       ` Jordan Crouse
2018-10-01 12:31   ` [PATCH 04/13] drm/msm: Change the name of the fence to hw_fence Sharat Masetty
2018-10-01 12:31   ` [PATCH 05/13] drm/msm: rearrange submit buffer objects clean up Sharat Masetty
2018-10-01 12:31   ` [PATCH 06/13] drm/msm: Use kzalloc for submit struct allocation Sharat Masetty
     [not found]     ` <1538397105-19581-7-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 18:13       ` Jordan Crouse
2018-10-03 10:50         ` Sharat Masetty [this message]
2018-10-01 12:31   ` [PATCH 07/13] drm/msm: Fix leak in submitqueue create Sharat Masetty
2018-10-01 12:31   ` [PATCH 08/13] drm/scheduler: set sched->thread to NULL in failure Sharat Masetty
2018-10-01 12:31   ` [PATCH 09/13] drm/msm: Use the DRM common Scheduler Sharat Masetty
     [not found]     ` <1538397105-19581-10-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-01 19:02       ` Jordan Crouse
2018-10-03 10:43         ` Sharat Masetty
2018-10-01 12:31   ` [PATCH 10/13] msm/drm: Remove unused code Sharat Masetty
2018-10-01 12:31   ` [PATCH 11/13] drm/scheduler: Add a timeout_start_notify function op Sharat Masetty
2018-10-01 12:31   ` [PATCH 12/13] jiffies: add utility function to calculate delta in ms Sharat Masetty
2018-10-01 12:31   ` [PATCH 13/13] drm/msm: Implement better timeout detection Sharat Masetty

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=fba633ff-5c9b-2765-73ea-f47ddee8b5c0@codeaurora.org \
    --to=smasetty@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox