Lumiera
The new emerging NLE for GNU/Linux
State Idea
Date Fri Jul 23 20:33:32 2010
Proposed by Christian Thaeter <ct@pipapo.org>

The Profiler will give some Idea about how much Resources can me used to optimally utilize the system. Knowing this number leads to the next challenge, distributing the resources to different subsystems, jobs and objects. I here introduce a budgeting system which takes care for this.

Description

The idea is quite simple, for each kind of resource we have a global budget manager which accounts for the available and used amounts of this resource.

Each user of a resource has its own account managing his share on the resource.

The system is completely voluntary giving only hints how much of a resource is available for anyone.

typedef ssize_t budget_count;

struct budgetmanager
{
  rwlock lock;

  void (*callback)();                   // called on resource shortage
  (resource collector)

  int sum_priorities;                   // sum of all client budgets .. each
  client is granted available/(sum_priorities/own_priority) of the resource

  budget_count available_prefs;         // configuration from preferences
  budget_count available_profile;       // tuned by profiler
  int available_factor;                 // how much % from prefs vs profile

  budget_count available;               // caclulated from above
  budget_count allocated;               // actively in use
};

struct budget
{
  BudgetManager manager;
  int priority;

  budget_count allocated;
};

Tasks

Discussion

Pros

Cons

Alternatives

viable:

Rationale

conclusions about its process:

Comments