Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1988259pxp; Thu, 17 Mar 2022 23:53:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/BiF2r59/rslVFeY/VUTLDxdpT9Tr8hgp5Otltq05Hp6qKl40jrO12OZbsEM6pD49zE+3 X-Received: by 2002:a17:907:8a25:b0:6d7:d59:6912 with SMTP id sc37-20020a1709078a2500b006d70d596912mr7766569ejc.259.1647586401354; Thu, 17 Mar 2022 23:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647586401; cv=none; d=google.com; s=arc-20160816; b=BhuoZDJJqXAOilGEjDNS1+Qka/ETUm2gJNjS6UTZDFUNJj6lnparpbTHNwKP/rd07R sbE7Z5VkL2hspCgEnk3q4agI00vEJJCqY5Stu9xbxsuQNiKczB8d1UpyDi7TGwxyCoj9 MGsU4tmvI1jXlUZP8EjSd/9ocw9BeNWUAKqsvUXDw51NBiRpSE4Dek9D66lyUZ2s3u5D IFeNKVn12d5mXN5JMcdxBDWUq5I07XlhlTS1xOkMIaGedfc9H6mcH5/lZ8HwNEJ4lLzT Jvf1KBI8xKJihp7x1XzgiKPw86FbzAnp9ype1eQzB+7nACF9AaETOC53Db1ApP0CX6nD mxXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:references:cc:to:subject :reply-to:from; bh=Lo+A4SkjUXqbuNCaDQmT+bF41FxUvATcUUtDRWYHirw=; b=d0vDOjhUnAw4FdE6Mi8qq/P7DQ1pBiCQZ0fF2zq4Kj7IfjNtHrI8GvoB+kgrm4tRJR WOe0/xKfigjYgjpnfpQgLO03cV2F0xI6TLjWKfY1CFGt+hNxu0//2Dt1ZvfTYLn2+x8k eAOdBn38R9z7ak3MfkDDTqUQ5OeW94hYGAIiPq5H8f95HZ1/AMvZIDK95PVuZRqsw6o5 EXoUUiB8GRlf5WXRsp0WhqWgTOeSjAT2dxEKQ6k5xGCm1srMGsKpg/epioApxVRwr5Bz TZRtiuD9dItAjkKqPT8SM2JcnKKYIMGZm8J5807Zwnc2h0QFWL/OGTuAC1MNKyxxJ4qY aKxw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n10-20020a50934a000000b00418e5630545si2894244eda.458.2022.03.17.23.52.56; Thu, 17 Mar 2022 23:53: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232467AbiCRFOn (ORCPT + 99 others); Fri, 18 Mar 2022 01:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232469AbiCRFOg (ORCPT ); Fri, 18 Mar 2022 01:14:36 -0400 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08F802719 for ; Thu, 17 Mar 2022 22:13:17 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R471e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V7UWWcn_1647580393; Received: from B-X3VXMD6M-2058.local(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0V7UWWcn_1647580393) by smtp.aliyun-inc.com(127.0.0.1); Fri, 18 Mar 2022 13:13:14 +0800 From: xhao@linux.alibaba.com Reply-To: xhao@linux.alibaba.com Subject: Re: [RFC PATCH V1 0/3] mm/damon: Add CMA minotor support To: David Hildenbrand , sj@kernel.org Cc: rongwei.wang@linux.alibaba.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Baolin Wang , SeongJae Park References: <6e6ef9fa-3916-3449-954d-efd63a959019@linux.alibaba.com> Message-ID: <611f2ec6-04de-440a-3d54-c2bc34f45cf3@linux.alibaba.com> Date: Fri, 18 Mar 2022 13:13:12 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 3/18/22 12:42 AM, David Hildenbrand wrote: > On 17.03.22 08:03, Xin Hao wrote: >> Hi David, >> >> On 3/16/22 11:09 PM, David Hildenbrand wrote: >>> On 15.03.22 17:37, Xin Hao wrote: >>> >>> s/minotor/monitor/ >> Thanks,  i will fix it. >>>> The purpose of these patches is to add CMA memory monitoring function. >>>> In some memory tight scenarios, it will be a good choice to release more >>>> memory by monitoring the CMA memory. >>> I'm sorry, but it's hard to figure out what the target use case should >>> be. Who will release CMA memory and how? Who will monitor that? What are >>> the "some memory tight scenarios"? What's the overall design goal? >> I may not be describing exactly what  i mean,My intention is to find out >> how much of the reserved CMA space is actually used and which is unused, >> For those that are not used, I understand that they can be released by >> cma_release(). Of course, This is just a little personal thought that I >> think is helpful for saving memory. > Hm, not quite. We can place movable allocations on cma areas, to be > migrated away once required for allocations via CMA. So just looking at > the pages allocated within a CMA area doesn't really tell you what's > actually going on. I don't think so,  the damon not looking at the pages allocate, It is constantly monitoring who is using CMA area pages through tracking page access bit in the kernel via the kdamond.x thread, So through damon, it can tell us about  the hot and cold distribution of CMA memory. --cc  SeongJae Park More about damon, you can refer to this link:https://sjp38.github.io/post/damon/ > -- Best Regards! Xin Hao