diff options
author | Yan, Zheng <zyan@redhat.com> | 2014-09-10 04:56:23 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@redhat.com> | 2014-10-14 13:03:22 -0400 |
commit | 5d23371fdb7dc03fa6fe054da3467efb0d347945 (patch) | |
tree | e05b437dbc072722154b3ee555e7bc514650e0c0 /fs/ceph | |
parent | 589506f1e7f135943bcd34903bcdcf1fdaf00549 (diff) |
ceph: trim unused inodes before reconnecting to recovering MDS
So the recovering MDS does not need to fetch these ununsed inodes during
cache rejoin. This may reduce MDS recovery time.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/mds_client.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index bad07c09f91e..f751fea416e5 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -2695,16 +2695,6 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2695 | session->s_state = CEPH_MDS_SESSION_RECONNECTING; | 2695 | session->s_state = CEPH_MDS_SESSION_RECONNECTING; |
2696 | session->s_seq = 0; | 2696 | session->s_seq = 0; |
2697 | 2697 | ||
2698 | ceph_con_close(&session->s_con); | ||
2699 | ceph_con_open(&session->s_con, | ||
2700 | CEPH_ENTITY_TYPE_MDS, mds, | ||
2701 | ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); | ||
2702 | |||
2703 | /* replay unsafe requests */ | ||
2704 | replay_unsafe_requests(mdsc, session); | ||
2705 | |||
2706 | down_read(&mdsc->snap_rwsem); | ||
2707 | |||
2708 | dout("session %p state %s\n", session, | 2698 | dout("session %p state %s\n", session, |
2709 | session_state_name(session->s_state)); | 2699 | session_state_name(session->s_state)); |
2710 | 2700 | ||
@@ -2723,6 +2713,19 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2723 | discard_cap_releases(mdsc, session); | 2713 | discard_cap_releases(mdsc, session); |
2724 | spin_unlock(&session->s_cap_lock); | 2714 | spin_unlock(&session->s_cap_lock); |
2725 | 2715 | ||
2716 | /* trim unused caps to reduce MDS's cache rejoin time */ | ||
2717 | shrink_dcache_parent(mdsc->fsc->sb->s_root); | ||
2718 | |||
2719 | ceph_con_close(&session->s_con); | ||
2720 | ceph_con_open(&session->s_con, | ||
2721 | CEPH_ENTITY_TYPE_MDS, mds, | ||
2722 | ceph_mdsmap_get_addr(mdsc->mdsmap, mds)); | ||
2723 | |||
2724 | /* replay unsafe requests */ | ||
2725 | replay_unsafe_requests(mdsc, session); | ||
2726 | |||
2727 | down_read(&mdsc->snap_rwsem); | ||
2728 | |||
2726 | /* traverse this session's caps */ | 2729 | /* traverse this session's caps */ |
2727 | s_nr_caps = session->s_nr_caps; | 2730 | s_nr_caps = session->s_nr_caps; |
2728 | err = ceph_pagelist_encode_32(pagelist, s_nr_caps); | 2731 | err = ceph_pagelist_encode_32(pagelist, s_nr_caps); |