bonefish+axeld:

* Implemented a tiny bit more sophisticated version of
  estimate_max_scheduling_latency() that uses a syscall that lets the scheduler
  decide.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36170 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-04-11 20:40:58 +00:00
parent 5ffdbfdebb
commit ee0d2be9e4
7 changed files with 114 additions and 28 deletions
+13 -10
View File
@@ -1,6 +1,6 @@
/*
* Copyright 2008-2009, Ingo Weinhold, [email protected].
* Copyright 2005, Axel Dörfler, [email protected].
* Copyright 2008-2010, Ingo Weinhold, [email protected].
* Copyright 2005-2010, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_SCHEDULER_H
@@ -22,17 +22,19 @@ struct scheduler_ops {
void (*enqueue_in_run_queue)(struct thread* thread);
void (*reschedule)(void);
void (*set_thread_priority)(struct thread* thread, int32 priority);
// called when the thread structure is first created -
// initialization of per-thread housekeeping data structures should
// be done here
bigtime_t (*estimate_max_scheduling_latency)(struct thread* thread);
void (*on_thread_create)(struct thread* thread);
// called when a thread structure is initialized and made ready for
// use - should be used to reset the housekeeping data structures
// if needed
// called when the thread structure is first created -
// initialization of per-thread housekeeping data structures should
// be done here
void (*on_thread_init)(struct thread* thread);
// called when a thread structure is freed - freeing up any allocated
// mem on the scheduler's part should be done here
// called when a thread structure is initialized and made ready for
// use - should be used to reset the housekeeping data structures
// if needed
void (*on_thread_destroy)(struct thread* thread);
// called when a thread structure is freed - freeing up any allocated
// mem on the scheduler's part should be done here
void (*start)(void);
};
@@ -61,6 +63,7 @@ void scheduler_remove_listener(struct SchedulerListener* listener);
void scheduler_init(void);
bigtime_t _user_estimate_max_scheduling_latency(thread_id thread);
status_t _user_analyze_scheduling(bigtime_t from, bigtime_t until, void* buffer,
size_t size, struct scheduling_analysis* analysis);
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2009, Haiku Inc. All rights reserved.
* Copyright 2004-2010, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYSTEM_SYSCALLS_H
@@ -177,6 +177,8 @@ extern status_t _kern_unblock_thread(thread_id thread, status_t status);
extern status_t _kern_unblock_threads(thread_id* threads, uint32 count,
status_t status);
extern bigtime_t _kern_estimate_max_scheduling_latency(thread_id thread);
// user/group functions
extern gid_t _kern_getgid(bool effective);
extern uid_t _kern_getuid(bool effective);