From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99406C47082 for ; Sat, 5 Jun 2021 05:29:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2BB26613E7 for ; Sat, 5 Jun 2021 05:29:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BB26613E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B33E96B0036; Sat, 5 Jun 2021 01:29:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE47A6B006C; Sat, 5 Jun 2021 01:29:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 949346B006E; Sat, 5 Jun 2021 01:29:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0110.hostedemail.com [216.40.44.110]) by kanga.kvack.org (Postfix) with ESMTP id 5FB096B0036 for ; Sat, 5 Jun 2021 01:29:33 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 00705180AD801 for ; Sat, 5 Jun 2021 05:29:32 +0000 (UTC) X-FDA: 78218542626.20.02449B3 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by imf03.hostedemail.com (Postfix) with ESMTP id 75950C0201FD for ; Sat, 5 Jun 2021 05:29:29 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id t17so8669085qta.11 for ; Fri, 04 Jun 2021 22:29:29 -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=29lRJsQjuBV2gkxHmcl0YVsXyBr/DK6wvVETfCNeSS8=; b=aSH8OR3l/TfW20lHlGMmlBEnNYwKTY0v8ReDqkEYtQHu5zJs4KWJRoMClaKHyHg94b 2KRQPJX8RvzkJsaPljq1XDIm2Q1SXes1rxRAhzxPRJMmLJwIch/xhYeRd2V0Hofxhxn6 HUNSe5Tra7C39A9YWrS3wPH4b+4O2NE/qdQ1b4aE+HlNwIY2FzAwj6pFFiX2LtZBHLA3 0PCeTq/zQXTKAwYhvjf/RTO9AJWfyeivntfDgfjMcihsdvv5Z55jRj+QLHeJjV5mVpj4 P1+QKq6Oi/8KH06mJJNfSYgiqQ08a8ndd+4HVD6xQ/ARs0mB1nqIlRWVeS0gXkAutKck p69Q== 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=29lRJsQjuBV2gkxHmcl0YVsXyBr/DK6wvVETfCNeSS8=; b=Ha9mVNR3MXIc5YiEQkO5ObDYBriOx6E+AVV3mgeyrJegQKJe/ASi1R46kACB3jGs8+ zsSmBnxqJJZk6/OFovBRzd1jbLKrZFTDjm80JjuziRRstrGLfyfiMSB142MUio88Ex3c MkhB/nim9AUaQQAmjz09GhYbQ4iO9BJ24jDvi2oWz+5uEKkEx72s1yL1nHZM6WN+nn7+ IG7O2JuwrJsZUYEGL3x9RvMdzrO+vnyR3EiHkZIAkYFcU7Bg9G5RX+NTLE/Bfgm1KnqS GHNpxoVAKNAbvLDTEe9y1aK6E9F6KPt7v3Tp+G6+yJdP0WJfMsHzwgcYhtmM0tb2D8qY C7wA== X-Gm-Message-State: AOAM532nI118JevfNHGrm2Qfw9OOw1aDzgoiESkBDb0ltdLl8IOkDxfE cefWvTz/b8trG+msJur+uyv6Hp8TcTGMnQ== X-Google-Smtp-Source: ABdhPJwhKwm6a4V61vXZJdslM1kmfF6HFy08XQlmG5ri4zgtEbaCRSZHp+P0I6+EbWNCbzzzfNK4Aw== X-Received: by 2002:a37:cc5:: with SMTP id 188mr7169959qkm.112.1622860393300; Fri, 04 Jun 2021 19:33:13 -0700 (PDT) Received: from localhost ([199.192.137.73]) by smtp.gmail.com with ESMTPSA id a134sm3536688qkg.114.2021.06.04.19.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 19:33:12 -0700 (PDT) Date: Fri, 4 Jun 2021 22:33:11 -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> <20210605015421.5096-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210605015421.5096-1-hdanton@sina.com> Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=aSH8OR3l; spf=pass (imf03.hostedemail.com: domain of htejun@gmail.com designates 209.85.160.173 as permitted sender) smtp.mailfrom=htejun@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 75950C0201FD X-Stat-Signature: ffa78tknsfjp1cneihszyxwqu4pyiy8c X-HE-Tag: 1622870969-920641 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jun 05, 2021 at 09:54:21AM +0800, Hillf Danton wrote: > The cond_resched() in cgroup_rstat_flush_locked() matches its appearence in > your post [1]. So does unbound IMHO. Ah yeah, this either needs CPU_INTENSIVE or UNBOUND, prolly the latter is better. > And the short stuff [2] looks to me like it is incorrect to queue a work > acquiring mutex lock on to the system_wq. IOW the unbound wq is the right > thing for any work that might sleep. This part doesn't make sense. Blocking from per-cpu workqueue is completely fine. What's not fine is consuming a lot of CPU cycles. Thanks. -- tejun