Code Review - Refactor kernel scheduler

1 view
Skip to first unread message

Kevin Klues

unread,
Nov 11, 2015, 8:15:03 PM11/11/15
to aka...@googlegroups.com
This set of commits refactors the kernel scheduler to allow different
core allocation strategies to be plugged in at compile time.
Currently, the existing FCFS core allocation strategy is the only
option, but soon there will be more.

In a subsequent CL, I will introduce a strategy based on packing cores
as tightly as possible for a given application, while keeping cores
allocated to different processes as far from one another as possible.

The changes in this request can be viewed online at:
https://github.com/brho/akaros/compare/1ed63f9...d942fa1

The following changes since commit 1ed63f9f8e25820f7eb217727d4ee88efe827d41:

Migrated Akaros code to use pragma once (XCC) (2015-11-11 11:37:59 -0500)

are available in the git repository at:

g...@github.com:klueska/akaros refactor-scheduler

for you to fetch changes up to d942fa1769e1baf2ef0966a573277ba110f5a88f:

Move coreprov_proc_init() to corealloc_proc_init() (2015-11-11 17:01:20 -0800)

----------------------------------------------------------------
Kevin Klues (17):
Move sched_pcore and friends to corerequest.h
Move spc2pcoreid and pcoreid2spc into header file
Refactor to move prov stuff to coreprov.c (1/4)
Refactor to move prov stuff to coreprov.c (2/4)
Refactor to move prov stuff to coreprov.c (3/4)
Refactor to move prov stuff to coreprov.c (4/4)
Refactor to move alloc stuff to corealloc.c (1/8)
Refactor to move alloc stuff to corealloc.c (2/8)
Refactor to move alloc stuff to corealloc.c (3/8)
Refactor to move alloc stuff to corealloc.c (4/8)
Refactor to move alloc stuff to corealloc.c (5/8)
Refactor to move alloc stuff to corealloc.c (6/8)
Refactor to move alloc stuff to corealloc.c (8/8)
Move is_ll_core(), max_vcores() to corerequest.h
Kconfig option to change core allocation policy
Declare sched_pcore in allocator specific file
Move coreprov_proc_init() to corealloc_proc_init()

leymariv (1):
First step to move corerequest API from schedule.c

Kconfig | 16 +++
kern/include/corerequest.h | 94 +++++++++++++
kern/include/fcfs_corealloc.h | 50 +++++++
kern/include/schedule.h | 25 +---
kern/src/Kbuild | 2 +
kern/src/coreprov.c | 94 +++++++++++++
kern/src/fcfs_corealloc.c | 233 +++++++++++++++++++++++++++++++
kern/src/monitor.c | 6 +-
kern/src/schedule.c | 315 +++++-------------------------------------
kern/src/syscall.c | 2 +-
10 files changed, 529 insertions(+), 308 deletions(-)
create mode 100644 kern/include/corerequest.h
create mode 100644 kern/include/fcfs_corealloc.h
create mode 100644 kern/src/coreprov.c
create mode 100644 kern/src/fcfs_corealloc.c

Kevin Klues

unread,
Nov 12, 2015, 3:34:54 PM11/12/15
to aka...@googlegroups.com
Updated with a new commit on top of the rest.

The changes in this request can be viewed online at:

https://github.com/brho/akaros/compare/1ed63f9...152eb22

The following changes since commit 1ed63f9f8e25820f7eb217727d4ee88efe827d41:

Migrated Akaros code to use pragma once (XCC) (2015-11-11 11:37:59 -0500)

are available in the git repository at:

g...@github.com:klueska/akaros refactor-scheduler

for you to fetch changes up to 152eb22fe461fe517b3b7a212b029ccc160e4b31:

Remove kernel scheduler dependence on sched_pcore (2015-11-12 12:29:55 -0800)

----------------------------------------------------------------
Kevin Klues (18):
Move sched_pcore and friends to corerequest.h
Move spc2pcoreid and pcoreid2spc into header file
Refactor to move prov stuff to coreprov.c (1/4)
Refactor to move prov stuff to coreprov.c (2/4)
Refactor to move prov stuff to coreprov.c (3/4)
Refactor to move prov stuff to coreprov.c (4/4)
Refactor to move alloc stuff to corealloc.c (1/8)
Refactor to move alloc stuff to corealloc.c (2/8)
Refactor to move alloc stuff to corealloc.c (3/8)
Refactor to move alloc stuff to corealloc.c (4/8)
Refactor to move alloc stuff to corealloc.c (5/8)
Refactor to move alloc stuff to corealloc.c (6/8)
Refactor to move alloc stuff to corealloc.c (8/8)
Move is_ll_core(), max_vcores() to corerequest.h
Kconfig option to change core allocation policy
Declare sched_pcore in allocator specific file
Move coreprov_proc_init() to corealloc_proc_init()
Remove kernel scheduler dependence on sched_pcore

leymariv (1):
First step to move corerequest API from schedule.c

