Motr  M0
m0_rm_resource_type Struct Reference

#include <rm.h>

Collaboration diagram for m0_rm_resource_type:
Collaboration graph

Data Fields

const struct m0_rm_resource_type_opsrt_ops
 
const char * rt_name
 
uint64_t rt_id
 
struct m0_mutex rt_lock
 
struct m0_tl rt_resources
 
uint32_t rt_nr_resources
 
struct m0_sm_group rt_sm_grp
 
struct m0_thread rt_worker
 
bool rt_stop_worker
 
struct m0_rm_domainrt_dom
 
struct m0_mutex rt_queue_guard
 
struct m0_queue rt_ha_events
 

Detailed Description

Resources are classified into disjoint types. Resource type determines how its instances interact with the resource management generic core and defines:

  • how the resources of this type are named;
  • where the resources of this type are located;
  • what resource credits are defined on the resources of this type;
  • how credits are ordered;
  • how credit conflicts are resolved.

Definition at line 387 of file rm.h.

Field Documentation

◆ rt_dom

struct m0_rm_domain* rt_dom

Domain this resource type is registered with.

Definition at line 428 of file rm.h.

◆ rt_ha_events

struct m0_queue rt_ha_events

Incoming events associated with remote RM owner are enqueued in this event queue. The queue is protected by rt_queue_guard, and relevant handling of the events is done by the AST thread.

Todo:
:
  1. Ideally queue shall be operated in lockfree manner to avoid taking locks in HA callback and in AST thread. Currently since only one producer and one consumer contend for the queue lock and critical section is not large this has been differed. Lockfree queue would also require a bit of memory management.
  2. HA should not send the same state twice, and ideally Motr should assert on such incidence. This implementation would circumvent such behaviour by HA. Once Halon is completely replaced by Hare RM can assert on such spurious notifications.

Definition at line 447 of file rm.h.

◆ rt_id

uint64_t rt_id

A resource type identifier, globally unique within a cluster, used to identify resource types on wire and storage.

This identifier is used as an index in m0_rm_domain::rd_types.

Todo:
Currently this is assigned manually and centrally. In the future, resource types identifiers (as well as rpc item opcodes) will be assigned dynamically by a special service (and then announced to the clients). Such identifier name-spaces are resources themselves, so, welcome to a minefield of bootstrapping.

Definition at line 403 of file rm.h.

◆ rt_lock

struct m0_mutex rt_lock

Definition at line 404 of file rm.h.

◆ rt_name

const char* rt_name

Definition at line 389 of file rm.h.

◆ rt_nr_resources

uint32_t rt_nr_resources

Active references to this resource type from resource instances (m0_rm_owner::ro_resource). Protected by m0_rm_resource_type::rt_lock.

Definition at line 415 of file rm.h.

◆ rt_ops

const struct m0_rm_resource_type_ops* rt_ops

Definition at line 388 of file rm.h.

◆ rt_queue_guard

struct m0_mutex rt_queue_guard

Definition at line 430 of file rm.h.

◆ rt_resources

struct m0_tl rt_resources

List of all resources of this type. Protected by m0_rm_resource_type::rt_lock.

Definition at line 409 of file rm.h.

◆ rt_sm_grp

struct m0_sm_group rt_sm_grp

Definition at line 416 of file rm.h.

◆ rt_stop_worker

bool rt_stop_worker

Flag for ro_worker thread to stop.

Definition at line 424 of file rm.h.

◆ rt_worker

struct m0_thread rt_worker

Executes ASTs for this owner.

Definition at line 420 of file rm.h.


The documentation for this struct was generated from the following file: