Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1580143pxj; Fri, 4 Jun 2021 19:35:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUfwFRGDOWtYFdjYTHWm+OAhOWW0zVdSaM1f+yDKkWlsSrNUpPnu1EbzU5a+C4DB298B6t X-Received: by 2002:a17:907:e8d:: with SMTP id ho13mr7212723ejc.387.1622860544180; Fri, 04 Jun 2021 19:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622860544; cv=none; d=google.com; s=arc-20160816; b=PbSIuJ7Jh6gcSN1fhvRNeluEHeGuKKuqhAihOTzvHMQvHzcIUlCtOeURUD0vl1q/5X Bit6wrYKA1t6gj5/jWoB275z2ogULLLHlQ/DKrDzaGuuCoS0EKDeDyQ0WgW+wUbOM8HN btjbO8FRV4nppA42IwS4Sf+e+Be7SJ8rBy012/zIsnUIaiU/NUf0FgEd0cfHnx0Sz3wW BW2eQo5jQVyU1JNBdTJi06BUFICAlLmIkk29po7P2mTSPhrSg8+sTI2CGgqYiMPBHVPz jLEzC+1CalxmkkoTyQf4KNS0heT73AR3Dha4MCbPT9/EfoobOX8qClHnK1th6lip+ogc tCVA== 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=29lRJsQjuBV2gkxHmcl0YVsXyBr/DK6wvVETfCNeSS8=; b=dh8G1WbOu9lzXdhbvPiAvlJbSW9Pz2OAZ+KBaRNfCZ3g0+7QWpX/HBPoI73ACO8evI M9ceMUdSWo7DLqBWHLHSg1+rMhd5g71PR9uSF8L4fEQTav6ZnpEvmRbSMTIksTSYMzmf VCqcCF4n5skKziVmYypKMxSMbCUM5yCJUGbULEgT5OHG8xHIHTwdngV/wQLazHcKzZ0D 4hU1GX+6lJzW2V7QVi1pzmv5oBlu7+ijgqs4mkUus4JlraPIe3Ud+L5gjTjy9ub7oc9g JeoCgYKe8yn9ydp6U6jbWi/GLgzrdzcYakA3Iqsd521uzV0q1yI37VnVsHl2muMZJSVj YC1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aSH8OR3l; 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 mb15si6290419ejb.279.2021.06.04.19.35.21; Fri, 04 Jun 2021 19:35:44 -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=aSH8OR3l; 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 S231499AbhFECgO (ORCPT + 99 others); Fri, 4 Jun 2021 22:36:14 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:42613 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbhFECgN (ORCPT ); Fri, 4 Jun 2021 22:36:13 -0400 Received: by mail-qk1-f177.google.com with SMTP id o27so11307454qkj.9; Fri, 04 Jun 2021 19:34:13 -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=pgNIM1rQQ2qwNMu9cjFvX+NPDOIkAYpAp4UQFPx/Z7DjBr2bWHRITkayt7Xg6Exi09 xNL82G8CcTPu4edCaKPyZ7jrS7a9RgAqH5XXH4JcRrcPT87Tk85FTL5IO+xdD05j0dd4 aoZ8EqcBTIh8YtOEZ0pOr5pyE04CrC96eQSqjM1gXZqUasrBF5MXXPuTFD6XP7IWABoB 2wflTa5QoW5F9s8+NTLJR2F8BdiB/5xEJAI+GYHFW7ZqB7cSlebQJi0leetvdfsff39K XTlaCFF06T5FQmOAhRI+aydyS7kjGINviePW3re0pMlaTyyFY0+zCBIhPeq/RSI4owK6 FzgA== X-Gm-Message-State: AOAM530IxdyWU9CYMD5GsOrDaRhYUDw2XfjOhjupsBEfqZ+iz1BktuYo gmwVGSd0k3G5sYn/V92d+Yo= 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) Sender: Tejun Heo 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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