From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH v2 0/2] mm: memcg: fix tracking of pending stats updates values Date: Mon, 25 Sep 2023 15:50:26 +0200 Message-ID: References: <20230922175741.635002-1-yosryahmed@google.com> Mime-Version: 1.0 Return-path: 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= Content-Disposition: inline In-Reply-To: <20230922175741.635002-1-yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Yosry Ahmed Cc: Andrew Morton , Shakeel Butt , Johannes Weiner , Roman Gushchin , Muchun Song , Michal =?iso-8859-1?Q?Koutn=FD?= , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org 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-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org/ > > 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 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A056CE7A94 for ; Mon, 25 Sep 2023 13:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbjIYNuh (ORCPT ); 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> Precedence: bulk List-ID: X-Mailing-List: cgroups@vger.kernel.org Message-ID: <20230925135026.co-o1-9BdWQMwZe0l5zEfCXP11zDfKH5pnj0XGrGGeA@z> 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