Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1690507pxb; Tue, 26 Oct 2021 13:58:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/yiXkTaT8OW/zDRsA3Wuj1OyEcl7vhs5PSTJlOPYCEAR1lc9AFJGCg0yaGZeZwPfqcRkj X-Received: by 2002:a50:fb10:: with SMTP id d16mr36756466edq.378.1635281909002; Tue, 26 Oct 2021 13:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635281908; cv=none; d=google.com; s=arc-20160816; b=V1GC35UNFfHj3lBk5a7P20OZcDKm1ArYeM7X2iBB6xsLEtz+7DihesxKoJgoDyYGMO xSTFs4AciNIf4Jxbq1hg/g31o5jgualDZaeZEN1uhwe2cy9gS8KvraHrwlx+lGTOQSlw isBCGZx/fUoPvNHDPAWgmECTzylHfz2V/uE3Efh8eFjBWbLc+tp73BYSu/WHmt1pQr/p 1vUPu/qFnY6Xvu17y6HbI49FSQd/NsDDOaKdgI0hn9U4lD4n33HlOCH585mNg43clVc0 m2kIywNz3Q6QUIm+iIdSWH4vkvZTHVquguBGMyJGao/9vWmpfMJZH8NLLzw4X46IM4jS Q6LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=WRaS7nJzrR8Imfw5d0ZNw+6zjdxIKCzj8dbxpPfA/HM=; b=VSpYFX8ADSEr9Mp91FzPiWEjiyS7gGHcMSIcpQ7gt/e4GUzjSyyKVk0593M8j3e5+c AQTiazfDMdLnCqwW3xpgI6oIXaa6TyrBIo08xOp7uH0iApC+EnGh96vZaUnu4Ai1PFI6 eKo44vB3YDItbrLEkEmjMR+V8mIgTQLVLm8kfEvo7joM5pgkioSmQDTqwd4ZEzklsuMc zncs5CVxO3oIONXTqgfureyQGUGQqs6dw8v6z/ynttwirRs3WpcXu/S/IUJMDbdPbph/ 2W0O7eRyAu/7jCKi35Sm/IL63O5jQ4duDeGnud06LphTtFhy+6MQwslPeCdnFWrb8t0R ViiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lDpCN6Bo; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="Kht/G5H7"; 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 hv9si20604030ejc.545.2021.10.26.13.58.02; Tue, 26 Oct 2021 13:58:28 -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=lDpCN6Bo; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="Kht/G5H7"; 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 S236883AbhJZPdz (ORCPT + 99 others); Tue, 26 Oct 2021 11:33:55 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:49032 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbhJZPdy (ORCPT ); Tue, 26 Oct 2021 11:33:54 -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 71457218EE; Tue, 26 Oct 2021 15:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635262289; 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=WRaS7nJzrR8Imfw5d0ZNw+6zjdxIKCzj8dbxpPfA/HM=; b=lDpCN6Bo6deYWNj0WHNQAInx1yVgZJdjHE2q7t7RQUmko4wr/18/tAkdMKao1HfrSZ6Gih IXTuKwrFFNhpVaFYFgKSqk+yKoYVk4PI5iOrUlaH0xOPvONq/dDwI4xao2MdR4LHcVQqil fcFRLUkeOmq5wfRRBmHMzyL8BSo8wzQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635262289; 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=WRaS7nJzrR8Imfw5d0ZNw+6zjdxIKCzj8dbxpPfA/HM=; b=Kht/G5H7YMoHA0zhEwv9vVMYYC9Z6a2YMeExQFrAPrK0aCmGCUYOHpMc1pdNBWTvY6Oo8X QAKdMnrwbLVWhACQ== 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 08C2713B0A; Tue, 26 Oct 2021 15:31:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mJTIOlAfeGGSNQAAMHmgww (envelope-from ); Tue, 26 Oct 2021 15:31:28 +0000 Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id 02f16863; Tue, 26 Oct 2021 15:31:28 +0000 (UTC) Date: Tue, 26 Oct 2021 16:31:28 +0100 From: =?iso-8859-1?Q?Lu=EDs?= Henriques To: Jeff Layton Cc: Xiubo Li , Patrick Donnelly , Ilya Dryomov , Ceph Development , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] ceph: add remote object copy counter to fs client Message-ID: References: <20211020143708.14728-1-lhenriques@suse.de> <34e379f9dec1cbdf09fffd8207f6ef7f4e1a6841.camel@kernel.org> <99209198dd9d8634245f153a90e4091851635a16.camel@kernel.org> <785d1435-4a2c-95aa-0573-2de54b4e7b6b@redhat.com> <604199ed389d9286e3fdab6b5acdf65c421df45d.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <604199ed389d9286e3fdab6b5acdf65c421df45d.camel@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 07:40:51AM -0400, Jeff Layton wrote: > On Tue, 2021-10-26 at 11:05 +0800, Xiubo Li wrote: > > On 10/22/21 1:30 AM, Patrick Donnelly wrote: > > > On Thu, Oct 21, 2021 at 12:35 PM Jeff Layton wrote: > > > > On Thu, 2021-10-21 at 12:18 -0400, Patrick Donnelly wrote: > > > > > On Thu, Oct 21, 2021 at 11:44 AM Jeff Layton wrote: > > > > > > On Thu, 2021-10-21 at 09:52 -0400, Patrick Donnelly wrote: > > > > > > > On Wed, Oct 20, 2021 at 12:27 PM Jeff Layton wrote: > > > > > > > > On Wed, 2021-10-20 at 15:37 +0100, Lu?s Henriques wrote: > > > > > > > > > This counter will keep track of the number of remote object copies done on > > > > > > > > > copy_file_range syscalls. This counter will be filesystem per-client, and > > > > > > > > > can be accessed from the client debugfs directory. > > > > > > > > > > > > > > > > > > Cc: Patrick Donnelly > > > > > > > > > Signed-off-by: Lu?s Henriques > > > > > > > > > --- > > > > > > > > > This is an RFC to reply to Patrick's request in [0]. Note that I'm not > > > > > > > > > 100% sure about the usefulness of this patch, or if this is the best way > > > > > > > > > to provide the functionality Patrick requested. Anyway, this is just to > > > > > > > > > get some feedback, hence the RFC. > > > > > > > > > > > > > > > > > > Cheers, > > > > > > > > > -- > > > > > > > > > Lu?s > > > > > > > > > > > > > > > > > > [0] https://github.com/ceph/ceph/pull/42720 > > > > > > > > > > > > > > > > > I think this would be better integrated into the stats infrastructure. > > > > > > > > > > > > > > > > Maybe you could add a new set of "copy" stats to struct > > > > > > > > ceph_client_metric that tracks the total copy operations done, their > > > > > > > > size and latency (similar to read and write ops)? > > > > > > > I think it's a good idea to integrate this into "stats" but I think a > > > > > > > local debugfs file for some counters is still useful. The "stats" > > > > > > > module is immature at this time and I'd rather not build any qa tests > > > > > > > (yet) that rely on it. > > > > > > > > > > > > > > Can we generalize this patch-set to a file named "op_counters" or > > > > > > > similar and additionally add other OSD ops performed by the kclient? > > > > > > > > > > > > > > > > > > > Tracking this sort of thing is the main purpose of the stats code. I'm > > > > > > really not keen on adding a whole separate set of files for reporting > > > > > > this. > > > > > Maybe I'm confused. Is there some "file" which is already used for > > > > > this type of debugging information? Or do you mean the code for > > > > > sending stats to the MDS to support cephfs-top? > > > > > > > > > > > What's the specific problem with relying on the data in debugfs > > > > > > "metrics" file? > > > > > Maybe no problem? I wasn't aware of a "metrics" file. > > > > > > > > > Yes. For instance: > > > > > > > > # cat /sys/kernel/debug/ceph/*/metrics > > > > item total > > > > ------------------------------------------ > > > > opened files / total inodes 0 / 4 > > > > pinned i_caps / total inodes 5 / 4 > > > > opened inodes / total inodes 0 / 4 > > > > > > > > item total avg_lat(us) min_lat(us) max_lat(us) stdev(us) > > > > ----------------------------------------------------------------------------------- > > > > read 0 0 0 0 0 > > > > write 5 914013 824797 1092343 103476 > > > > metadata 79 12856 1572 114572 13262 > > > > > > > > item total avg_sz(bytes) min_sz(bytes) max_sz(bytes) total_sz(bytes) > > > > ---------------------------------------------------------------------------------------- > > > > read 0 0 0 0 0 > > > > write 5 4194304 4194304 4194304 20971520 > > > > > > > > item total miss hit > > > > ------------------------------------------------- > > > > d_lease 11 0 29 > > > > caps 5 68 10702 > > > > > > > > > > > > I'm proposing that Luis add new lines for "copy" to go along with the > > > > "read" and "write" ones. The "total" counter should give you a count of > > > > the number of operations. > > > Okay that makes more sense! > > > > > > Side note: I am a bit horrified by how computer-unfriendly that > > > table-formatted data is. > > > > Any suggestion to improve this ? > > > > How about just make the "metric" file writable like a switch ? And as > > default it will show the data as above and if tools want the > > computer-friendly format, just write none-zero to it, then show raw data > > just like: > > > > # cat /sys/kernel/debug/ceph/*/metrics > > opened_files:0 > > pinned_i_caps:5 > > opened_inodes:0 > > total_inodes:4 > > > > read_latency:0,0,0,0,0 > > write_latency:5,914013,824797,1092343,103476 > > metadata_latency:79,12856,1572,114572,13262 > > > > read_size:0,0,0,0,0 > > write_size:5,4194304,4194304,4194304,20971520 > > > > d_lease:11,0,29 > > caps:5,68,10702 > > > > > > I'd rather not multiplex the output of this file based on some input. > That would also be rather hard to do -- write() and read() are two > different syscalls, so you'd need to track a bool (or something) across > them somehow. > > Currently, I doubt there are many scripts in the field that scrape this > info and debugfs is specifically excluded from ABI concerns. If we want > to make it more machine-readable (which sounds like a good thing), then > I suggest we just change the output to something like what you have > above and not worry about preserving the "legacy" output. Ok, before submitting any new revision of this patch I should probably clean this up. I can submit a patch to change the format to what Xiubo is proposing. Obviously, that patch will also need to document what all those fields actually mean. Alternatively, the metrics file could be changed into a directory and have 4 different files, one per each section: metrics/ |- files <-- not sure how to name the 1st section |- latency |- size \- caps Each of these files would then have the header but, since it's a single header, parsing it in a script would be pretty easy. The advantage is that this would be self-documented (with filenames and headers). Cheers, -- Lu?s