Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip-luminous #17

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f569c94
libceph: remove ceph_sanitize_features() workaround
idryomov Jun 5, 2017
3ef4778
libceph: new features macros
idryomov Jun 5, 2017
1858ec0
libceph: handle non-empty dest in ceph_{oloc,oid}_copy()
idryomov Jun 5, 2017
30a0806
libceph: advertise support for OSD_POOLRESEND
idryomov Jun 5, 2017
e214ca7
libceph: support SERVER_JEWEL feature bits
idryomov Jun 5, 2017
f66e10a
libceph: fold [l]req->last_force_resend into ceph_osd_request_target
idryomov Jun 5, 2017
e9d52ee
libceph: new pi->last_force_request_resend
idryomov Jun 5, 2017
0767761
libceph: introduce ceph_spg, ceph_pg_to_primary_shard()
idryomov Jun 15, 2017
a18008f
libceph: encode_{pgid,oloc}() helpers
idryomov Jun 15, 2017
b9df881
libceph: ceph_connection_operations::reencode_message() method
idryomov Jun 15, 2017
a424fff
libceph: MOSDOp v8 encoding (actual spgid + full hash)
idryomov Jun 15, 2017
e6f9e18
libceph: drop need_resend from calc_target()
idryomov Jun 15, 2017
736d024
libceph: resend on PG splits if OSD has RESEND_ON_SPLIT
idryomov Jun 15, 2017
e00ec9a
libceph: delete from need_resend_linger before check_linger_pool_dne()
idryomov Jun 15, 2017
4a3caa2
libceph: make sure need_resend targets reflect latest map
idryomov Jun 15, 2017
90d04ca
libceph: always populate t->target_{oid,oloc} in calc_target()
idryomov Jun 15, 2017
0dfa356
libceph: use target pi for calc_target() calculations
idryomov Jun 15, 2017
dddd5d6
libceph: avoid unnecessary pi lookups in calc_target()
idryomov Jun 15, 2017
eb215e3
libceph: make DEFINE_RB_* helpers more general
idryomov Jun 19, 2017
c61f2e2
libceph: respect RADOS_BACKOFF backoffs
idryomov Jun 19, 2017
096c046
libceph: don't pass pgid by value
idryomov Jun 21, 2017
05e2d73
libceph: introduce and switch to decode_pg_mapping()
idryomov Jun 21, 2017
f797369
libceph: kill __{insert,lookup,remove}_pg_mapping()
idryomov Jun 21, 2017
563a58b
libceph: ceph_decode_skip_* helpers
idryomov Jun 21, 2017
9e4f962
libceph: pg_upmap[_items] infrastructure
idryomov Jun 21, 2017
f715cb5
libceph: compute actual pgid in ceph_pg_to_up_acting_osds()
idryomov Jun 21, 2017
304db71
libceph: apply_upmap()
idryomov Jun 21, 2017
71b0ef1
crush: implement weight and id overrides for straw2
idryomov Jun 22, 2017
3139168
libceph, crush: per-pool crush_choose_arg_map for crush_do_rule()
idryomov Jun 22, 2017
e67a0bf
crush: crush_init_workspace starts with struct crush_work
idryomov Jun 22, 2017
3651243
crush: remove an obsolete comment
idryomov Jun 22, 2017
0b43f7e
libceph: osd_state is 32 bits wide in luminous
idryomov Jun 22, 2017
0a1a69c
libceph: advertise support for NEW_OSDOP_ENCODING and SERVER_LUMINOUS
idryomov Jun 26, 2017
adde767
libceph: fix old style declaration warnings
arndb Jul 10, 2017
cea22be
libceph: use alloc_pg_mapping() in __decode_pg_upmap_items()
idryomov Jul 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
libceph: respect RADOS_BACKOFF backoffs
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
idryomov committed Jul 3, 2017
commit c61f2e2750a05a4b9f77e9e0c48a2450196a4e2a
1 change: 1 addition & 0 deletions include/linux/ceph/ceph_fs.h
Original file line number Diff line number Diff line change
@@ -147,6 +147,7 @@ struct ceph_dir_layout {
#define CEPH_MSG_OSD_OP 42
#define CEPH_MSG_OSD_OPREPLY 43
#define CEPH_MSG_WATCH_NOTIFY 44
#define CEPH_MSG_OSD_BACKOFF 61


/* watch-notify operations */
45 changes: 45 additions & 0 deletions include/linux/ceph/osd_client.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _FS_CEPH_OSD_CLIENT_H
#define _FS_CEPH_OSD_CLIENT_H

#include <linux/bitrev.h>
#include <linux/completion.h>
#include <linux/kref.h>
#include <linux/mempool.h>
@@ -36,6 +37,8 @@ struct ceph_osd {
struct ceph_connection o_con;
struct rb_root o_requests;
struct rb_root o_linger_requests;
struct rb_root o_backoff_mappings;
struct rb_root o_backoffs_by_id;
struct list_head o_osd_lru;
struct ceph_auth_handshake o_auth;
unsigned long lru_ttl;
@@ -275,6 +278,48 @@ struct ceph_watch_item {
struct ceph_entity_addr addr;
};

struct ceph_spg_mapping {
struct rb_node node;
struct ceph_spg spgid;

struct rb_root backoffs;
};

struct ceph_hobject_id {
void *key;
size_t key_len;
void *oid;
size_t oid_len;
u64 snapid;
u32 hash;
u8 is_max;
void *nspace;
size_t nspace_len;
s64 pool;

/* cache */
u32 hash_reverse_bits;
};

static inline void ceph_hoid_build_hash_cache(struct ceph_hobject_id *hoid)
{
hoid->hash_reverse_bits = bitrev32(hoid->hash);
}

/*
* PG-wide backoff: [begin, end)
* per-object backoff: begin == end
*/
struct ceph_osd_backoff {
struct rb_node spg_node;
struct rb_node id_node;

struct ceph_spg spgid;
u64 id;
struct ceph_hobject_id *begin;
struct ceph_hobject_id *end;
};

#define CEPH_LINGER_ID_START 0xffff000000000000ULL

struct ceph_osd_client {
1 change: 1 addition & 0 deletions include/linux/ceph/osdmap.h
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ struct ceph_spg {
};

int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs);
int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs);

#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id
together */
6 changes: 6 additions & 0 deletions include/linux/ceph/rados.h
Original file line number Diff line number Diff line change
@@ -439,6 +439,12 @@ enum {

const char *ceph_osd_watch_op_name(int o);

enum {
CEPH_OSD_BACKOFF_OP_BLOCK = 1,
CEPH_OSD_BACKOFF_OP_ACK_BLOCK = 2,
CEPH_OSD_BACKOFF_OP_UNBLOCK = 3,
};

/*
* an individual object operation. each may be accompanied by some data
* payload
1 change: 1 addition & 0 deletions net/ceph/ceph_common.c
Original file line number Diff line number Diff line change
@@ -85,6 +85,7 @@ const char *ceph_msg_type_name(int type)
case CEPH_MSG_OSD_OP: return "osd_op";
case CEPH_MSG_OSD_OPREPLY: return "osd_opreply";
case CEPH_MSG_WATCH_NOTIFY: return "watch_notify";
case CEPH_MSG_OSD_BACKOFF: return "osd_backoff";
default: return "unknown";
}
}
74 changes: 74 additions & 0 deletions net/ceph/debugfs.c
Original file line number Diff line number Diff line change
@@ -243,6 +243,73 @@ static void dump_linger_requests(struct seq_file *s, struct ceph_osd *osd)
mutex_unlock(&osd->lock);
}

static void dump_snapid(struct seq_file *s, u64 snapid)
{
if (snapid == CEPH_NOSNAP)
seq_puts(s, "head");
else if (snapid == CEPH_SNAPDIR)
seq_puts(s, "snapdir");
else
seq_printf(s, "%llx", snapid);
}

static void dump_name_escaped(struct seq_file *s, unsigned char *name,
size_t len)
{
size_t i;

for (i = 0; i < len; i++) {
if (name[i] == '%' || name[i] == ':' || name[i] == '/' ||
name[i] < 32 || name[i] >= 127) {
seq_printf(s, "%%%02x", name[i]);
} else {
seq_putc(s, name[i]);
}
}
}

static void dump_hoid(struct seq_file *s, const struct ceph_hobject_id *hoid)
{
if (hoid->snapid == 0 && hoid->hash == 0 && !hoid->is_max &&
hoid->pool == S64_MIN) {
seq_puts(s, "MIN");
return;
}
if (hoid->is_max) {
seq_puts(s, "MAX");
return;
}
seq_printf(s, "%lld:%08x:", hoid->pool, hoid->hash_reverse_bits);
dump_name_escaped(s, hoid->nspace, hoid->nspace_len);
seq_putc(s, ':');
dump_name_escaped(s, hoid->key, hoid->key_len);
seq_putc(s, ':');
dump_name_escaped(s, hoid->oid, hoid->oid_len);
seq_putc(s, ':');
dump_snapid(s, hoid->snapid);
}

static void dump_backoffs(struct seq_file *s, struct ceph_osd *osd)
{
struct rb_node *n;

mutex_lock(&osd->lock);
for (n = rb_first(&osd->o_backoffs_by_id); n; n = rb_next(n)) {
struct ceph_osd_backoff *backoff =
rb_entry(n, struct ceph_osd_backoff, id_node);

seq_printf(s, "osd%d\t", osd->o_osd);
dump_spgid(s, &backoff->spgid);
seq_printf(s, "\t%llu\t", backoff->id);
dump_hoid(s, backoff->begin);
seq_putc(s, '\t');
dump_hoid(s, backoff->end);
seq_putc(s, '\n');
}

mutex_unlock(&osd->lock);
}

static int osdc_show(struct seq_file *s, void *pp)
{
struct ceph_client *client = s->private;
@@ -268,6 +335,13 @@ static int osdc_show(struct seq_file *s, void *pp)
}
dump_linger_requests(s, &osdc->homeless_osd);

seq_puts(s, "BACKOFFS\n");
for (n = rb_first(&osdc->osds); n; n = rb_next(n)) {
struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node);

dump_backoffs(s, osd);
}

up_read(&osdc->lock);
return 0;
}
Loading