Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2469694rdb; Wed, 4 Oct 2023 02:02:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQc/bu1LStINg8Xenx5Dz3NofTc4gEFC/qK+F7M2H9E0zFbjzLQ5LoPU0uCRX5R1uPF+fK X-Received: by 2002:a05:6e02:1d9b:b0:34c:b981:52d4 with SMTP id h27-20020a056e021d9b00b0034cb98152d4mr2082587ila.31.1696410151768; Wed, 04 Oct 2023 02:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696410151; cv=none; d=google.com; s=arc-20160816; b=ry3UNWP1Itkw81OjveuuJku1P+JNEq1zgmzMOWVKmQkJY5/CrxOaKCAjtDvKEUOgMx 2ug1VTHesrJYoZ/qstSiHKTOVklJYczYfXDvqz2wUbFHjDvdnDikL5jH9RnePFIYWJEo mwgYG56WmTRHVagpMd9aMvYFe5zWmTupmXjy10C5zeL540uXpUQ+5X6s4sQsDH0hjIlJ 8NogUpUPwWNon0ehWqreh+kLlUWlJ9PLZyYhu8afS2e4sjqHnexzEph4HaOl+OKXfivC peJXLg5hcyOIBfepLdB1EJI2aOQkwaG/uyoLaDa9k+9SWwh3WJc4Bw9idneAhY40xePK e2Cg== 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:dkim-signature; bh=8fknh9pTwUeNKMs0LwnDupSYiQbG9mDB9y4OA1iLV+0=; fh=kbRWIM8ZOVSybhyeGCsE16fd1GzY6dINIO+J3v/yDJc=; b=Tnkh4H0Rpf3mEGrGNkFErkzSjSG27H84zvako0NGX1gEVuuvta0VnTCGWXCrGxm15B ToTPLP/hTHuMc1hUppTguN2FaX4SuEoQ4e3B1HZmFK2BXNUOBaeayIbFCDcXSlya7X4s cj822c2/aRlgpLVaLEvQmgfHgRAIGeaAaXuhbzyTwSdz99WIt/CwfZZ1JunBJKSbA3tZ A2oM9FBulrMLY4aiVll1/Tb5y0tT4AEObs/NpVeQPJHpFIyiJDugRmHlOHmVbkxLjOXf 9RJ03BGossspJmij9VldnHV7YcFr9y5l9vARA9rysWsFBLtHA977mRAvgwsfm7yBwYPs Z0aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tBwWk0kx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f20-20020a63f114000000b0057808b558cesi3251563pgi.124.2023.10.04.02.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:02:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tBwWk0kx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6C51382516E9; Wed, 4 Oct 2023 02:02:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241855AbjJDJCT (ORCPT + 99 others); Wed, 4 Oct 2023 05:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbjJDJCR (ORCPT ); Wed, 4 Oct 2023 05:02:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C2DCA6; Wed, 4 Oct 2023 02:02:14 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1EC6821845; Wed, 4 Oct 2023 09:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1696410133; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8fknh9pTwUeNKMs0LwnDupSYiQbG9mDB9y4OA1iLV+0=; b=tBwWk0kxxXHNsUHhG94DTvVeKkk9ha3EVwnEwDaUmOnwerKy83pzDptPvxHpBTPIx0S+I0 Wy4iTgY0F1eLpdhYgs11fOK9T1+SPm3NsL6Kn2BxxCAD57VHZcgCrPIh2MlfwmnDODpR1m HI/lWm22+g4ED1aR2FZDZnUcf/efX4I= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D940C139F9; Wed, 4 Oct 2023 09:02:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zCY1NBQqHWVPNQAAMHmgww (envelope-from ); Wed, 04 Oct 2023 09:02:12 +0000 Date: Wed, 4 Oct 2023 11:02:11 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Yosry Ahmed Cc: Andrew Morton , Shakeel Butt , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm: memcg: refactor page state unit helpers Message-ID: References: <20230922175741.635002-1-yosryahmed@google.com> <20230922175741.635002-2-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jrmj7bntvvlwev3j" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 02:02:24 -0700 (PDT) --jrmj7bntvvlwev3j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 03, 2023 at 12:47:25PM -0700, Yosry Ahmed wrote: > Those constants are shared with code outside of memcg, namely enum > node_stat_item and enum vm_event_item, and IIUC they are used > differently outside of memcg. Did I miss something? The difference is not big, e.g. mod_lruvec_state(lruvec, WORKINGSET_ACTIVATE_BASE + type, delta); could be __count_memcg_events( container_of(lruvec, struct mem_cgroup_per_node, lruvec)->memcg, WORKINGSET_ACTIVATE_BASE + type, delta ); Yes, it would mean transferring WORKINGSET_* items from enum node_stat_item to enum vm_event_item. IOW, I don't know what is the effective difference between mod_memcg_lruvec_state() and count_memcg_events(). Is it per-memcg vs per-memcg-per-node resolution? (Is _that_ read by workingset mechanism?) Thanks, Michal --jrmj7bntvvlwev3j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQpEWyjXuwGT2dDBqAGvrMr/1gcjgUCZR0qEAAKCRAGvrMr/1gc jslxAQCM0oIUUE2njzgV3hSlbhBKS89fDJ5yV5qkor2tfY81OQEA21DKpM1O90/m 0H9Byin50ep97S6iK3v4kyckR54LzQ0= =TnaG -----END PGP SIGNATURE----- --jrmj7bntvvlwev3j--