Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1088730imk; Sun, 3 Jul 2022 17:03:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sAfmII2wThY5H+ZXrJbm/BtyFhLmmwgqDraNSdcLeVdn0i6yw8LStTpdKszHjtWN1bx/KS X-Received: by 2002:a65:49cd:0:b0:40d:7553:e3be with SMTP id t13-20020a6549cd000000b0040d7553e3bemr23205930pgs.370.1656893020466; Sun, 03 Jul 2022 17:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656893020; cv=none; d=google.com; s=arc-20160816; b=I/z/ZLYQXcT5i9S9w/dmqqMRnYtNp4dQNbZFzcdbLEhkIFnFRHJITn2qlKQY4NoEQi iV1X0u2egyP0RBeOki7lDdj3jkExfQUeSbokRmtOj9a6jo2uzOCMJ47FlVAz5IC8tHlK T3l/tJWzgcWEYsCr1KHdfe82pArQP3DYBFiTxdes1bXL2XGxiHuMVFDBIIXpYzMjrH/w RKKZhStulSmlJuhJNNBndEoTcTg5Yknc9PJBSXssjt9vbbw2T/63sLK2MCS3ikcIXIWu xcWoTRq7Q9avtJjb32AQC1yDw6OtxB/U97A8ti/vWS7s2z9j80gaX3h41cLPRxC9+y5k wwZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Bjh3qxdWz/DU2AH4UbtkxVXiLoecYS59U4Wu4MmYc0A=; b=xUGNgHDqN4OQETAGvA9PVmQT9hnzTF3WZSgJltFJpIjEzkBf60PxWQ+NVE+3ABOXI1 48C+FzH17qxpADJBJCfNaSbNZ9pQ52VlyBQlNK+kWwqaE7rxFmJ6Fotq2nFbYnCF2svI Zj/PT6PlPSEb4y7ZPUfnqUAZuSbCMCAsgRV5W/kG7JThdFWm7cqse2vibVDPNU3boyPO WLX7UwHC1Pk/WXfTrXdB4YBezVlU0SIOjXA4k+ctPkMI4NgE1IgPx6BmRU9lmcpWsTak PNCv2Q9VLurDfF6B2BTm8ffilZGAt5gdMZf1S7O4SlkGwJoO5HOoKToEhY7xErMzxCaJ U9EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=UGoty1ux; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a17090301cc00b00163a84f75b2si19467790plh.519.2022.07.03.17.03.28; Sun, 03 Jul 2022 17:03:40 -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=@linux-foundation.org header.s=korg header.b=UGoty1ux; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiGCXXq (ORCPT + 99 others); Sun, 3 Jul 2022 19:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiGCXXp (ORCPT ); Sun, 3 Jul 2022 19:23:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 236B15FE7; Sun, 3 Jul 2022 16:23:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D6A8FB80BEB; Sun, 3 Jul 2022 23:23:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F7FFC341C6; Sun, 3 Jul 2022 23:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1656890621; bh=EDIwVumbRS+j2biW/LWEapjenLtWMcKX8aj62iSrHFs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UGoty1uxOxulUsQC/avpz8A7yZpRuf7BdzfbceCmcdN+XaD+urZDeSlb6tyAxPZfO K+dIpKI3tvnIYwdfDirzlucGlozflAtVanLk5BUjPWntuAOYGjHdgLNk2BtL9kDtrk IJ+i8dgF7XEGChVK7VyVarTJ4q9rqmJJCYvnN130= Date: Sun, 3 Jul 2022 16:23:40 -0700 From: Andrew Morton To: Muchun Song Cc: hannes@cmpxchg.org, longman@redhat.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, cgroups@vger.kernel.org, duanxiongchun@bytedance.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yosry Ahmed Subject: Re: [PATCH v6 00/11] Use obj_cgroup APIs to charge the LRU pages Message-Id: <20220703162340.cb90924355dacbb7437ab595@linux-foundation.org> In-Reply-To: <20220621125658.64935-1-songmuchun@bytedance.com> References: <20220621125658.64935-1-songmuchun@bytedance.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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, 21 Jun 2022 20:56:47 +0800 Muchun Song wrote: > This version is rebased on mm-unstable. Hopefully, Andrew can get this series > into mm-unstable which will help to determine whether there is a problem or > degradation. I am also doing some benchmark tests in parallel. > > Since the following patchsets applied. All the kernel memory are charged > with the new APIs of obj_cgroup. > > commit f2fe7b09a52b ("mm: memcg/slab: charge individual slab objects instead of pages") > commit b4e0b68fbd9d ("mm: memcontrol: use obj_cgroup APIs to charge kmem pages") > > But user memory allocations (LRU pages) pinning memcgs for a long time - > it exists at a larger scale and is causing recurring problems in the real > world: page cache doesn't get reclaimed for a long time, or is used by the > second, third, fourth, ... instance of the same job that was restarted into > a new cgroup every time. Unreclaimable dying cgroups pile up, waste memory, > and make page reclaim very inefficient. > > We can convert LRU pages and most other raw memcg pins to the objcg direction > to fix this problem, and then the LRU pages will not pin the memcgs. > > This patchset aims to make the LRU pages to drop the reference to memory > cgroup by using the APIs of obj_cgroup. Finally, we can see that the number > of the dying cgroups will not increase if we run the following test script. > > ... > I don't have reviewer or acker tags on a couple of these, but there is still time - I plan to push this series into mm-stable around July 8.