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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91CABC4167B for ; Sat, 2 Dec 2023 02:56:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E47EB8D0081; Fri, 1 Dec 2023 21:56:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF7E28D007C; Fri, 1 Dec 2023 21:56:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBFEB8D0081; Fri, 1 Dec 2023 21:56:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BD5508D007C for ; Fri, 1 Dec 2023 21:56:56 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 90A55A0413 for ; Sat, 2 Dec 2023 02:56:56 +0000 (UTC) X-FDA: 81520366032.12.1D31D21 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 827EE1C000D for ; Sat, 2 Dec 2023 02:56:54 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=W33fqY0N; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of longman@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=longman@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701485814; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rvwjUNJeoy2IcJbz1Tc64DxOTpWO3+WIeQ+/gLfl3dg=; b=MloIc+m/V+KiuFJ93qRYjiLTdRXz8qowhLmDYAqkdWNqNP7ZkXAPW+cMq2Pn6Lm3aK7taX 9NvxwrgUEu0ia9rRO2W6JU52+kbRL85dPLfGYCJqByDglIjdhgrw9/fqJrnbKwyjmXUPts rjjiQsjrUpkbWNYycj/SwkQOSZb2EHk= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=W33fqY0N; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of longman@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=longman@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701485814; a=rsa-sha256; cv=none; b=Zv6VompsAkkw2d/WjtNnhmAopK3rTanr1IEpWXGbEAW+aO2tmGSAmpORh2bh9SYOmGu4K8 j7eBbskq598o4N9hTzgSI0ZJzNwgFkyQBZteUM3C/1mVLXf4JukmaFAEItc/m1NDbj8mli xt/BV65tu3Ig19JFkdZO21lF81Hw2Ik= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701485813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rvwjUNJeoy2IcJbz1Tc64DxOTpWO3+WIeQ+/gLfl3dg=; b=W33fqY0NFeOWmSuSq/BtvMNjstjnyW0CIVOmJX6EcWgs/zbVO6Z3qIQpcYqfp+QRkCngXb 9Sl4SedK3n0nRw3aLH5C8vNOerpqvYN2JoPE34J0/9GJjNfc3/aN9Iyn+SFaZydVdZSdl4 //7/G2QlysTVLQPrRh2FMY5nVhWblrA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-496-cgIriIYhNUmYe3leOGzmkA-1; Fri, 01 Dec 2023 21:56:50 -0500 X-MC-Unique: cgIriIYhNUmYe3leOGzmkA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE235185A781; Sat, 2 Dec 2023 02:56:49 +0000 (UTC) Received: from [10.22.17.155] (unknown [10.22.17.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47B9840C6EB9; Sat, 2 Dec 2023 02:56:48 +0000 (UTC) Message-ID: <436e96d1-29eb-49ec-a463-2ed420757ce8@redhat.com> Date: Fri, 1 Dec 2023 21:56:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [mm-unstable v4 5/5] mm: memcg: restore subtree stats flushing Content-Language: en-US To: Bagas Sanjaya , Yosry Ahmed , Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Ivan Babrou , Tejun Heo , =?UTF-8?Q?Michal_Koutn=C3=BD?= , kernel-team@cloudflare.com, Wei Xu , Greg Thelen , Domenico Cerasuolo , Attreyee M , Linux Memory Management List , Linux CGroups , Linux Kernel Mailing List References: <20231129032154.3710765-1-yosryahmed@google.com> <20231129032154.3710765-6-yosryahmed@google.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 827EE1C000D X-Stat-Signature: rb7qo5ru76e73qnyxzxur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+quNcvjy6O8GhSjh4q7MsSEyFLBsNDW9bcALU5szoWFO8C6klfaCdc028G+hob1PPSt74JzDDr2bXEeJSna1AWlmuYV4igTeCsX7JCti9X7avvtZvrFR43fwOsVkLhYy8M0f0j0Lyf4JEufK8SaPZZMe6vOhHdk97SXOTqvyjutDoRvDHexwLob0nY4S3na9DLLAiuqCJdDaKWYg== 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: List-Subscribe: List-Unsubscribe: On 12/1/23 20:57, Bagas Sanjaya wrote: >> -void mem_cgroup_flush_stats(void) >> +/* >> + * mem_cgroup_flush_stats - flush the stats of a memory cgroup subtree >> + * @memcg: root of the subtree to flush >> + * >> + * Flushing is serialized by the underlying global rstat lock. There is also a >> + * minimum amount of work to be done even if there are no stat updates to flush. >> + * Hence, we only flush the stats if the updates delta exceeds a threshold. This >> + * avoids unnecessary work and contention on the underlying lock. >> + */ > What is global rstat lock? It is the cgroup_rstat_lock in kernel/cgroup/rstat.c. Cheers, Longman