Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1234412rdh; Mon, 25 Sep 2023 07:04:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIvG8Wo9O6l9L3znojTzYn8s+jMSMy5WRPL4OduX8p8x1B/Z73csJuyZjKbqsJX/rP8nLJ X-Received: by 2002:a05:6a20:3258:b0:14e:43b0:5f99 with SMTP id hm24-20020a056a20325800b0014e43b05f99mr4283464pzc.52.1695650691155; Mon, 25 Sep 2023 07:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695650691; cv=none; d=google.com; s=arc-20160816; b=0ifFS/EDgc+pbCutiW9PAWzC5I8/4lI7+/qVhbdH6Tsnr1avfEbKD/LdRzeWcmosos noxhMc5Elz/giN1gVUxYQ/YFVBw0QQUb7W/UOucphyNB8gMXu0dzmlzPS4PGxQii2zkz GweVCjfJgGFw7eCGttKVtxle/1K8jKIDyticJ/WPKSDrpF9VQw+n9vazHLQQHhLZ0q1f nemqDPibGpVQOH8J1U8qN0aSTYRYh+SBPMqq6SQ25SBNwhkRsf4Y/O5dTxg/LM5JEnt/ p5Aqf4iC+NMEgohp13pHG/YIGpcFlYgts7AfQwGu3k1mrZF9+z/n9Ep0klsOd3KHYUJv Mj0g== 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=jcHoHaiIokbvVhLAntZeHFBs/mSZ9sLRljn4JH46n+8=; fh=ab/I2PCEna5sDgvkoEtl0bZy8pjIneQyEazJiNuJ00g=; b=DbPNRjOMVTDDDxHJ9d12dDCSkcUBq7rg9KrRAUoNPYaQMcbl+kV5GDrqiMWO5aKhaM 4xv2aifa7O4ukeWMlykH69sPcftp9gG96AHUmVIxp3Wx4PbkINp7uLC6YoAIScZgJipG oU/xBOL6w0JJQ6JsPy1HjKS2F2kuWaLPiGni1omQ8UcuGIeAeAPjjgThDjdupGJK38FC 7SSrn8Mj+qXKzzzmFcLi7erH1flIifBLljPX8aWxyxlRNIe5z+2bgarhZoGJla7Jxyi0 snvmJsv4J74mymdNyu4oeH5EtOZBrJYTSxsJPFhikclZxra1TatlKpgIrFxugERatau7 Bc8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Y+Ze5tZa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ck12-20020a056a00328c00b00690ff5e479fsi9919817pfb.332.2023.09.25.07.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:04:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Y+Ze5tZa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 4BD3A807F4EB; Mon, 25 Sep 2023 06:50:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231956AbjIYNuh (ORCPT + 99 others); Mon, 25 Sep 2023 09:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbjIYNug (ORCPT ); Mon, 25 Sep 2023 09:50:36 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E9BEB3; Mon, 25 Sep 2023 06:50:30 -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 2880021857; Mon, 25 Sep 2023 13:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1695649829; 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=jcHoHaiIokbvVhLAntZeHFBs/mSZ9sLRljn4JH46n+8=; b=Y+Ze5tZaa/vhJYJpUpwQ0pZmKaOFR5s0ikzu9g5De+vsjp3KrPoNIbfEpJEqnpebKz7H2H cXibuPUBw6pEV4FasYGv0okod+puihW3ODDK0rw/6LlqrOe6N0+uNiT2vmYKLuq3S8sK/b e+u3WHYLF6e4U7Ku6SU3U1Iwmz9SDMY= 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 0246A1358F; Mon, 25 Sep 2023 13:50:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id F8kFOSSQEWXiHQAAMHmgww (envelope-from ); Mon, 25 Sep 2023 13:50:28 +0000 Date: Mon, 25 Sep 2023 15:50:26 +0200 From: Michal Hocko To: Yosry Ahmed Cc: Andrew Morton , Shakeel Butt , Johannes Weiner , Roman Gushchin , Muchun Song , Michal =?iso-8859-1?Q?Koutn=FD?= , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] mm: memcg: fix tracking of pending stats updates values Message-ID: References: <20230922175741.635002-1-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922175741.635002-1-yosryahmed@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 06:50:37 -0700 (PDT) On Fri 22-09-23 17:57:38, Yosry Ahmed wrote: > While working on adjacent code [1], I realized that the values passed > into memcg_rstat_updated() to keep track of the magnitude of pending > updates is consistent. It is mostly in pages, but sometimes it can be in > bytes or KBs. Fix that. What kind of practical difference does this change make? Is it worth additional code? > Patch 1 reworks memcg_page_state_unit() so that we can reuse it in patch > 2 to check and normalize the units of state updates. > > [1]https://lore.kernel.org/lkml/20230921081057.3440885-1-yosryahmed@google.com/ > > v1 -> v2: > - Rebased on top of mm-unstable. > > Yosry Ahmed (2): > mm: memcg: refactor page state unit helpers > mm: memcg: normalize the value passed into memcg_rstat_updated() > > mm/memcontrol.c | 64 +++++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 51 insertions(+), 13 deletions(-) > > -- > 2.42.0.515.g380fc7ccd1-goog -- Michal Hocko SUSE Labs