Renamed Genode::Node to Topology::Numa_region to avoid name clash with VFS plugin.

This commit is contained in:
Michael Mueller
2022-10-13 15:56:13 +02:00
parent c89715f905
commit e2e6153e7e
6 changed files with 42 additions and 20 deletions

View File

@@ -30,7 +30,7 @@ struct Genode::Topo_session_client : Rpc_client<Topo_session>
explicit Topo_session_client(Topo_session_capability session)
: Rpc_client<Topo_session>(session) { }
Node *node_affinity_of(Affinity::Location &loc) override {
Topology::Numa_region node_affinity_of(Affinity::Location const &loc) override {
return call<Rpc_node_affinity>(loc);
}

View File

@@ -27,7 +27,7 @@ struct Genode::Topo_connection : Connection<Topo_session>, Topo_session_client
{
enum
{
RAM_QUOTA = 8192
RAM_QUOTA = 262144
};
Topo_connection(Env &env, const char *label = "", Affinity const &affinity = Affinity())
@@ -36,7 +36,7 @@ struct Genode::Topo_connection : Connection<Topo_session>, Topo_session_client
session(env.parent(), affinity, "ram_quota=%u, cap_quota=%u, label=\"%s\"", RAM_QUOTA, CAP_QUOTA, label)),
Topo_session_client(cap()) {}
Node *node_affinity_of(Affinity::Location &loc) override {
Topology::Numa_region node_affinity_of(Affinity::Location const &loc) override {
return Topo_session_client::node_affinity_of(loc);
}

View File

@@ -17,26 +17,42 @@
#include <util/list.h>
namespace Genode {
struct Node;
namespace Topology {
struct Numa_region;
}
struct Genode::Node : List<Node>::Element
struct Topology::Numa_region : Genode::List<Topology::Numa_region>::Element
{
/* ID presented to component */
unsigned _id;
unsigned _core_count;
List<Node> neighbours;
Genode::List<Topology::Numa_region> neighbours;
/* Physical NUMA node ID */
unsigned _native_id;
Node(unsigned id, unsigned native_id) : _id(id), _core_count(0), neighbours(), _native_id(native_id) {}
Numa_region() : _id(0), _core_count(0), neighbours(), _native_id(0) { }
Numa_region(unsigned id, unsigned native_id) : _id(id), _core_count(0), neighbours(), _native_id(native_id) {}
Numa_region(Numa_region &copy) : _id(copy.id()), _core_count(copy.core_count()), neighbours(), _native_id(copy.native_id()) {
}
unsigned native_id() { return _native_id; }
unsigned id() { return _id; }
unsigned core_count() { return _core_count; }
void core_count(unsigned count) { _core_count = count; }
void increment_core_count() { _core_count++; }
Numa_region &operator=(const Numa_region &copy) {
if (this == &copy)
return *this;
this->_id = copy._id;
this->_core_count = copy._core_count;
this->_native_id = copy._native_id;
/* At the moment, we do not copy the list of neighbours, as it is not used by any our applications. */
/* TODO: Copy list onf neighbours, as soons as any application is going to use that information. */
return *this;
}
};

View File

@@ -22,9 +22,13 @@ namespace Genode {
struct Topo_session;
struct Topo_session_client;
struct Node;
}
namespace Topology
{
struct Numa_region;
} // namespace EalanOS
struct Genode::Topo_session : Session
{
/**
@@ -42,10 +46,10 @@ struct Genode::Topo_session : Session
virtual ~Topo_session() { }
virtual Node *node_affinity_of(Affinity::Location &) = 0;
virtual Topology::Numa_region node_affinity_of(Affinity::Location const &) = 0;
virtual unsigned node_count() = 0;
GENODE_RPC(Rpc_node_affinity, Node*, node_affinity_of, Affinity::Location &);
GENODE_RPC(Rpc_node_affinity, Topology::Numa_region, node_affinity_of, Affinity::Location const &);
GENODE_RPC(Rpc_node_count, unsigned, node_count);
GENODE_RPC_INTERFACE(Rpc_node_affinity, Rpc_node_count);

View File

@@ -32,7 +32,7 @@ class Genode::Topo_session_component : public Session_object<Topo_session>
Genode::Affinity &_affinity;
Sliced_heap _md_alloc;
Node ***_node_affinities;
Topology::Numa_region _node_affinities[64][64];
unsigned _node_count;
public:
@@ -45,11 +45,12 @@ class Genode::Topo_session_component : public Session_object<Topo_session>
Affinity &affinity
);
/**
* @brief Topology session interface
*/
Node *node_affinity_of(Affinity::Location &loc) override
Topology::Numa_region node_affinity_of(Affinity::Location const &loc) override
{
return _node_affinities[loc.xpos()][loc.ypos()];
}
@@ -58,4 +59,5 @@ class Genode::Topo_session_component : public Session_object<Topo_session>
{
return _node_count;
}
};

View File

@@ -32,7 +32,7 @@ struct Genode::Expanding_topo_session_client : Upgradeable_client<Genode::Topo_s
(parent, static_cap_cast<Genode::Topo_session_client::Rpc_interface>(cap), id)
{ }
Node *node_affinity_of(Affinity::Location &loc) override
Topology::Numa_region node_affinity_of(Affinity::Location const &loc) override
{
return retry<Out_of_ram>(
[&]()