ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: idryomov@gmail.com, pdonnell@redhat.com, ceph-devel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] ceph: add IO size metrics support
Date: Wed, 28 Apr 2021 09:24:59 +0800	[thread overview]
Message-ID: <7a23da97-6e2c-3e8b-b5a7-436c913c0f30@redhat.com> (raw)
In-Reply-To: <398f8ebf7ca9f29694ec5be3ddc3f04a7c1ee660.camel@kernel.org>

On 2021/4/28 2:41, Jeff Layton wrote:
> On Thu, 2021-03-25 at 11:28 +0800, xiubli@redhat.com wrote:
...
>> +static inline void __update_size(struct ceph_client_metric *m,
>> +				 metric_type type, unsigned int size)
>> +{
>> +	switch (type) {
>> +	case CEPH_METRIC_READ:
>> +		++m->total_reads;
>> +		m->read_size_sum += size;
>> +		METRIC_UPDATE_MIN_MAX(m->read_size_min,
>> +				      m->read_size_max,
>> +				      size);
>> +		return;
>> +	case CEPH_METRIC_WRITE:
>> +		++m->total_writes;
>> +		m->write_size_sum += size;
>> +		METRIC_UPDATE_MIN_MAX(m->write_size_min,
>> +				      m->write_size_max,
>> +				      size);
>> +		return;
>> +	case CEPH_METRIC_METADATA:
>> +	default:
>> +		return;
>> +	}
>> +}
>> +
> Ditto here re: patch 1. This switch adds nothing and just adds in some
> extra branching. I'd just open code these into their (only) callers.

Sure.




      reply	other threads:[~2021-04-28  1:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  3:28 [PATCH v2 0/2] ceph: add IO size metric support xiubli
2021-03-25  3:28 ` [PATCH v2 1/2] ceph: update the __update_latency helper xiubli
2021-04-27 18:38   ` Jeff Layton
2021-04-28  1:23     ` Xiubo Li
2021-03-25  3:28 ` [PATCH v2 2/2] ceph: add IO size metrics support xiubli
2021-04-27 18:41   ` Jeff Layton
2021-04-28  1:24     ` Xiubo Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a23da97-6e2c-3e8b-b5a7-436c913c0f30@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=pdonnell@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).