All of lore.kernel.org
 help / color / mirror / Atom feed
* ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label
       [not found] <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcas5p3.samsung.com>
@ 2017-11-15  9:48 ` Namit Gupta
  2017-12-11 14:42   ` Steven Rostedt
       [not found]   ` <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcms5p4>
  0 siblings, 2 replies; 8+ messages in thread
From: Namit Gupta @ 2017-11-15  9:48 UTC (permalink / raw)
  To: rostedt, mingo, linux-kernel; +Cc: a.sahrawat, pankaj.m, Namit Gupta

ftrace_module_init happen after dynamic_debug_setup, it is desired that
cleanup should be called after this label however in current implementation
it is called in free module label,ie:even though ftrace in not initialized,
from so many fail case ftrace_release_mod() will be called and unnecessary
traverse the whole list.
In below patch we moved ftrace_release_mod() from free_module label to
ddebug_cleanup label. that is the best possible location, other solution
is to make new label to ftrace_release_mod() but since ftrace_module_init()
is not return with minimum changes it should be in ddebug_cleanup label.


Signed-off-by: Namit Gupta <gupta.namit@samsung.com>
Reviewed-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
 kernel/module.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 0d1cb8d..3498d62 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3523,6 +3523,12 @@ static int load_module(struct load_info *info, const char __user *uargs,
 	unset_module_core_ro_nx(mod);
 
  ddebug_cleanup:
+	/*
+	 * Ftrace needs to clean up what it initialized.
+	 * This does nothing if ftrace_module_init() wasn't called,
+	 * but it must be called outside of module_mutex.
+	 */
+	ftrace_release_mod(mod);
 	dynamic_debug_remove(info->debug);
 	synchronize_sched();
 	kfree(mod->args);
@@ -3541,12 +3547,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
 	synchronize_rcu();
 	mutex_unlock(&module_mutex);
  free_module:
-	/*
-	 * Ftrace needs to clean up what it initialized.
-	 * This does nothing if ftrace_module_init() wasn't called,
-	 * but it must be called outside of module_mutex.
-	 */
-	ftrace_release_mod(mod);
 	/* Free lock-classes; relies on the preceding sync_rcu() */
 	lockdep_free_key_range(mod->module_core, mod->core_size);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label
       [not found]     ` <20171129053635epcms5p46340b7d7c82cc90ff9b31fa26ac40878@epcms5p4>
@ 2017-11-29 12:14       ` Steven Rostedt
       [not found]       ` <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcms5p1>
  1 sibling, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2017-11-29 12:14 UTC (permalink / raw)
  To: NAMIT GUPTA; +Cc: mingo, linux-kernel, AMIT SAHRAWAT, PANKAJ MISHRA

On Wed, 29 Nov 2017 05:36:35 +0000
NAMIT GUPTA <gupta.namit@samsung.com> wrote:

> ping
> 

Thanks for the ping. I should have sent a note that I see your email.
I'm just a bit backed up in other patches, I haven't gotten to it yet.
I should get to it this week, if not, ping me again next week.

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label
       [not found]         ` <20171206031707epcms5p1e0848a6672f4b7848046c0cae538f3ad@epcms5p1>
@ 2017-12-06 12:10           ` Steven Rostedt
  0 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2017-12-06 12:10 UTC (permalink / raw)
  To: NAMIT GUPTA; +Cc: mingo, linux-kernel, AMIT SAHRAWAT, PANKAJ MISHRA

On Wed, 06 Dec 2017 03:17:07 +0000
NAMIT GUPTA <gupta.namit@samsung.com> wrote:

> Hi Steve,
> 
>  
> 
> Please check the patch.

