mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 23:28:29 +00:00
Attach affinity information to session requests
This patch extends the 'Parent::session()' and 'Root::session()' functions with an additional 'affinity' parameter, which is inteded to express the preferred affinity of the new session. For CPU sessions provided by core, the values will be used to select the set of CPUs assigned to the CPU session. For other services, the session affinity information can be utilized to optimize the locality of the server thread with the client. For example, to enable the IRQ session to route an IRQ to the CPU core on which the corresponding device driver (the IRQ client) is running.
This commit is contained in:
7
base-linux/src/base/env/platform_env.cc
vendored
7
base-linux/src/base/env/platform_env.cc
vendored
@ -56,7 +56,8 @@ Platform_env_base::Rm_session_mmap::_dataspace_writable(Dataspace_capability ds)
|
||||
|
||||
Session_capability
|
||||
Platform_env::Local_parent::session(Service_name const &service_name,
|
||||
Session_args const &args)
|
||||
Session_args const &args,
|
||||
Affinity const &affinity)
|
||||
{
|
||||
if (strcmp(service_name.string(),
|
||||
Rm_session::service_name()) == 0)
|
||||
@ -66,7 +67,7 @@ Platform_env::Local_parent::session(Service_name const &service_name,
|
||||
.ulong_value(~0);
|
||||
|
||||
if (size == 0)
|
||||
return Parent_client::session(service_name, args);
|
||||
return Parent_client::session(service_name, args, affinity);
|
||||
|
||||
Rm_session_mmap *rm = new (env()->heap())
|
||||
Rm_session_mmap(true, size);
|
||||
@ -74,7 +75,7 @@ Platform_env::Local_parent::session(Service_name const &service_name,
|
||||
return Session_capability::local_cap(rm);
|
||||
}
|
||||
|
||||
return Parent_client::session(service_name, args);
|
||||
return Parent_client::session(service_name, args, affinity);
|
||||
}
|
||||
|
||||
|
||||
|
3
base-linux/src/base/env/platform_env.h
vendored
3
base-linux/src/base/env/platform_env.h
vendored
@ -387,7 +387,8 @@ namespace Genode {
|
||||
**********************/
|
||||
|
||||
Session_capability session(Service_name const &,
|
||||
Session_args const &);
|
||||
Session_args const &,
|
||||
Affinity const & = Affinity());
|
||||
void close(Session_capability);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user