Kconfig | 16 ++
kern/include/corerequest.h | 109 ++++++++++++++
kern/include/fcfs_corealloc.h | 40 +++++
kern/include/schedule.h | 25 +---
kern/src/Kbuild | 2 +
kern/src/coreprov.c | 96 ++++++++++++
kern/src/fcfs_corealloc.c | 235 +++++++++++++++++++++++++++++
kern/src/monitor.c | 6 +-
kern/src/schedule.c | 338 +++++-------------------------------------
kern/src/syscall.c | 2 +-
10 files changed, 545 insertions(+), 324 deletions(-)
create mode 100644 kern/include/corerequest.h
create mode 100644 kern/include/fcfs_corealloc.h
create mode 100644 kern/src/coreprov.c
create mode 100644 kern/src/fcfs_corealloc.c

--
~Kevin

Barret Rhoden

unread,
Nov 24, 2015, 10:59:18 AM11/24/15
to aka...@googlegroups.com
Hi -

On 2015-11-12 at 12:34 Kevin Klues <klu...@gmail.com> wrote:
> Updated with a new commit on top of the rest.
>
> The changes in this request can be viewed online at:
>
> https://github.com/brho/akaros/compare/1ed63f9...152eb22
>
> The following changes since commit
> 1ed63f9f8e25820f7eb217727d4ee88efe827d41:
>
> Migrated Akaros code to use pragma once (XCC) (2015-11-11 11:37:59
> -0500)
>
> are available in the git repository at:
>
> g...@github.com:klueska/akaros refactor-scheduler

Looks good overall. I had originally thought that people might replace
schedule.c with their changes. For example, someone might want to
change the whole double-list approach of primary_mcps and
secondary_mcps, change how/when the ksched deals with requests, etc.
But given the way things are and how schedule.c has grown, splitting out
the alloc strategy sounds good.

Two minor things:

1) Most of these commits are moving things around. The new files have
their own copyright header. Since they (at this point) heavily consist
of code from another file, the original header from e.g. schedule.c
should be on those new files.

2)
> From 504f55684d46d60f8682dc111dafa1aa6655787a Mon Sep 17 00:00:00 2001
> From: Kevin Klues <klu...@cs.berkeley.edu>
> Date: Mon, 5 Oct 2015 15:27:42 -0700
> Subject: Kconfig option to change core allocation policy

> kern/src/{corealloc.c => fcfs_corealloc.c} | 0

Any reason for TYPE_corealloc.c instead of corealloc_TYPE.c? The latter
will sort more nicely in kern/src.


Barret

Kevin Klues

unread,
Nov 24, 2015, 12:09:24 PM11/24/15
to aka...@googlegroups.com
On Tue, Nov 24, 2015 at 7:59 AM, Barret Rhoden <br...@cs.berkeley.edu> wrote:
> Hi -
>
> On 2015-11-12 at 12:34 Kevin Klues <klu...@gmail.com> wrote:
>> Updated with a new commit on top of the rest.
>>
>> The changes in this request can be viewed online at:
>>
>> https://github.com/brho/akaros/compare/1ed63f9...152eb22
>>
>> The following changes since commit
>> 1ed63f9f8e25820f7eb217727d4ee88efe827d41:
>>
>> Migrated Akaros code to use pragma once (XCC) (2015-11-11 11:37:59
>> -0500)
>>
>> are available in the git repository at:
>>
>> g...@github.com:klueska/akaros refactor-scheduler
>
> Looks good overall. I had originally thought that people might replace
> schedule.c with their changes. For example, someone might want to
> change the whole double-list approach of primary_mcps and
> secondary_mcps, change how/when the ksched deals with requests, etc.
> But given the way things are and how schedule.c has grown, splitting out
> the alloc strategy sounds good.

Fixed.

>
> Two minor things:
>
> 1) Most of these commits are moving things around. The new files have
> their own copyright header. Since they (at this point) heavily consist
> of code from another file, the original header from e.g. schedule.c
> should be on those new files.
>
> 2)
>> From 504f55684d46d60f8682dc111dafa1aa6655787a Mon Sep 17 00:00:00 2001
>> From: Kevin Klues <klu...@cs.berkeley.edu>
>> Date: Mon, 5 Oct 2015 15:27:42 -0700
>> Subject: Kconfig option to change core allocation policy
>
>> kern/src/{corealloc.c => fcfs_corealloc.c} | 0
>
> Any reason for TYPE_corealloc.c instead of corealloc_TYPE.c? The latter
> will sort more nicely in kern/src.
>

Fixed

>
> Barret
>
> --
> You received this message because you are subscribed to the Google Groups "Akaros" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
> To post to this group, send email to aka...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
~Kevin

Barret Rhoden

unread,
Nov 24, 2015, 2:51:56 PM11/24/15
to aka...@googlegroups.com
On 2015-11-24 at 09:08 Kevin Klues <klu...@gmail.com> wrote:
> Fixed

Thanks, merged to master at 63c72d8a58dc..2a8a96f534b9 (from, to]

You can see the entire diff with 'git diff' or at
https://github.com/brho/akaros/compare/63c72d8a58dc...2a8a96f534b9

Reply all
Reply to author
Forward
0 new messages