Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1613215pxb; Thu, 4 Nov 2021 05:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK1lua9aZghy6WntF0NSKcKCeTH+6oLj3bkphXOHwZ9a7rVx/trkV2R94Lig+SmAKQoFOM X-Received: by 2002:a02:270c:: with SMTP id g12mr3535002jaa.75.1636029357935; Thu, 04 Nov 2021 05:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636029357; cv=none; d=google.com; s=arc-20160816; b=TN3Y891/ctMyI3ljkli3L89/rYV5SGIS8JHyMm7YEg/VRgi1p60uxTIkOzu376XFWl aPHo4vJ8iuB8jjF3oSjfTSp55Wr2ssH28rX+FoPQBjghQG6bV++Rdr9b93u3AFM79eUd tGoDTpnUeUQXiYoQ/V2Rz+qHasOhizpxF5rwzMvf0YVNohLneCzivcpC8KbQ0UTeq0Ms HfmlfH3kU+A15PZFWzpyk60pcMjzsa667IhWpKXja2Ogyu3OLaFscpA/2j/oloJon96g UoYCix9ChfBFIXXJE7iQZdIWwyqGjfWURGYAU6/RL7WSmioXOZC8YdpwoLKicL/rFWK2 O3bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=aFu1JsOmKFFLdx4Ihzdr2P27n2Aykyh/NedcJP1JwjM=; b=bOZTFUE0vnOcw1NYVVjRqlhD5xZyaUTOxSN6Ntz/ZHl0e6bUBC+zXqNild/bzPvRq/ qFCNIzhANPey0+FxmERxnH0eoWsOApw8OkCs/CvWT1qr3Xmh0cxtkExwo4YmqCbNdxBX TLaTJeq9Z/ij0lM/r8Py39kydXq4YMaAZn0ND+SLo9JIlKJ6LMj/nzFiovdFYAX7WxiU rE4llzhmWImDzegHAKZvliNvmzS/KZ61CDZ8er1EwU/Wd+jmoOeFd1HQbVTRAqLpanig Yh6yQ6g7oke2HVnSXx0qsbI7CRiCqo1Kov0H9a1oaNbnlOgplnLHzbZ6kMzDM9Evhug6 GFWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HpXuaPQC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Uyw3J5Du; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si4484520iol.49.2021.11.04.05.35.45; Thu, 04 Nov 2021 05:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HpXuaPQC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Uyw3J5Du; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbhKDMed (ORCPT + 99 others); Thu, 4 Nov 2021 08:34:33 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:46904 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231558AbhKDMea (ORCPT ); Thu, 4 Nov 2021 08:34:30 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 52EB2218B5; Thu, 4 Nov 2021 12:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1636029111; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aFu1JsOmKFFLdx4Ihzdr2P27n2Aykyh/NedcJP1JwjM=; b=HpXuaPQCNb5O0OpuBujykpA7OX/vUyqJVOFTTQu38ohEFYbXzqUGBiwfeln0X/8eJu2x7p OaooeVMTF27gTQSdk8g5tYxGq/F7J7PHXsyKlK3GP+npoZUBRaIDqecprMbAyiPp4L04tS fdXhpXVuuizGzuiY4Yl4tyxFAJSy9PM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1636029111; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aFu1JsOmKFFLdx4Ihzdr2P27n2Aykyh/NedcJP1JwjM=; b=Uyw3J5DuwGQu/bhqNakAUlLgAxmIDvIYluwfK+6qO50Qok/bsO5cxEg7XC8iPjppixaWRk W1Fv50KdCXJFZ/Cw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D7F9C13BD4; Thu, 4 Nov 2021 12:31:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kNXlMbbSg2HLDQAAMHmgww (envelope-from ); Thu, 04 Nov 2021 12:31:50 +0000 Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id c23833fa; Thu, 4 Nov 2021 12:31:49 +0000 (UTC) From: =?UTF-8?q?Lu=C3=ADs=20Henriques?= To: Jeff Layton , Ilya Dryomov , Xiubo Li Cc: Patrick Donnelly , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Lu=C3=ADs=20Henriques?= Subject: [PATCH v2 2/2] ceph: add a new metric to keep track of remote object copies Date: Thu, 4 Nov 2021 12:31:47 +0000 Message-Id: <20211104123147.1632-3-lhenriques@suse.de> In-Reply-To: <20211104123147.1632-1-lhenriques@suse.de> References: <20211104123147.1632-1-lhenriques@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds latency and size metrics for remote object copies operations ("copyfrom"). For now, these metrics will be available on the client only, they won't be sent to the MDS. Cc: Patrick Donnelly Signed-off-by: Luís Henriques --- fs/ceph/debugfs.c | 3 ++- fs/ceph/file.c | 4 ++++ fs/ceph/metric.h | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index e04ae1098431..3cf7c9c1085b 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -167,7 +167,8 @@ static int metrics_file_show(struct seq_file *s, void *p) static const char * const metric_str[] = { "read", "write", - "metadata" + "metadata", + "copyfrom" }; static int metrics_latency_show(struct seq_file *s, void *p) { diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6c77f203e7b5..220a41831b46 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2304,6 +2304,10 @@ static ssize_t ceph_do_objects_copy(struct ceph_inode_info *src_ci, u64 *src_off else { ceph_osdc_start_request(osdc, req, false); ret = ceph_osdc_wait_request(osdc, req); + ceph_update_copyfrom_metrics(&fsc->mdsc->metric, + req->r_start_latency, + req->r_end_latency, + object_size, ret); ceph_osdc_put_request(req); } if (ret) { diff --git a/fs/ceph/metric.h b/fs/ceph/metric.h index e67fc997760b..bb45608181e7 100644 --- a/fs/ceph/metric.h +++ b/fs/ceph/metric.h @@ -129,6 +129,7 @@ enum metric_type { METRIC_READ, METRIC_WRITE, METRIC_METADATA, + METRIC_COPYFROM, METRIC_MAX }; @@ -214,4 +215,11 @@ static inline void ceph_update_metadata_metrics(struct ceph_client_metric *m, ceph_update_metrics(&m->metric[METRIC_METADATA], r_start, r_end, 0, rc); } +static inline void ceph_update_copyfrom_metrics(struct ceph_client_metric *m, + ktime_t r_start, ktime_t r_end, + unsigned int size, int rc) +{ + ceph_update_metrics(&m->metric[METRIC_COPYFROM], + r_start, r_end, size, rc); +} #endif /* _FS_CEPH_MDS_METRIC_H */