Sure. BTW, when you send a patch, please add '[PATCH]' in the subject.
I currently have over 17 thousand emails in my INBOX, and I filter
it on "[PATCH" to find patches that I missed. Which means your patch
will not show up.

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label
  2017-11-15  9:48 ` ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label Namit Gupta
@ 2017-12-11 14:42   ` Steven Rostedt
       [not found]   ` <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcms5p4>
  1 sibling, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2017-12-11 14:42 UTC (permalink / raw)
  To: Namit Gupta; +Cc: mingo, linux-kernel, a.sahrawat, pankaj.m


As I mentioned, please have "[PATCH]" in the subject.

On Wed, 15 Nov 2017 15:18:54 +0530
Namit Gupta <gupta.namit@samsung.com> wrote:

> ftrace_module_init happen after dynamic_debug_setup, it is desired that
> cleanup should be called after this label however in current implementation
> it is called in free module label,ie:even though ftrace in not initialized,
> from so many fail case ftrace_release_mod() will be called and unnecessary
> traverse the whole list.
> In below patch we moved ftrace_release_mod() from free_module label to
> ddebug_cleanup label. that is the best possible location, other solution
> is to make new label to ftrace_release_mod() but since ftrace_module_init()
> is not return with minimum changes it should be in ddebug_cleanup label.
> 
> 
> Signed-off-by: Namit Gupta <gupta.namit@samsung.com>
> Reviewed-by: Amit Sahrawat <a.sahrawat@samsung.com>

Linus really looks down on this type of "Reviewed-by" tags. They are
meaningless. When a patch first shows up on the mailing list, it should
never have a "Reviewed-by" tag to it. Because to the maintainers, it
has not had a chance to be reviewed. We don't care about internal
company reviews. What should have happened, was this email goes to the
mailing list, and then Amit can reply to that email with a
"Reviewed-by", and any comments that Amit may have had. One reason that
we dislike internal reviews, is that we don't know what was discussed.
Since the review discussion is hidden, so should the tag.

Since the email was missing a "[PATCH]" in the subject, that means Amit
missed that too, and also takes the blame.

> ---
>  kernel/module.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/module.c b/kernel/module.c
> index 0d1cb8d..3498d62 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3523,6 +3523,12 @@ static int load_module(struct load_info *info, const char __user *uargs,
>  	unset_module_core_ro_nx(mod);
>  
>   ddebug_cleanup:
> +	/*
> +	 * Ftrace needs to clean up what it initialized.
> +	 * This does nothing if ftrace_module_init() wasn't called,
> +	 * but it must be called outside of module_mutex.
> +	 */

When I made this change, I thought the module_mutex was held for more
than it actually was, which is why I mistakenly put in further down
than it needed to be. Since it can go in the normal location (which
your patch is doing), we can nuke the comment.

Please send a v2, with "[PATCH v2]" in the subject.

Thanks!

-- Steve


> +	ftrace_release_mod(mod);
>  	dynamic_debug_remove(info->debug);
>  	synchronize_sched();
>  	kfree(mod->args);
> @@ -3541,12 +3547,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
>  	synchronize_rcu();
>  	mutex_unlock(&module_mutex);
>   free_module:
> -	/*
> -	 * Ftrace needs to clean up what it initialized.
> -	 * This does nothing if ftrace_module_init() wasn't called,
> -	 * but it must be called outside of module_mutex.
> -	 */
> -	ftrace_release_mod(mod);
>  	/* Free lock-classes; relies on the preceding sync_rcu() */
>  	lockdep_free_key_range(mod->module_core, mod->core_size);
>  
> -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Re: ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label
       [not found]   ` <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcms5p4>
       [not found]     ` <20171129053635epcms5p46340b7d7c82cc90ff9b31fa26ac40878@epcms5p4>
@ 2017-12-12  3:49     ` AMIT SAHRAWAT
  1 sibling, 0 replies; 8+ messages in thread
From: AMIT SAHRAWAT @ 2017-12-12  3:49 UTC (permalink / raw)
  To: Steven Rostedt, NAMIT GUPTA; +Cc: mingo, linux-kernel, PANKAJ MISHRA

Hi Steven,

