public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: brookxu <brookxu.cn@gmail.com>
Cc: hannes@cmpxchg.org, vdavydov.dev@gmail.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org
Subject: Re: [PATCH 1/2] mem_cgroup: optimize the atomic count of wb_completion
Date: Fri, 24 Sep 2021 16:01:51 +0200	[thread overview]
Message-ID: <YU3aT7i2vBNxewam@dhcp22.suse.cz> (raw)
In-Reply-To: <03145735-7764-4cd4-e15b-60402f4b447e@gmail.com>

On Fri 24-09-21 21:02:52, brookxu wrote:
> Thanks for your time.
> 
> Michal Hocko wrote on 2021/9/24 17:34:
> > On Fri 24-09-21 14:46:22, brookxu wrote:
> >> From: Chunguang Xu <brookxu@tencent.com>
> >>
> >> In order to track inflight foreign writeback, we init
> >> wb_completion.cnt to 1. For normal writeback, this cause
> >> wb_wait_for_completion() to perform meaningless atomic
> >> operations. Since foreign writebacks rarely occur in most
> >> scenarios, we can init wb_completion.cnt to 0 and set
> >> frn.done.cnt to 1. In this way we can avoid unnecessary
> >> atomic operations.
> > 
> > Does this lead to any measurable differences?
> 
> I created multiple cgroups that performed IO on multiple disks, 
> then flushed the cache with sync command, and no measurable
> differences have been observed so far.

OK, so why do we want to optimize this code?
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2021-09-24 14:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24  6:46 [PATCH 1/2] mem_cgroup: optimize the atomic count of wb_completion brookxu
2021-09-24  6:46 ` [PATCH 2/2] mem_cgroup: introduce foreign_writeback_in_process() function brookxu
2021-09-24  9:34 ` [PATCH 1/2] mem_cgroup: optimize the atomic count of wb_completion Michal Hocko
2021-09-24 13:02   ` brookxu
2021-09-24 14:01     ` Michal Hocko [this message]
2021-09-24 15:21       ` brookxu.cn

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=YU3aT7i2vBNxewam@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=brookxu.cn@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vdavydov.dev@gmail.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