[tip:sched/core] sched/completions: Use bool in try_wait_for_completion()

2018-03-09 Thread tip-bot for gaurav jindal
Commit-ID: d17067e4487adc53bedb43681b3cb5a1714ff6ca Gitweb: https://git.kernel.org/tip/d17067e4487adc53bedb43681b3cb5a1714ff6ca Author: gaurav jindal AuthorDate: Wed, 21 Feb 2018 18:24:07 +0530 Committer: Ingo Molnar CommitDate: Fri, 9 Mar 2018 08:00:18 +0100 sched/completions: Use

Re: [PATCH]sched: completion: use bool in try_wait_for_completion

2018-02-21 Thread gaurav jindal
On Wed, Feb 21, 2018 at 02:28:54PM +0100, Peter Zijlstra wrote: > On Wed, Feb 21, 2018 at 06:24:07PM +0530, gaurav jindal wrote: > > Variable ret in try_wait_for_completion can have only true/false values. > > Since > > the return type of the function is also bool, variable

[PATCH]sched: completion: use bool in try_wait_for_completion

2018-02-21 Thread gaurav jindal
dependent). Modifying the data type reduces the size consumed for the stack. Signed-off-by: Gaurav Jindal --- diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 0926aef..3e15e8d 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -283,7 +283,7 @@ int __sched

[PATCH]sched: completion: use bool in try_wait_for_completion

2018-02-14 Thread gaurav jindal
Use bool in place of int in the function try_wait_for_completion. Signed-off-by: Gaurav Jindal --- diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 0926aef..3e15e8d 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -283,7 +283,7 @@ int __sched

[PATCH]sched: completion: use bool in try_wait_for_completion

2018-01-24 Thread gaurav jindal
Use bool in place of int in the function try_wait_for_completion. Signed-off-by: Gaurav Jindal --- diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 0926aef..3e15e8d 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -283,7 +283,7 @@ int __sched

Re: [PATCH]cpuidle: preventive check in cpuidle_select against crash

2018-01-04 Thread gaurav jindal
On Wed, Jan 03, 2018 at 12:16:26PM +0100, Rafael J. Wysocki wrote: > On Friday, December 29, 2017 7:45:22 PM CET gaurav jindal wrote: > > On Wed, Dec 27, 2017 at 03:30:02AM +0100, Rafael J. Wysocki wrote: > > > On Wed, Dec 27, 2017 at 2:57 AM, gaurav jindal > > > wr

Re: [PATCH]cpuidle: preventive check in cpuidle_select against crash

2017-12-29 Thread gaurav jindal
On Wed, Dec 27, 2017 at 03:30:02AM +0100, Rafael J. Wysocki wrote: > On Wed, Dec 27, 2017 at 2:57 AM, gaurav jindal > wrote: > > On Wed, Dec 27, 2017 at 01:42:58AM +0100, Rafael J. Wysocki wrote: > >> On Tue, Dec 26, 2017 at 8:26 AM, gaurav jindal > >> wrote: > &

Re: [PATCH]cpuidle: preventive check in cpuidle_select against crash

2017-12-26 Thread gaurav jindal
On Wed, Dec 27, 2017 at 01:42:58AM +0100, Rafael J. Wysocki wrote: > On Tue, Dec 26, 2017 at 8:26 AM, gaurav jindal > wrote: > > When selecting the idle state using cpuidle_select, there is no > > check on cpuidle_curr_governor. In cpuidle_switch_governor, > > cpuidle_curr

[PATCH]cpuidle: preventive check in cpuidle_select against crash

2017-12-25 Thread gaurav jindal
g logs and returning can help in debugging and preventing possible kernel crash scenarios. Signed-off-by: Gaurav Jindal --- diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 68a1682..bf08e3a 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -268,6 +268

Re: [PATCH]locking:mutex Print warning if trylock in irq context

2017-12-22 Thread gaurav jindal
On Fri, Dec 22, 2017 at 09:51:09PM +0100, Peter Zijlstra wrote: > On Sat, Dec 23, 2017 at 02:15:19AM +0530, gaurav jindal wrote: > > Since mutex_trylock must not be called from interrupt context, a robustness > > can be added to this function by throwing a warning if it is called i

[PATCH]locking:mutex Print warning if trylock in irq context

2017-12-22 Thread gaurav jindal
Since mutex_trylock must not be called from interrupt context, a robustness can be added to this function by throwing a warning if it is called in interrupt context. It would help to make debugging easier in case of undesired calling of this function. Signed-off-by: gaurav jindal --- diff --git

Re: [PATCH] drivers: cpuidle: Fix checkpatch error and warnings

2017-09-08 Thread gaurav jindal
_SYMBOL_GPL(cpuidle_unregister_device); Signed-off-by: gaurav jindal --- diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 60bb64f..f2be6dd 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -339,7 +339,6 @@ void cpuidle_pause_and_lock(void)

Re: [PATCH] drivers: cpuidle: Fix checkpatch error and warnings

2017-09-07 Thread gaurav jindal
this patch fixes the below checkpatch errors and warnings in drivers/cpuidle/cpuidle.c WARNING: line over 80 characters #311: FILE: drivers/cpuidle/cpuidle.c:311: + /* Make sure all changes finished before we switch to new idle */ WARNING: EXPORT_SYMBOL(foo); should immediately fol