>> ftrace_module_init happen after dynamic_debug_setup, it is desired that
>> cleanup should be called after this label however in current implementation
>> it is called in free module label,ie:even though ftrace in not initialized,
>> from so many fail case ftrace_release_mod() will be called and unnecessary
>> traverse the whole list.
>> In below patch we moved ftrace_release_mod() from free_module label to
>> ddebug_cleanup label. that is the best possible location, other solution
>> is to make new label to ftrace_release_mod() but since ftrace_module_init()
>> is not return with minimum changes it should be in ddebug_cleanup label.
>> 
>> 
>> Signed-off-by: Namit Gupta <gupta.namit@samsung.com>
>> Reviewed-by: Amit Sahrawat <a.sahrawat@samsung.com>
> 
>Linus really looks down on this type of "Reviewed-by" tags. They are
>meaningless. When a patch first shows up on the mailing list, it should
>never have a "Reviewed-by" tag to it. Because to the maintainers, it
>has not had a chance to be reviewed. We don't care about internal
>company reviews. What should have happened, was this email goes to the
>mailing list, and then Amit can reply to that email with a
>"Reviewed-by", and any comments that Amit may have had. One reason that
>we dislike internal reviews, is that we don't know what was discussed.
>Since the review discussion is hidden, so should the tag.
> 

I fully agree to what you say and the overall perspective for the open source.
When i consider the situation, it was reviewed for our internal issue fixing and adopting 
to our kernel. And with respect to "internal reviews" it ended there itself.

After adopting it was realized to push this to open source as well.
Which as a policy is correct, but the submission method went wrong.
May be it is first patch from Namit and i did not notice due to our mail client.

>Since the email was missing a "[PATCH]" in the subject, that means Amit
>missed that too, and also takes the blame.

Yes, i did not notice that in my mailbox as well. 
It can just be put to my skipping of this mail as the code was finalized for internal purpose,
i did not notice that the external patch is having "Reviewed-by" and obviously the subject as you mentioned
[PATCH] was missing from it. I am aware of the guidelines and method for contribution, this particular patch submission can be put to my ignorance.
So, I take the blame for this as well.

Thanks & Regards,
Amit Sahrawat

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ftrace/module: Move ftrace_release_mod to ddebug_cleanup label
  2017-12-29  0:57       ` Steven Rostedt
@ 2017-12-29  1:02         ` Jessica Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Jessica Yu @ 2017-12-29  1:02 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Namit Gupta, mingo, linux-kernel, pankaj.m, a.sahrawat, rusty

+++ Steven Rostedt [28/12/17 19:57 -0500]:
>On Fri, 29 Dec 2017 01:36:48 +0100
>Jessica Yu <jeyu@kernel.org> wrote:
>
>> +++ Steven Rostedt [28/12/17 11:32 -0500]:
>> >
>> >Jessica,
>> >
>> >Can you take this patch. You can add:
>> >
>> >Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>>
>> Sure, thanks Steven.
>>
>> Namit, your patch does not apply cleanly to modules-next nor
>> linux-next. It looks like you based your patch on an old tree?
>> (e.g., we got rid of the module_core and core_size fields a few years
>> ago...) Could you please rebase your patch on linux-next and resend?
>
>I should probably re-review the rebased patch.

Yeah, that'd be much appreciated :-)

Thanks!

Jessica

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ftrace/module: Move ftrace_release_mod to ddebug_cleanup label
  2017-12-29  0:36     ` Jessica Yu
@ 2017-12-29  0:57       ` Steven Rostedt
  2017-12-29  1:02         ` Jessica Yu
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2017-12-29  0:57 UTC (permalink / raw)
  To: Jessica Yu; +Cc: Namit Gupta, mingo, linux-kernel, pankaj.m, a.sahrawat, rusty

On Fri, 29 Dec 2017 01:36:48 +0100
Jessica Yu <jeyu@kernel.org> wrote:

> +++ Steven Rostedt [28/12/17 11:32 -0500]:
> >
> >Jessica,
> >
> >Can you take this patch. You can add:
> >
> >Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>  
> 
> Sure, thanks Steven.
> 
> Namit, your patch does not apply cleanly to modules-next nor
> linux-next. It looks like you based your patch on an old tree?
> (e.g., we got rid of the module_core and core_size fields a few years
> ago...) Could you please rebase your patch on linux-next and resend? 

I should probably re-review the rebased patch.

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ftrace/module: Move ftrace_release_mod to ddebug_cleanup label
  2017-12-28 16:32   ` Steven Rostedt
