mbox series

[0/4] sched: Minor cleanups

Message ID cover.1490268634.git.viresh.kumar@linaro.org
Headers show
Series sched: Minor cleanups | expand

Message

Viresh Kumar March 23, 2017, 11:35 a.m. UTC
Hi,

Here are few minor cleanups for the sched core. The first three tries to
avoid reinitializing memory which is already set to zero and the last
one drops an unused statement.

--
viresh

Viresh Kumar (4):
  sched: topology: drop memset() from init_rootdomain()
  sched: cpudeadline: don't re-initialize struct cpudl
  sched: cpupri: don't re-initialize struct cpupri
  sched: core: drop useless expression from sched_init()

 kernel/sched/core.c        | 1 -
 kernel/sched/cpudeadline.c | 2 --
 kernel/sched/cpupri.c      | 3 ---
 kernel/sched/topology.c    | 4 +---
 4 files changed, 1 insertion(+), 9 deletions(-)

-- 
2.12.0.432.g71c3a4f4ba37

Comments

Peter Zijlstra March 27, 2017, 1:58 p.m. UTC | #1
On Thu, Mar 23, 2017 at 05:05:55PM +0530, Viresh Kumar wrote:
> Hi,

> 

> Here are few minor cleanups for the sched core. The first three tries to

> avoid reinitializing memory which is already set to zero and the last

> one drops an unused statement.

> 


I'm OK with the kzalloc/memset thing, but I'd prefer to keep all those
other bits.

Yes they're superfluous, but this is init code, so nobody cares about
performance and having those things explitic makes it easier to read.

As to the very latest patch, that's there so that if/when we extend that
array we can simply continue. Also its more symmetric/consistent. Any
half sane DCE pass should get rid of it anyway, as the result is unused.
Viresh Kumar April 10, 2017, 9:30 a.m. UTC | #2
On 27-03-17, 15:58, Peter Zijlstra wrote:
> On Thu, Mar 23, 2017 at 05:05:55PM +0530, Viresh Kumar wrote:

> > Hi,

> > 

> > Here are few minor cleanups for the sched core. The first three tries to

> > avoid reinitializing memory which is already set to zero and the last

> > one drops an unused statement.

> > 

> 

> I'm OK with the kzalloc/memset thing,


I assume that you are fine with removal of memset as done in the first
3 patches. Or you are fine with just the first patch?

> but I'd prefer to keep all those

> other bits.

> 

> Yes they're superfluous, but this is init code, so nobody cares about

> performance and having those things explitic makes it easier to read.


Sure.

> As to the very latest patch, that's there so that if/when we extend that

> array we can simply continue. Also its more symmetric/consistent. Any

> half sane DCE pass should get rid of it anyway, as the result is unused.


But we aren't going to extend the array all the time and keeping a
statement like that just for symmetry doesn't sound that great :).
Anyway, I will drop the last patch as you suggested.

-- 
viresh