All the threadpool related stuff like stop/pause/drain etc. are not
handled by sharded queue anymore. All it is implementing are related to
processing,enqueue , signaling of waiting threads and shard queue status.
The pg ordering is been taken care of by introducing a map <pg,op> in each
shard.
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Now, the _process() of the derived queue is processing one request
at a time and the outer loop is controlled by the sharded threadpool.
The stop/pause/drain functionalities are controlled by the sharded TP.
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
This is the implementation for the client of the
sharded thread pool/sharded workQ. Removed the op_wq class and now OSD
ops are going through sharded workqueue model which is used by the
sharded threadpool. Derived ShardedOpWQ implementation has a data structure
called ShardData which has it's own lock/cond and storage. ShardedOpWQ
holds a vector of that and the size of the vector is a config option.
During enqueue operation on the queue, the ops are sharded across these
ShardData based on pg hash % number of shards.
Similarly, in the _process function the sharded thread pool threads are
divided across ShardData based on thread index % number of shards
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Threadpool will only be having a single work queue and internally the
work queue will be having multiple storage data structures.
Based on some logic (which is derived class implementation specific)
the work queue will shard the requests among these storage structures.
Each storage will be guarded by finer grained sunchronization
objects. Sharded threadpool threads will be assigned to work on a
shard based on some algorithm which is again derived class implementation
specific.
Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
We are allowing this for all and any integer values; that is, OPT_INT,
OPT_LONGLONG, OPT_U32 and OPT_U64.
It's on the user to use appropriate units. For instance, the user should
not use 'E(xabyte)' when setting a signed int, and use his best judgment
when setting options that, for instance, ought to receive seconds.
Fixes: 8265
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Accepts values with a suffix (B, K, M, G, T, P, E) and returns the
appropriate byte value.
E.g., 10B = 10, while 10K = 10240.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Fixes: #8436
Backport: firefly
This was broken in ddc2e1a8e3. The fix
resurrects and old check that was dropped.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Whenever an integer needs to be converted in a shard_id_t,
replace the implicit conversion with an explicit call to the
constructor.
Replace all ghobject_t::NO_SHARD and ghobject_t::no_shard() with
shard_id_t::NO_SHARD
Signed-off-by: Loic Dachary <loic@dachary.org>
When looping in the range [0,number of shards[ using a uint8_t variable
which is an integer instead of shard_id_t. The alternative would be
define the ++ operator on shard_id_t but since the two are used
interchangeably in a number of places, that seems unnecessary.
Signed-off-by: Loic Dachary <loic@dachary.org>
The struct contains a single uint8_t and is preferred to control
conversions that would otherwise be implicit. There is no difference
between shard_id_t and shard_t. The definition is moved in
include/types.h so it is available to both hobject.h and osd_types.h
http://tracker.ceph.com/issues/8254Fixes: #8254
Signed-off-by: Loic Dachary <loic@dachary.org>
For when a struct is defined to encapsulate a single value and get
control over implicit conversions that would otherwise be impossible
with typedef.
Signed-off-by: Loic Dachary <loic@dachary.org>
Include an estimate of the maximum writeable space for each pool. Note
that this value is a conservative estimate for that pool based on the
most-full OSD. It is also potentially misleading as it is the available
space if *all* new data were written to this pool; one cannot (generally)
add up the available space for all pools.
Signed-off-by: Sage Weil <sage@inktank.com>