Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5792749rwl; Tue, 11 Apr 2023 10:01:48 -0700 (PDT) X-Google-Smtp-Source: AKy350Z8CaZq9v3PtolY3r0jXhetkpgsGMwyG8j/dN2ohiYR9xFUSIJYp+6MVwUQBj2s3eweXOAP X-Received: by 2002:a17:90b:3ec3:b0:234:409:9752 with SMTP id rm3-20020a17090b3ec300b0023404099752mr14231333pjb.25.1681232507767; Tue, 11 Apr 2023 10:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681232507; cv=none; d=google.com; s=arc-20160816; b=l15jKDRBOKeUmCFZltzD7PtROxUqUtmJg6HT7whJgSgPn+NtZcxxQlJOYG7AfXwhOa Rp+Up9KryGJ/eFlr3xpPDChqSfUh8QWTz/ZAufN+aXIr1l3/OJC3yRkZGba/sOdY00w5 /p5Vniw9+26FzchIGzVyvuVQt0w6ki84w0u1URGKQPRenPKhV6EuZdhs/y/8kCrUXrvQ FLNVsL/zOeS2aTrmVx/l78Hm9McKdShalMgsQPqDJzA50Vq+qLK23b2fIjHxtld3ocU+ kS6WCH3vTF6Zqs2IodjmqPrO3oYGdumAuh49Fk/juz03VmEm44TOEKBuDvh+fZryS2lg HY8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=l3nf45VfTna2qtmHbcyQx3azMJIZK67P9z9b6hMPmWY=; b=mzMleYs8lEr3oTN81aQMlzzlx0ryZGv2+SGXNGA1FvQtBPFLbUgze3RTRi4iniFBE/ 7Hdn/6dAhFRGj0BIHmC7Mmal/EDN5R9aUEESD8TiFO+HLe7h8UD32hV4qPx9BEnRqpMV NGU+LQGeCv/j1dNEDoQhoBMxqHzUJClWay3RoV1EtrLlJKwv6O8cS3ZhlMrb2Jn1bge1 mocC9yL3AoYVl/l/CaZE5v8umXhsZ/jw1Zn9HB01cnDOUyzWJO8JHUbA7Be7I91mU+pf CWVrRJlb2V8uRU4LHKe/rRnPmkyPrOjWVGKAVes4fU8xiqwORlsoV5ZrA9WeOcn2oCF1 M2pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ygamK3A3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020a1709027c9700b001a1b5e2deb0si13963043pll.334.2023.04.11.10.01.34; Tue, 11 Apr 2023 10:01:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ygamK3A3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbjDKRAs (ORCPT + 99 others); Tue, 11 Apr 2023 13:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbjDKRAn (ORCPT ); Tue, 11 Apr 2023 13:00:43 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19D621BC0 for ; Tue, 11 Apr 2023 10:00:18 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id qa44so21786741ejc.4 for ; Tue, 11 Apr 2023 10:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681232412; x=1683824412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=l3nf45VfTna2qtmHbcyQx3azMJIZK67P9z9b6hMPmWY=; b=ygamK3A3NM1JD2kKgXRiue98TQPKvYM28SIh/wf7BXymkX7onuXLJL3zdwCTUe/eVe SIrwlFECWwZJJri9YnaDb7qj+p3Fx8mztu1CVpQMc/XKpJLJlWPcEMyzHAaCZxvxJUip 7FrcmhZzUhSkqU/9ce+HuOqM+20Y6naugqTmb3UDLmOMbosxkWeNqwmpF/mr+icSJFEA DkfsjBlrrbGUYgnxglGGrWrB3iI0El6Hk8tD6oRP64tYwrP2NsbfZPf5khW44kuDdufB HB1CpOLX1xMCVefNbt6lQkTWz8mUP82sqHSntwR7puMl5Pt+e551R9IduCfw125lUGRr smYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681232412; x=1683824412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l3nf45VfTna2qtmHbcyQx3azMJIZK67P9z9b6hMPmWY=; b=q8PJytXMYX4DSqmr/Jqav4peTwxIj1q5kGe0LxVpNTgzjNBO/qwa24mv4odz91MvHc SjZ9nP/cS3MfC9HBpoGPKbBthay2iqGHzpIq6CYl/a+GLz+PizybnjPmBUsgFZeVnA5X w6QPItWcWEv6wYxTF0bowobzI+jqA1oDr3y/W8Vz0VR8jc57MKFXVAhOlZKiVLYvIAFd 97xVokPCB/oLtNewv4rSk74HZAe68ra1l1gs6HVSboXg7VXwz/+Lxnc32t2q1lY0GX/i kx4tDsWoAqzc/jPuFTtCr1iVyz9XH4Nb0xCyopeu7NrJHkO6xOEybHhv9mepghXawBH/ NHFA== X-Gm-Message-State: AAQBX9f2lq1vPD4i/WZRoB9EoG76lkEZXFsKlyDbBIe9aoXUr7uMfeWB Gww9InYhp66SgYbOJ02lhN0G2NtlIpmPDoLqxkCHzw== X-Received: by 2002:a17:906:2556:b0:94b:d619:e773 with SMTP id j22-20020a170906255600b0094bd619e773mr1626314ejb.15.1681232411678; Tue, 11 Apr 2023 10:00:11 -0700 (PDT) MIME-Version: 1.0 References: <20230403220337.443510-1-yosryahmed@google.com> <20230403220337.443510-4-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Tue, 11 Apr 2023 09:59:35 -0700 Message-ID: Subject: Re: [PATCH mm-unstable RFC 3/5] memcg: calculate root usage from global state To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Alexander Viro , Christian Brauner , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 11, 2023 at 5:53=E2=80=AFAM Michal Koutn=C3=BD wrote: > > On Mon, Apr 03, 2023 at 10:03:35PM +0000, Yosry Ahmed wrote: > > Instead, approximate the root usage from global state. This is not 100% > > accurate, but the root usage has always been ill-defined anyway. > > Technically, this approximation should be closer to truth because global > counters aren't subject to flushing "delay". It is a tiny bit different when some pages are in swap, probably because of swap slot caching and other swap specifics. At least in cgroup v1, the swap uncharging and freeing of the underlying swap entry may happen at different times. I think it practically doesn't really matter though. > > > > > Signed-off-by: Yosry Ahmed > > --- > > mm/memcontrol.c | 24 +++++------------------- > > 1 file changed, 5 insertions(+), 19 deletions(-) > > But feel free to add > Reviewed-by: Michal Koutn=C3=BD Thanks! >