Dario Faggioli [Wed, 13 May 2009 09:58:22 +0000 (11:58 +0200)]
Added speed reading functions.
frsh_resource_get_speed() function (and their implementations for CPU and
LCD) are added by this commit.
They can be used to retreive the ratio between the speed of a power level
and the maximum achievable speed for that resource.
Michal Sojka [Wed, 13 May 2009 00:15:44 +0000 (02:15 +0200)]
Added test for spare capacity
Currently, the test only tests conversion of SC blocks to strings. The
functionality is almost the same as in negotiation.c The implementation
of spare capacity redistribution is still not finished, so that it
doesn't test that the spare capacity is redistributed correctly.
Dario Faggioli [Tue, 12 May 2009 08:07:49 +0000 (10:07 +0200)]
Fix (again) AQuoSA compilation.
This should --definitely-- fix all the still open issues with
compiling the framework while having AQuoSA installed in non-standard
(i.e., non /usr or /usr/local) path.
Michal Sojka [Sun, 10 May 2009 09:47:25 +0000 (11:47 +0200)]
Added fra_get()
This functions might be used later by frsh_resource_(set|get)_power_level()
to implement this functionality by virtual functions.
In my opinion, set/get_poer_level functions should not be part of FRSH API.
It is not clear (to me) what happens when one application set one
power-level and second application different level. I think this function
should only be used internally (e.g. by contract broker) to achieve the
requirements specified by frsh_contract_set_min_expiration() and similar
functions.
Michal Sojka [Sun, 10 May 2009 09:42:51 +0000 (11:42 +0200)]
Additional FRA functionality implemented by virtual functions
The new virtual functions are:
- (un)bind_thread
- vres_get_XXX_usage
- support for feedback module
In d9964709b8f6fe7ebf97535daaf1a3c52f519f89, these functions were called
from switch statements in FRSH API and it was not possible to compile the
framework without DISK support (there were missing #ifdefs).
Dario [Sat, 9 May 2009 17:04:27 +0000 (19:04 +0200)]
Large commit with power management related fixes and features.
This is a very (too much, probably!) large commit including:
- redesigned per-resource power management logic;
- test cases for battery status reading;
- test case for CPU and LCD power management;
- full implementation of battery related functions and of
their implications for core and contract functions;
- bugfixes in existent power managemtnt code
Dario [Sat, 9 May 2009 15:14:29 +0000 (17:14 +0200)]
Fixed AQuoSA CPU resource management.
AQuoSA based CPU manager implementation was affected by quite
serious bugs, mainly with respect to vres modification (during)
renegotiation and removal (during cancellation).
Dario [Tue, 5 May 2009 15:33:44 +0000 (17:33 +0200)]
Added minimum contract duration.
As prescribed by the energy management module, it is now possible to ask
a contract to be negotiated only if the system lifetime is greater than
a certain value, specified by means of the energy management API.
Dario [Mon, 4 May 2009 13:49:25 +0000 (15:49 +0200)]
Fix critical bugs in FRSH Feedback module.
Some critical bugs was present in the feedback module implementation.
First of all, the module was not being compiled, thus a lot of comilation
error were in place, and anybody has never noticed them.
Also, the name of the spare bandwidth setting functions (for CPU and DISK)
were totally wrong.
Finally, the registration of the spare capacity block was not being performed.
This quite disruptive commit the support for multiple
resources is introduced into the FRSH-FORB architecture.
For now, only CPU and DISK resources are supported, but, as usual,
the framework is flexible enough to make the adding of new resources
as easy as possible.
Unfortunately, we have not been able (yet), mainly for time reasons,
to go with the framework's usual ORB and virtual function based approach,
and some switch/case logic has been added in FRSH API implementation. :-(
We think this approach could anyway be valuable, at least for now...
Refinements and more "clean" solutions may come in the future, and any
kind of suggestion is welcome with this respect.
Added VRES type to the key of thread/VRES repository.
Since more than one single resource type has to be supported, it
came out that using only the thread-ID as the key of the trhead/VRES
repository (i.e., where the mapping between thread and vreses is kept)
is not enough.
In fact, what would happen if the user tries to bind _the_same_ thread
to two different vreses, each one associated to a different resource?
For that reason, the repository (and its accessor functions) has been
modified such that also the vres type is part of the key. Thus, the
same thread could be safely bound to one vres for each resource
we have in the system.
This commit implements a subset of the FRSH API for power management.
It only (for now) support CPU and make use of the special "resource"
acpi_cpu added by previous commits.
This commit augments the framework with the capability of dealing with
disk bandwidth, by means of a special disk scheduling algorithm, BFQ
(http://feanor.sssup.it/~fabio/linux/bfq/, provided it is present
in the kernel).
Notice that this commit is not enough to make disk contracts usable,
and some of the upcoming one are needed in order of "activate" them.
Michal Sojka [Thu, 23 Apr 2009 11:23:20 +0000 (13:23 +0200)]
Implemented support for contract renegotiation
This patch changes significantly the interface between FCB and resource
managers and allocators. There no longer exist cancel_* method. The main
negotiation methods (manager.reserve_contracts, allocator.change_vreses) now
use an interface which supports the semantic offered by
frsh_group_change_mode_sync() i.e. in one negotiation operation, there might
be a combination of multiple requests to negotiate, renegotiate or cancel
contracts. Resource managers process these requests atomically, i.e. either
all requests succeed or none of them.
The interface for implementing individual resource managers and allocators
remains the same with one exception - fres_sa_scenario_for_each_contract()
was replaced by fres_sa_scenario_for_each_no_cancel_contract().
First stub of the implementation of the spare capacity module.
Only the frsh_contract_set_reclamation_params() and
frsh_contract_get_reclamation_params() functions have been implemented
since now, since we need them also for feedback module.
Michal Sojka [Sun, 1 Mar 2009 19:18:31 +0000 (20:18 +0100)]
Merge branch 'dario'
This is a merge of patches sent by Dario with some fixes and comments added by me.
* Merged commits:
First stub of the feedback API.
Different solution for dedaling with csects serialization.
Added comment for a possible bug
Better dealing with attr = NULL bug.
Memory leak in shared objects removed.
Small fixes from the prev. commit.
Testcase and bugfixes for synchronization and shared objects.
Added comments on possible changes in csect IDL block
Shared Objects.
Synchronization objects.
Updates to the previous commit: added documentation and fixed bugs
Further improvements in core API implementation.
Resource independent thread functions and synch/shared objects stub.
Bugfix and FRSH thread function generalization.
Dario Faggioli [Fri, 27 Feb 2009 09:03:08 +0000 (10:03 +0100)]
First stub of the feedback API.
FRSH Feedback is implemented in this commit. It only is in place for
AQuoSA based CPU resource manager, since CGroups still lacks the basics
for having it up and running (it can be done, but it will be the focus
of future work... Not enough time to deal with it now!).
Something is still missing, like retreival and renegotiation of the fake
spare_contract used for the feedback. Some more discussion is needed in
order of deciding how to realize it.
Dario Faggioli [Fri, 27 Feb 2009 00:54:12 +0000 (01:54 +0100)]
Different solution for dedaling with csects serialization.
The functions for the de/serialization of the frsh_group_csects_t data
type have been rethinked and rewritten.
Serialization and deserialization of memory areas and function pointers
are still missing, and probably need some more thinking in order to
decide what to do with respect to them.
Dario Faggioli [Fri, 27 Feb 2009 00:50:24 +0000 (01:50 +0100)]
Better dealing with attr = NULL bug.
Differently cope with the possibility of the thread attributes being
NULL during thread_create_and_bind. This new solution initializes it
internally, thus avoiding a potential non-initialized used of variable
p, containing thread priority.
Dario Faggioli [Thu, 26 Feb 2009 17:39:26 +0000 (18:39 +0100)]
Memory leak in shared objects removed.
The memory leak in write operation for protected critical sections has
been solved. Now the backup storage is an automatic variable for the
critical section invocation, and all the memory is allocated and freed
therein.
It is true that this cause much more overhead at each invocation, but
this is still better than undefinitely leaking memory, also because it
can be accounted for (if calculated) in blocking time (not implemented
yet).
Dario Faggioli [Thu, 26 Feb 2009 15:54:36 +0000 (16:54 +0100)]
Small fixes from the prev. commit.
Some data structures present in frsh_sharedobj.c are not needed nor
used, and have been left there because of mistake.
The same happened in the Makefile, where a rule for a not yet committed
test application is removed by this commit.
Dario Faggioli [Wed, 25 Feb 2009 08:42:59 +0000 (09:42 +0100)]
Shared Objects.
This commit introduces shared objects. The implementation is fully
resource manager independent, and thus can be used with dummy, AQuoSA,
CGroups, or whatever else.
A small uncompliance with the FRSH API semantic is present, since we
need the user not to create an external mutex that will be associated
with the shared object. Instead, we create the mutex along with the
shared object and return it to the user together with the shared object
handle.
This issue will be further analyzed to find out if it would be possible
to remove it...
Moreover, this commit does not fully implemente serialization and
deserialization for the critical sections contract block, since more
discussion is needed to address the issue. Thus, we only provide some
stubs here, just to make the framework compile and run some simple
tests.
Dario Faggioli [Wed, 25 Feb 2009 08:28:59 +0000 (09:28 +0100)]
Synchronization objects.
This commit introduces synchronization objects and thus complete the
core API implementation. There still are some minor functions that are
not-implemented, and they will be addressed later.
Synchronization objects basics are implemented at FRES layer, then the
FRSH API uses these services to provide compliant semantic to the
application.
Implementation is done on top of FOSA mutexes and condition variables,
so that is as much portable as it is possible (we hope!).
Dario Faggioli [Wed, 25 Feb 2009 07:57:15 +0000 (08:57 +0100)]
Further improvements in core API implementation.
Almost all the core API is implemented via this commit, with the only
exception of synchronization object.
In order to make it possible to retreive a vres ID by the thread ID of
the thread that is bound to it, a new GAVL has been added inside the
reasource allocator (FRES layer) containing all the threads that are
bound to any virtual resource.
Insertion in the tree is done during the frsh_thread_bind, deletion
during frsh_thread_unbind. It may still exist a leak if someone cancel a
contract (and thus the associated vres) without unbinding the threads
first. It is well known and a solution will be provided soon.
Dario Faggioli [Tue, 17 Feb 2009 11:35:15 +0000 (12:35 +0100)]
Resource independent thread functions and synch/shared objects stub.
The frsh_thread.c file is added to generic, manager independent, FRSH
core implementation. It basically adds frsh_thread_create_in_background
function, while service thread tuning functions are not supported yet.
Also, first stub of the code needed to handle synchronization and shared
object is added, and will be filled in the next commits.
Dario Faggioli [Sat, 14 Feb 2009 10:41:40 +0000 (11:41 +0100)]
Bugfix and FRSH thread function generalization.
Some bugs introduced in my previous commit have been fixed. More
important, some functions related to thread creation and management in
FRSH have been moved from resource managers to frsh_forb.
These functions are, for example frsh_thread_create_in_background, or
frsh_{set, get}_service_thread_data. This avoid code duplication inside
resource managers.