Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

linux kernel patch

Name: Anonymous 2008-10-06 20:40

OK, so for my Operating Systems class I have to modify the linux kernel/sched.h in order to make the priority levels be scheduled by processes with the lowest timeslice. I was thinking that changing the enqueue_task function (http://lxr.linux.no/linux+v2.6.17.14/kernel/sched.c#L610) to check the timeslice of the passed task and insert it into the priority array list thing in the appropriate place....do you guys think this would work?

Name: Anonymous 2008-10-06 21:09

No


exceptions

Name: Anonymous 2008-10-06 21:16

>>1
Torvalds?

Name: Anonymous 2008-10-06 21:49

>>1
Nope! Keep guessing haha (I actually had the same assignment last semester, and have the diff's sitting in front of me.) Enjoy dicking around with the code and/or begging people to help your stupid nigger ass!

Name: Anonymous 2008-10-06 22:45

>>5
well..thanks guy

Name: Anonymous 2008-10-06 23:31

Wait, so you want to change the scheduling algorithm to schedule the processes by the lowest timeslice? That is, you want the processes with the lowest timeslice to be scheduled first?

Name: Anonymous 2008-10-06 23:47

>>6
yes, we are supposed to arrange the priority array so that within each priority level, tasks with the lowest timeslice are scheduled first. Tasks of equal priority and timeslice are scheduled round robin. I know this is supposed to make the kernel perform worse, but that's the assignment.

Name: Anonymous 2008-10-07 0:07

That actually sounds like a good and relevant assignment. Nothing like the Java stuff we have to do. Do you benchmark the performance change somehow?

Name: Anonymous 2008-10-07 0:09

yeah we have to benchmark our compiled kernel against the regular one using hackbench

looks like this is going to take a while, though, sched.c is like 4000 lines

Name: Anonymous 2008-10-07 0:33

I write 4000 lines of code in like an hour.

Name: Anonymous 2008-10-07 0:48

>>10
oh...well I'm in Computer Engineering, so we've been doing more hardware/electronics stuff up until this (besides Java and C++ classes). So this class has basically been fuckoff hard so far. CS majors aren't complaining so much I guess.

>>5
So...if you already have it done do you mind giving me a hint or something? I don't want your code, just the theory

Name: Anonymous 2008-10-07 0:52

>>5
Let me preface this with "we're not here to do your homework for you". Obviously, it's a lot of code and you'll probably end up adding only a couple lines. You don't need to read the code (and if you started reading it, you fucked up already). Just open it up in a browser and start Ctrl-F'ing.

The next suggestion is to listen to your professor. Back when I was in school, we had a couple similar assignments (except with the Windows Research Kernel). Each day the professor would drop a couple of hints; a week before the project was due he pretty much described the entire scheduling system in detail, pointing out the places which needed changes. I hope you were paying attention (if not, just bother them during their office hours).

Anyway, enqueue_task is a good place to start, but isn't where you want to make modifications. The reason is because everyone and their mom is going to be calling this function, and the purpose of the function is to jut the task into the queue; nothing more.

If you Ctrl-F around the code, you should turn up scheduler_tick and schedule (which are nice big functions which make better starting points). IIRC, the former is called by a timer interrupt and is responsible for maintaining the time_slice state of the tasks, while the later is the main scheduler function.

Read through and make sure you understand what's generally going on in the main scheduler function, with special attention to lines 3011-3030. As a hint, sched_find_first_bit returns the priority that's currently executing.

You should not make any changes to the main schedule function, but if you understand those 20 lines of code (and understand how, exactly, Linux is assigning task priorities in the first place) you'll see and understand exactly where you should hook in to assign your own task priorities.

Name: Anonymous 2008-10-07 1:33

this thread is fukken bookmark'd

i'm taking my OS class next semester.

Name: Anonymous 2008-10-07 1:35

>>12
You realize text editors have search functions, right?

Name: Anonymous 2008-10-07 1:36

>>14
And "Ctrl-F" is not the proper key to use in any decent text editor. Please stop referring to generic actions like searching in the most retarded way possible.

Name: Anonymous 2008-10-07 1:41

>>12
OP here, a thousand thanks, kind sir. I completely forgot to check the main schedule function. I was still trying to read through all the helper functions.

Name: Anonymous 2008-10-07 1:43

>>12
what what what.
did you get lost somehow?

Name: Anonymous 2008-10-07 2:01

I wish I got to do cool things like the OP

Name: Anonymous 2008-10-07 7:59

>>14
Why would I have/download the source to a shit operating system when I can open it in my web browser?

Name: Anonymous 2008-10-07 10:17

>>19
Good luck opening anything in your web browser without downloading it first.

Name: Anonymous 2008-10-07 12:03

>>20
THANKS I THINK I NEED IT.

Name: Anonymous 2008-10-07 14:47

>>20
>>19 has the page rendered in the remote server on request, then just downloads an image.

Name: Anonymous 2008-10-07 15:12

>>19
Why would you download a shitty web browser when you have a text editor? MYSTERIES OF THE WORLD.

Name: Emacs Power User 2008-10-07 18:45

>>23
You can have both in one application, you know. As well as email, code browser, system shell, LISP interpreter...

Name: Anonymous 2008-10-07 19:04

>>24
Dunno, sounds kind of monolithic to me.

Name: Anonymous 2008-10-07 19:09

>>25
yeah, GNU is funny like that. they want to use a microkernel and then make everything on top of it monolithic.

Name: Anonymous 2008-10-07 22:19

>>26
But Emacs is the OS!

Name: Anonymous 2008-10-07 23:03

Anonix

Name: Anonymous 2008-10-07 23:22

The ANONIX Project announced today,
that the known performance advantages of monolithic
kernel design will be incorporated into the new OS.

"Bootloader, Kernel, drivers and userspace applications will
be a single binary, fitting into the MBR" CUDDER said.
"By extending the monolithic kernel to userspace, [/spoiler]ANONIX[/spoiler]
will outperform any operating system on the market"

Name: ​​​​​​​​​​ 2010-10-22 5:45

Don't change these.
Name: Email:
Entire Thread Thread List