mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
Updated test0 with a forktest. Fixed timeslices. Updated kmem usage calculations.
- test0 now forks 16 tasks that each modify a global variable. - scheduler now gives 1/10th of a second per task. It also does not increase timeslice of a task that has scheduled. - When a memory is granted to the kernel, the distribution of this memory to memcaches was calculated in a complicated way. This is now simplified.
This commit is contained in:
@@ -78,9 +78,6 @@ struct kip {
|
||||
#define PAGER_TID 0
|
||||
#define VFS_TID 1
|
||||
#define BLKDEV_TID 2
|
||||
#define KERNEL_TID 3
|
||||
#define MAX_PREDEFINED_TID KERNEL_TID
|
||||
#define MIN_PREDEFINED_TID 0
|
||||
|
||||
#define __PAGERNAME__ "mm0"
|
||||
#define __KERNELNAME__ "code0"
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
|
||||
/* Ticks per second, try ticks = 1000 + timeslice = 1 for regressed preemption test. */
|
||||
#define HZ 100
|
||||
#define TASK_TIMESLICE_DEFAULT 5000
|
||||
/* #define TASK_TIMESLICE_DEFAULT (HZ/100)*/
|
||||
#define TASK_TIMESLICE_DEFAULT HZ/100
|
||||
|
||||
static inline struct ktcb *current_task(void)
|
||||
{
|
||||
|
||||
@@ -89,15 +89,14 @@ pmd_table_t *alloc_boot_pmd(void);
|
||||
* The granted memory is used in an architecture-specific way, e.g. for pgds,
|
||||
* pmds, and kernel stack. Therefore this should be defined per-arch.
|
||||
*/
|
||||
typedef struct kmem_usage_per_grant {
|
||||
int grant_size; /* The size of the grant given by pager */
|
||||
int task_size_avg; /* Average memory a task occupies */
|
||||
int tasks_per_kmem_grant; /* Num of tasks to allocate for, per grant */
|
||||
int pg_total; /* Total size of page allocs needed per grant */
|
||||
int pmd_total; /* Total size of pmd allocs needed per grant */
|
||||
int pgd_total; /* Total size of pgd allocs needed per grant */
|
||||
int extra; /* Extra unused space, left per grant */
|
||||
} kmem_usage_per_grant_t;
|
||||
typedef struct grant_kmem_usage {
|
||||
unsigned long total_size;
|
||||
unsigned long total_tasks;
|
||||
unsigned long total_pgds;
|
||||
unsigned long total_pmds;
|
||||
unsigned long total_tcbs;
|
||||
unsigned long extra;
|
||||
} grant_kmem_usage_t;
|
||||
|
||||
void paging_init(void);
|
||||
void init_pmd_tables(void);
|
||||
|
||||
Reference in New Issue
Block a user