All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Hillf Danton <hdanton@sina.com>
Cc: "Shakeel Butt" <shakeelb@google.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Muchun Song" <songmuchun@bytedance.com>,
	"Michal Hocko" <mhocko@kernel.org>,
	"Roman Gushchin" <guro@fb.com>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Huang Ying" <ying.huang@intel.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] memcg: periodically flush the memcg stats
Date: Fri, 4 Jun 2021 08:45:19 -0400	[thread overview]
Message-ID: <YLogX+4YSMacgbGH@slm.duckdns.org> (raw)
In-Reply-To: <20210604061816.3110-1-hdanton@sina.com>

On Fri, Jun 04, 2021 at 02:18:16PM +0800, Hillf Danton wrote:
> On Thu,  3 Jun 2021 18:56:40 -0700 Shakeel Butt wrote:
> >  
> > +static void flush_memcg_stats(struct work_struct *w)
> > +{
> > +	cgroup_rstat_flush(root_mem_cgroup->css.cgroup);
> > +	schedule_delayed_work(&stats_flush, round_jiffies(2UL*HZ));
> > +}
> 
> Given flush may block, the unbound wq is what you need.
>
> 	queue_delayed_work(system_unbound_wq, &stats_flush, 2 * HZ);

Default per-cpu workqueue can block just fine. I don't see a strong reason
why this would need to be unbound.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Hillf Danton <hdanton-k+cT0dCbe1g@public.gmane.org>
Cc: "Shakeel Butt" <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	"Johannes Weiner"
	<hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	"Muchun Song"
	<songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
	"Michal Hocko" <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Roman Gushchin" <guro-b10kYP2dOMg@public.gmane.org>,
	"Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>,
	"Huang Ying" <ying.huang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Andrew Morton"
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] memcg: periodically flush the memcg stats
Date: Fri, 4 Jun 2021 08:45:19 -0400	[thread overview]
Message-ID: <YLogX+4YSMacgbGH@slm.duckdns.org> (raw)
In-Reply-To: <20210604061816.3110-1-hdanton-k+cT0dCbe1g@public.gmane.org>

On Fri, Jun 04, 2021 at 02:18:16PM +0800, Hillf Danton wrote:
> On Thu,  3 Jun 2021 18:56:40 -0700 Shakeel Butt wrote:
> >  
> > +static void flush_memcg_stats(struct work_struct *w)
> > +{
> > +	cgroup_rstat_flush(root_mem_cgroup->css.cgroup);
> > +	schedule_delayed_work(&stats_flush, round_jiffies(2UL*HZ));
> > +}
> 
> Given flush may block, the unbound wq is what you need.
>
> 	queue_delayed_work(system_unbound_wq, &stats_flush, 2 * HZ);

Default per-cpu workqueue can block just fine. I don't see a strong reason
why this would need to be unbound.

-- 
tejun

  reply	other threads:[~2021-06-04 12:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04  1:56 [PATCH 1/2] memcg: switch lruvec stats to rstat Shakeel Butt
2021-06-04  1:56 ` Shakeel Butt
2021-06-04  1:56 ` [PATCH 2/2] memcg: periodically flush the memcg stats Shakeel Butt
2021-06-04  1:56   ` Shakeel Butt
2021-06-04  1:56   ` Shakeel Butt
2021-06-04  6:18   ` Hillf Danton
2021-06-04 12:45     ` Tejun Heo [this message]
2021-06-04 12:45       ` Tejun Heo
     [not found]     ` <20210605015421.5096-1-hdanton@sina.com>
2021-06-05  2:33       ` Tejun Heo
2021-06-05  2:33         ` Tejun Heo
2021-06-05  4:45         ` Shakeel Butt
2021-06-05  4:45           ` Shakeel Butt
2021-06-05  7:43         ` Hillf Danton

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=YLogX+4YSMacgbGH@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=shakeelb@google.com \
    --cc=songmuchun@bytedance.com \
    --cc=ying.huang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.