AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben.tuikov@amd.com>
To: Nirmoy <nirmodas@amd.com>, Nirmoy Das <nirmoy.aiemd@gmail.com>,
	amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, kenny.ho@amd.com, nirmoy.das@amd.com,
	christian.koenig@amd.com
Subject: Re: [PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP
Date: Wed, 22 Jan 2020 11:24:30 -0500	[thread overview]
Message-ID: <ce850bcf-7b1e-5a97-5c24-eefe16010b0c@amd.com> (raw)
In-Reply-To: <6fbc12e5-ded7-ebc6-f905-f75f8faf5e1d@amd.com>

On 2020-01-22 4:32 a.m., Nirmoy wrote:
> 
> On 1/22/20 12:34 AM, Luben Tuikov wrote:
>>
>>> +		for (j = 0; j < amdgpu_ctx_num_entities[i]; ++j) {
>>> +			struct amdgpu_ctx_entity *entity = &ctx->entities[i][j];
>>>   
>>> -		kfree(entity->fences);
>>> -		entity->fences = NULL;
>>> +			kfree(entity->fences);
>>> +			entity->fences = NULL;
>>> +		}
>>> +
>>> +error_cleanup_entity_memory:
>> "cleanup" refers to something spilled, or something to be collected.
> It is  collecting memory.

But it really is doing a "kfree()". Freeing previously allocated
memory. The traditional working is most accessible, in my opinion.

>> (Or winning in a wagered game of chance.) Also at "module_exit", maybe.
>>
>> The kernel has traditionally used "unroll" and "free" for this. Now, since
>> you're unrolling the loop (notice that it sits after the "return 0;"), then
>> you can backtrack and name it like this:
>>
>> Error_unroll_free1:
>> 	for ( ; i >= 0; i--)
>> 		free(my_array[i]);
>>
> I prefer the existing style makes it more readable.
> 
> 
> Regards,
> 
> Nirmoy
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2020-01-22 16:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 16:50 [PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP Nirmoy Das
2020-01-21 16:50 ` [PATCH 2/2] drm/amdgpu: allocate entities on demand Nirmoy Das
2020-01-22  0:07   ` Luben Tuikov
2020-01-22  9:25     ` Nirmoy
2020-01-22 15:51       ` Luben Tuikov
2020-01-21 23:34 ` [PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP Luben Tuikov
2020-01-22  9:32   ` Nirmoy
2020-01-22 16:24     ` Luben Tuikov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-01-22  9:33 Nirmoy Das

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=ce850bcf-7b1e-5a97-5c24-eefe16010b0c@amd.com \
    --to=luben.tuikov@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=kenny.ho@amd.com \
    --cc=nirmodas@amd.com \
    --cc=nirmoy.aiemd@gmail.com \
    --cc=nirmoy.das@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox