Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1642942pxb; Thu, 28 Oct 2021 07:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1AcnNTSiHRTLl39H8XtgGD2lA9cMBIoYr1ZBNfJYSruHd8uxFi7G3sjnpYwG9Y3UzS7ga X-Received: by 2002:a17:90b:4d8e:: with SMTP id oj14mr4943366pjb.160.1635431398006; Thu, 28 Oct 2021 07:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635431397; cv=none; d=google.com; s=arc-20160816; b=AxoGxFsL3j/IgntPHGKLhFqTBbERaKeknRAFp20OFW6HRwG9qsyV5rGzhYkWoLk7sz sZAb9PRo0wRQ0jXvt11frE3qEzUJNviugBly9VjKMD3I7JhbsS5kgwfnncb+k7XKWIxJ 1tEVrCetyYRFvOYSlej9mVam97UMCQCpEvhNgQ6FVkvYtUHru7m/Rr+N0tCoOsDyyR/O wPqudbVAVG5+K/JGWwDoMPR3vrXXWg7c9xCqWmqiFGbGpintw/HEaE7HRkOrK7LdXMa5 8OKvC9UhtpKMFstIPpSvjxCSfUp2hay2G8VWHObrgOiVaK0phlGj0XIOBFUVZFcETRSF IzKQ== 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=z8HFzhLPeMNEIpymtY0aL1CjyagQsMTGZ46Z+UL1840=; b=yIh2yO5hxzte7q82Z9dmZSpQQ09zKLzubEs82FqS0cddUuQkuv3sDuV7MQ+W+//4kJ PogKiJH4jrHnM5nhkVaqWGS2i43yH34iW4HVHuGL6POctGGxUWsvAn2gcJzwNUlmmhoa 5EhkljiGh4WjH5AYPx3TD8rYS1PtpMrb7RaS+pkAVNBlPA3IRxMuBOo5Klm2Xd6RzV5Y hm2PKuEhXeARaYnmGLjDSh22G1QxIQx2VgPpwiUSZIM6GYz3MuqFiGPczVA02D099wHW zSizokZdJ97P3CejBh7vsFgBDYSBysMlxhMgFi9mSrDcHqqNxtGcmbtmnbyuznRkQsoN CL5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="k2D/G9+A"; dkim=neutral (no key) header.i=@suse.de; 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 j28si4571147pgl.0.2021.10.28.07.29.44; Thu, 28 Oct 2021 07:29: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="k2D/G9+A"; dkim=neutral (no key) header.i=@suse.de; 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 S231166AbhJ1O2B (ORCPT + 99 others); Thu, 28 Oct 2021 10:28:01 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:57062 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230401AbhJ1O2B (ORCPT ); Thu, 28 Oct 2021 10:28:01 -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-out2.suse.de (Postfix) with ESMTPS id 5DA021FD53; Thu, 28 Oct 2021 14:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635431133; 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=z8HFzhLPeMNEIpymtY0aL1CjyagQsMTGZ46Z+UL1840=; b=k2D/G9+AULYYNXqvPfX4mVCOkk8d0zBoamjfB/CPWzUlYA/JhdQztIClekKMThoxv5Uqzh 854ccBKhpjKEQfy2ZRnYIRXjVo+mL502jTBMoOY6/VqDnsD7xo2o/WrWPkJzmS7LJA3UHz 51dBqFXAfEmNupZDQ1TXusD99bARikk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635431133; 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=z8HFzhLPeMNEIpymtY0aL1CjyagQsMTGZ46Z+UL1840=; b=ZhIhuVX2aPEFKw5sI9v9nRX42997oUUzEidx4H6yPFLPwe1jWxnK2KgozOqRgxCJpI32EN xMec8D6KPh/eFjDA== 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 F0AC113E9D; Thu, 28 Oct 2021 14:25:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 75yNN9yyemGbGwAAMHmgww (envelope-from ); Thu, 28 Oct 2021 14:25:32 +0000 Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id b993446c; Thu, 28 Oct 2021 14:25:32 +0000 (UTC) Date: Thu, 28 Oct 2021 15:25:26 +0100 From: =?iso-8859-1?Q?Lu=EDs?= Henriques To: Jeff Layton Cc: Ilya Dryomov , Xiubo Li , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Patrick Donnelly Subject: Re: [RFC PATCH v3] ceph: ceph: add remote object copies to fs client metrics Message-ID: References: <20211028114826.27192-1-lhenriques@suse.de> <06ef4f08edebf8b0a1a8660adfc46597d0d028b7.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: <06ef4f08edebf8b0a1a8660adfc46597d0d028b7.camel@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 28, 2021 at 08:41:52AM -0400, Jeff Layton wrote: > On Thu, 2021-10-28 at 12:48 +0100, Lu?s Henriques wrote: > > 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 > > --- > > This patch is still an RFC because it is... ugly.? Although it now > > provides nice values (latency and size) using the metrics infrastructure, > > it actually needs to extend the ceph_osdc_copy_from() function to add 2 > > extra args!? That's because we need to get the timestamps stored in > > ceph_osd_request, which is handled within that function. > > > > The alternative is to ignore those timestamps and collect new ones in > > ceph_do_objects_copy(): > > > > start_req = ktime_get(); > > ceph_osdc_copy_from(...); > > end_req = ktime_get(); > > > > These would be more coarse-grained, of course.? Any other suggestions? > > > > Not really. It is definitely ugly, I'll grant you that though... > > The cleaner method might be to just inline ceph_osdc_copy_from in > ceph_do_objects_copy so that you deal with the req in there. Yeah, but the reason for having these 2 functions was to keep net/ceph/ code free from cephfs-specific code. Inlining ceph_osdc_copy_from would need to bring some extra FS knowledge into libceph.ko. Right now the funcion in osd_client receives only the required args for doing a copyfrom operation. (But TBH it's possible that libceph already contains several bits that are cephfs or rbd specific.) However, I just realized that I do have some code here that changes ceph_osdc_copy_from() to return the OSD req struct. The caller would then be responsible for doing the ceph_osdc_wait_request(). This code was from my copy_file_range parallelization patch (which I should revisit one of these days), but could be reused here. Do you think it would be acceptable? <...> > > + spinlock_t copyfrom_metric_lock; > > + u64 total_copyfrom; > > + u64 copyfrom_size_sum; > > + u64 copyfrom_size_min; > > + u64 copyfrom_size_max; > > + ktime_t copyfrom_latency_sum; > > + ktime_t copyfrom_latency_sq_sum; > > + ktime_t copyfrom_latency_min; > > + ktime_t copyfrom_latency_max; > > + > > Not a comment about your patch, specifically, but we have a lot of > copy/pasted code to deal with different parts of ceph_client_metric. > > It might be nice to eventually turn each of the read/write/copy metric > blocks in this struct into an array, and collapse a lot of the other > helper functions together. > > If you feel like doing that cleanup, I'd be happy to review. Otherwise, > I'll plan to look at it in the near future. Yeah, sure. I can have a look at that too. Cheers, -- Lu?s