[PATCH] drivers: cpuidle: Fix checkpatch error and warnings

2017-09-07 Thread gaurav jindal
_SYMBOL_GPL(cpuidle_register_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #561: FILE: drivers/cpuidle/cpuidle.c:561: +EXPORT_SYMBOL_GPL(cpuidle_unregister_device); Signed-off-by: gaurav jindal --- diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c in

[PATCH]drivers: cpuidle: remove checkpatch error

2017-09-01 Thread gaurav jindal
this commit removes the checkpatch error in cpuidle_enable_device function. With removal of error, this commit makes the calling of cpuidle_curr_governor->enable more smooth. Signed-off-by: gaurav jindal --- diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 60bb

[PATCH] cpudile: optimize cpuidle_enable_device error handling

2017-09-01 Thread gaurav jindal
do not fetch per cpu drv id cpuidle_curr_governor is NULL. if cpuidle_enable_device is NULL return -EIO. it prevents the addtional per cpu processing Signed-off-by: Gaurav Jindal --- diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 1519716..6464e09 100644 --- a/drivers

[PATCH]optimize error handling in tick_check_new_device

2016-07-27 Thread Gaurav Jindal (Gaurav Jindal)
In the function tick_check_new_device, module error is handled after checking if the newdev should go as broadcast-installation device in the functions tick_check_percpu and tick_check_preferred. In case the try_module_get returns false, the above 2 calls are extra thus wasting CPU cycles. Shiftin

[tip:timers/core] tick/nohz: Optimize nohz idle enter

2016-07-19 Thread tip-bot for Gaurav Jindal
Commit-ID: 1f3b0f8243cb934307f59bd4d8e43b868e61d4d9 Gitweb: http://git.kernel.org/tip/1f3b0f8243cb934307f59bd4d8e43b868e61d4d9 Author: Gaurav Jindal AuthorDate: Thu, 14 Jul 2016 12:04:20 + Committer: Thomas Gleixner CommitDate: Tue, 19 Jul 2016 13:48:24 +0200 tick/nohz: Optimize

Re: [PATCH]time: Optimize nohz idle enter

2016-07-19 Thread Gaurav Jindal (Gaurav Jindal)
On Tue, Jul 19, 2016 at 10:47:37AM +0200, Thomas Gleixner wrote: > On Thu, 14 Jul 2016, Gaurav Jindal (Gaurav Jindal) wrote: > > > > tick_nohz_start_idle is called before checking the condition if the idle > > tick > > can be stopped. In case when can_stop_idle_t

[tip:sched/core] sched/idle: Optimize the generic idle loop

2016-06-03 Thread tip-bot for Gaurav Jindal (Gaurav Jindal)
Commit-ID: df55f462b905f3b2d40ec3fb865891382a6ebfb1 Gitweb: http://git.kernel.org/tip/df55f462b905f3b2d40ec3fb865891382a6ebfb1 Author: Gaurav Jindal (Gaurav Jindal) AuthorDate: Thu, 12 May 2016 10:13:33 + Committer: Ingo Molnar CommitDate: Fri, 3 Jun 2016 09:18:56 +0200 sched/idle

Re: [Patch]cpuidle: Save current cpu as local variable instead of calling smp_processor_id() in loop

2016-05-19 Thread Gaurav Jindal (Gaurav Jindal)
Hi Peterz Thanks a lot for the overwhelming response :) I will look into the change history to have a pervasive understanding of the framework. On Wed, May 18, 2016 at 02:40:52PM +0200, Peter Zijlstra wrote: > On Wed, May 18, 2016 at 02:30:44PM +0200, Peter Zijlstra wrote: > > void cpu_idle (v

[Patch]cpuidle: Save current cpu as local variable instead of calling smp_processor_id() in loop

2016-05-12 Thread Gaurav Jindal (Gaurav Jindal)
cpu_idle_loop is called 8672 times. Shifting the code will save instructions executed in loop and eventually time as well. Signed-off-by: Gaurav Jindal Reviewed-by: Sanjeev Yadav --- diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 1214f0a..82698e5 100644 --- a/kernel/sched/idle.c +++ b

[Patch]cpuidle: Save current cpu as local once instead of calling smp_processor_id() in loop

2016-05-11 Thread Gaurav Jindal (Gaurav Jindal)
architecture shows that cpu_idle_loop is hit 8672 times. If calculation mechanism is changed it will save instructions and eventually time as well. Signed-off-by: gaurav jindal Reviewed-by: sanjeev yadav

[PATCH]sched:idle: do not fetch current cpu id in loop

2016-05-01 Thread Gaurav Jindal (Gaurav Jindal)
(smp_processor_id())) + if (cpu_is_offline(cpu_id)) arch_cpu_idle_dead(); local_irq_disable(); -- Signed-off-by: Gaurav Jindal Reviewed-by: Sanjeev Yadav Regards Gaurav Jindal

[PATCH]sched: cpuidle: Do not fetch current cpu in loop in idle thread

2016-04-27 Thread Gaurav Jindal (Gaurav Jindal)
) check_pgt_cache(); rmb(); - if (cpu_is_offline(smp_processor_id())) + if(cpu_is_offline(cpu_id)) arch_cpu_idle_dead(); local_irq_disable(); -- Signed-off-by: Gaurav Jindal