Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1082371pxj; Fri, 4 Jun 2021 05:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyadgkTD08Yw0JS/kOB17n0BSY/JAnCmuMLFsNodlP2ySOM9HJgRzfT5MNC/SmSuRw4+quW X-Received: by 2002:a17:906:7fc5:: with SMTP id r5mr4115746ejs.474.1622810844427; Fri, 04 Jun 2021 05:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622810844; cv=none; d=google.com; s=arc-20160816; b=tOu+ri+hnfapMM/zpX1qlr9EiXWU+/8LJLD1Hojwl3ha+kSPzFKDbJfrdHe2L4FDcz Sn3PA/MMGRoC7ai4MdmZf8PS7J2/KpkAAJV2cdSt9PBIP1was3bAiR2UgqsneR/hBM09 mdtwnedb3NuUGjZtRHYCehIDlRS1ATYys2JR5+lsGim/ZRpWVMmqQaNh1X/A1kzkmyVS Lat3SEdBfCo8tko9unLJTAvDahYTWWCaQfllpCS3wuNfIowz5dsUoiBxVqV3D0ggeXq8 wzigMyY7OBloXemvdy4ZLuazSpoahTyG8epHDA6txh1X/ymMzQGRJMZRkgCcXA3dtJFx vVbg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Nx4sy3vKThPKrptN4SMiBtntPC6yuGT09cDORxlv+yc=; b=BoYWGpAKdrj9dUrRubseuBxxN2nMBq1yt69yfNB5xqX7iDu1pWOBWkvl/xS99nOTBx 4b3rGTu1tOZyzJF7y6QVLPrameem6YaY+eRIcS2o/uawdLeN77PRfANji7B/mv1xT6Hv pN6hM7Ur+pSKZI4toEDjGceaxtM5f+wfgsdxni4p78sF1dul9uPTSjnQLHHD7IegiYql 5CeuoOY/6cE5gnErQu1i08v710RV669LVXen/24ThmKFnjKda8N4ek6HwW/Z895U5FqV CFVFSHNfAFK/iZ4wkMAG3IbooLB1RlxJ7TkwAr5UK6R/0yPA2uPONiZvBB/BMtZQvgJf EGeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="QOs7/5Iz"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb9si5352379ejb.411.2021.06.04.05.46.53; Fri, 04 Jun 2021 05:47:24 -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=@gmail.com header.s=20161025 header.b="QOs7/5Iz"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbhFDMr0 (ORCPT + 99 others); Fri, 4 Jun 2021 08:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbhFDMr0 (ORCPT ); Fri, 4 Jun 2021 08:47:26 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE4CC06174A; Fri, 4 Jun 2021 05:45:23 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id t9so354562qtw.7; Fri, 04 Jun 2021 05:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Nx4sy3vKThPKrptN4SMiBtntPC6yuGT09cDORxlv+yc=; b=QOs7/5IzXSeBRJVY8zaGVanRYpvfw+wNNeX6TADPr1JFXUcUSD5iD0dAZI2adwPip3 +qO2zMkh9wMFvUo+egv7LH5RPSTZ11HVCcMh0cMsVN/yDUqdfp7rMRpWmvksZVmvRAB+ 8bW8EJ461T0mcIzy/gDkyRL1xDGsmPa93cHTr4qBaNv5yIXecqsbYZKSdiIkl5j3ssM4 E4o76gBHi1BEKYJjwM+XASMdkUZVHKSO7ZKuV6d6SLljBD+wwUYyTb2xLmMqbmMiRtRW z52UFs0wlzbp+zBcmKQ8/+C8x0akJCFCU4MV2OuVKTpKhvI3ODu9mL15KUZNKGTqdKua yjOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=Nx4sy3vKThPKrptN4SMiBtntPC6yuGT09cDORxlv+yc=; b=ZntctbSDkZ3VO0qGbtbGHT3yetk6Yr0R9iFX2UEbPyX4HzSzOUllVSDVo23OIwL3O0 bBO1Rn6UYBU7RAUWV18/BkM1RX2RZxnkYfMjyriJQdmuXjcW2BOdYfnJ9BDcamufNAF5 8I9mByZNehLfjtaWdRdGH3bwRzmcMnZAEfy/EyCzWJIJCFNl0nzpmXaMrb1kA+XhK152 gw+WjN7UlhWVLhWk7f4O5kInf9NrBVlghgPSPAMd3VmUAuoqY3Rhv9BjDu2oiOpenvuH rV9yqAUqJfyHoHYFmRNA3mO/hH+XGUOLGyT9eSzopeJLu+b3+G0Xc1j6sqlTellyxjwH 7D6g== X-Gm-Message-State: AOAM5336Jk5iCiUx5By558tuef8OKJRFdI3vb/TjNp/d9MtWZW+kGq4F 9NDBoNn9Qi6Q3eZDKYpD+To= X-Received: by 2002:ac8:5f8f:: with SMTP id j15mr4465156qta.116.1622810720672; Fri, 04 Jun 2021 05:45:20 -0700 (PDT) Received: from localhost ([199.192.137.73]) by smtp.gmail.com with ESMTPSA id f11sm3375209qtf.30.2021.06.04.05.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 05:45:20 -0700 (PDT) Sender: Tejun Heo Date: Fri, 4 Jun 2021 08:45:19 -0400 From: Tejun Heo To: Hillf Danton Cc: Shakeel Butt , Johannes Weiner , Muchun Song , Michal Hocko , Roman Gushchin , Michal =?iso-8859-1?Q?Koutn=FD?= , Huang Ying , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] memcg: periodically flush the memcg stats Message-ID: References: <20210604015640.2586269-1-shakeelb@google.com> <20210604061816.3110-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604061816.3110-1-hdanton@sina.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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