@ 2017-12-29  0:36     ` Jessica Yu
  2017-12-29  0:57       ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Jessica Yu @ 2017-12-29  0:36 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Namit Gupta, mingo, linux-kernel, pankaj.m, a.sahrawat, rusty

+++ Steven Rostedt [28/12/17 11:32 -0500]:
>
>Jessica,
>
>Can you take this patch. You can add:
>
>Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Sure, thanks Steven.

Namit, your patch does not apply cleanly to modules-next nor
linux-next. It looks like you based your patch on an old tree?
(e.g., we got rid of the module_core and core_size fields a few years
ago...) Could you please rebase your patch on linux-next and resend? 

Thanks,

Jessica

>On Tue, 12 Dec 2017 17:24:32 +0530
>Namit Gupta <gupta.namit@samsung.com> wrote:
>
>> ftrace_module_init happen after dynamic_debug_setup, it is desired that
>> cleanup should be called after this label however in current implementation
>> it is called in free module label,ie:even though ftrace in not initialized,
>> from so many fail case ftrace_release_mod() will be called and unnecessary
>> traverse the whole list.
>> In below patch we moved ftrace_release_mod() from free_module label to
>> ddebug_cleanup label. that is the best possible location, other solution
>> is to make new label to ftrace_release_mod() but since ftrace_module_init()
>> is not return with minimum changes it should be in ddebug_cleanup label.
>>
>>
>> Signed-off-by: Namit Gupta <gupta.namit@samsung.com>
>>
>> ---
>>  kernel/module.c | 7 +------
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 0d1cb8d..4be966a 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -3523,6 +3523,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
>>  	unset_module_core_ro_nx(mod);
>>
>>   ddebug_cleanup:
>> +	ftrace_release_mod(mod);
>>  	dynamic_debug_remove(info->debug);
>>  	synchronize_sched();
>>  	kfree(mod->args);
>> @@ -3541,12 +3542,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
>>  	synchronize_rcu();
>>  	mutex_unlock(&module_mutex);
>>   free_module:
>> -	/*
>> -	 * Ftrace needs to clean up what it initialized.
>> -	 * This does nothing if ftrace_module_init() wasn't called,
>> -	 * but it must be called outside of module_mutex.
>> -	 */
>> -	ftrace_release_mod(mod);
>>  	/* Free lock-classes; relies on the preceding sync_rcu() */
>>  	lockdep_free_key_range(mod->module_core, mod->core_size);
>>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-29  1:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcas5p3.samsung.com>
2017-11-15  9:48 ` ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label Namit Gupta
2017-12-11 14:42   ` Steven Rostedt
     [not found]   ` <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcms5p4>
     [not found]     ` <20171129053635epcms5p46340b7d7c82cc90ff9b31fa26ac40878@epcms5p4>
2017-11-29 12:14       ` Steven Rostedt
     [not found]       ` <CGME20171115095144epcas5p38455d1efc3aab5d80caa640583c9587c@epcms5p1>
     [not found]         ` <20171206031707epcms5p1e0848a6672f4b7848046c0cae538f3ad@epcms5p1>
2017-12-06 12:10           ` Steven Rostedt
2017-12-12  3:49     ` AMIT SAHRAWAT
     [not found] <CGME20171212115859epcas5p1c80cacda05c36d4ef2607df2450d4aa3@epcas5p1.samsung.com>
2017-12-12 11:54 ` [PATCH v2] ftrace/module: Move ftrace_release_mod " Namit Gupta
2017-12-28 16:32   ` Steven Rostedt
2017-12-29  0:36     ` Jessica Yu
2017-12-29  0:57       ` Steven Rostedt
2017-12-29  1:02         ` Jessica Yu

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.