Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3456344iog; Mon, 20 Jun 2022 21:35:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sb3UJR2DHhGeHApQRAl4H6Owux29KotWpZfoL48742Z9+QPeSoffKG86u0y69GNeRbW+nN X-Received: by 2002:a63:55:0:b0:40c:a2e4:c328 with SMTP id 82-20020a630055000000b0040ca2e4c328mr9683443pga.499.1655786121178; Mon, 20 Jun 2022 21:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655786121; cv=none; d=google.com; s=arc-20160816; b=UQadEj8zX6Q+xSE2bBscDB5Tt+k9ibyNHo5kxYa0d9q2xpnufnq4pMeHd2jJFxn3aq WlAmkhC9nj6VrRFli5iYcFPDVgybElvXVigzuaPGucpl9kxAT5QtupAg1mDQ950ohXg9 o3hkDciRyayL4+z/BQBpp60g+VbEtYiml76SrwPH5Q915aqq9oKwH3e8NyRVa1jkV4rd HTiX+BxwBOAswc/ciRAuf1LGBCy06qc+57zXpxgfdi8SXl+rnCb94llCZTBp+ykxS5YD AXq6rBrkNmMyBEXgeOSMPb2QsWnSAuCHaDzVhZ9vuEzh1AMhT8gVbN3OIVDDXasnXtdf XQow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=hwOBoY5qFMEfFMRZbs9LOCT/B/V2y64Uzzn/r8yUL5A=; b=Khz2pAToNNdp7lOX6UQxHa6PrE2pUtQAw8URJR5bS2Im7+VjHBPwQYvnIvxPcQoYcn CfWTKqS8MvjvI7aPKfknoWlwZ7aW6ujuA+UPCEGC4ZDtV2tyS29TR21y/E2t1pkyTwTN X/HBcSCthf4j5dTmwFZGDsGhZ+8OdTVAsLzkRN9lWS77vFTkkAuxKtMvwRI1iCmA6Yf3 F7E6qxmHc+FlAjoJ1RPa1eOEYrQhXI61L1PN6hthN19Wvflbkj2e+Jlt6ekkTXHN1tt0 5k72GSf6w2YuNn8MhSIk9kLeGK5U8sOLHf3Lt3+FR+ChCy872SbT0Up7mSuUzuxuGsPS Z9iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hUp3uFMb; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a63d649000000b0040a88eddccfsi18450539pgj.441.2022.06.20.21.35.08; Mon, 20 Jun 2022 21:35:21 -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=@ibm.com header.s=pp1 header.b=hUp3uFMb; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245178AbiFUETY (ORCPT + 99 others); Tue, 21 Jun 2022 00:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiFUETU (ORCPT ); Tue, 21 Jun 2022 00:19:20 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ED3E2DD1 for ; Mon, 20 Jun 2022 21:19:20 -0700 (PDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25L3gD4m032278; Tue, 21 Jun 2022 04:19:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : content-type : mime-version; s=pp1; bh=hwOBoY5qFMEfFMRZbs9LOCT/B/V2y64Uzzn/r8yUL5A=; b=hUp3uFMbfV+/Mewg3VXKziIPVel6PY/K85X2H8dJidALUkVPc+cyS2vC6j6UZqClwRg6 Bf41KA8ytYxPP/s4zIZirseShiT00Ke5dRyz6y6aGcf4fajhjBW/MyuSXNOF3aEvqMBX o1L+0lBB7UTfKA26pb/jHpCGLN0ykdnqud0o3busrIMj/laYxejNmkyIjNsf4wsSWKZ+ YRlFhVcNqi4lk23ASaK1ACxunwa0E7fSenFFfbhk11RQc2o9NlvmYYw3Y12olNiracXH 26RWJAYQXHLMLA/3ZDc3eUijhIiZjsTgc8FyBGiyRNmFa3JHbO1rEtPlpjWVzNuKWc3x Kw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gu6ae0p4q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jun 2022 04:19:03 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 25L4J3RI014203; Tue, 21 Jun 2022 04:19:03 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gu6ae0p4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jun 2022 04:19:03 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25L49wxs004428; Tue, 21 Jun 2022 04:19:01 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02dal.us.ibm.com with ESMTP id 3gt008wrnv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jun 2022 04:19:01 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25L4J1xi9634402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jun 2022 04:19:01 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8228AC060; Tue, 21 Jun 2022 04:19:00 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5462DAC059; Tue, 21 Jun 2022 04:18:53 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.109.205.170]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 21 Jun 2022 04:18:53 +0000 (GMT) X-Mailer: emacs 29.0.50 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Tim Chen , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Tim Chen , Wei Xu , Huang Ying , Greg Thelen , Yang Shi , Davidlohr Bueso , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Jagdish Gediya , Baolin Wang , David Rientjes , Shakeel Butt Subject: Re: [RFC PATCH 1/3] mm/memory-tiers Add functions for tier memory usage in a cgroup In-Reply-To: <94a10c772c50d378b81dad654476551bfc50e3d7.1655242024.git.tim.c.chen@linux.intel.com> References: <94a10c772c50d378b81dad654476551bfc50e3d7.1655242024.git.tim.c.chen@linux.intel.com> Date: Tue, 21 Jun 2022 09:48:50 +0530 Message-ID: <875ykuabth.fsf@linux.ibm.com> Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: _2_iRA_8FO38nrjsJSbRM4ZfVDQEZ7Ly X-Proofpoint-GUID: k5MDrmGV_hKijexuBAQBpBWw9EOMkmVE X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-21_02,2022-06-17_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206210015 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 Tim Chen writes: +unsigned long mem_cgroup_toptier_usage(struct mem_cgroup *memcg) > +{ > + struct memory_tier *top_tier; > + > + top_tier = list_first_entry(&memory_tiers, struct memory_tier, list); > + if (top_tier) > + return mem_cgroup_memtier_usage(memcg, top_tier); > + else > + return 0; > +} As discussed here, we would want to consider all memory tiers that got compute as top tier. https://lore.kernel.org/linux-mm/11f94e0c50f17f4a6a2f974cb69a1ae72853e2be.camel@intel.com V6 patchset actually walk the full memory tier hierarchy reverse and consider any memory tier with higher or equal rank value than the first memory tier with CPU as top tier. https://lore.kernel.org/linux-mm/20220610135229.182859-12-aneesh.kumar@linux.ibm.com -aneesh