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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FA42C4332F for ; Fri, 18 Mar 2022 08:29:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 10DDC8D0002; Fri, 18 Mar 2022 04:29:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BF138D0001; Fri, 18 Mar 2022 04:29:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA0D28D0002; Fri, 18 Mar 2022 04:29:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id D71798D0001 for ; Fri, 18 Mar 2022 04:29:25 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8B69EA3ECD for ; Fri, 18 Mar 2022 08:29:25 +0000 (UTC) X-FDA: 79256832690.19.F975383 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf31.hostedemail.com (Postfix) with ESMTP id 2C5EA20016 for ; Fri, 18 Mar 2022 08:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647592164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LDoEDSiNBMa0d/W0Sq58qXmb+e3TteSbt+UhcZgHo1g=; b=XNzMPOBIc+ojGQ9r3C6a+gN9L66pf84POq1jBwuCJ4ZiOjvad9Sxrp2UqDFziXDcHX7sUH +KVPlefnfSnDx8ZUKd91d1PzPyEy4QjcH52UD/wCVP/O7BQyqB49zpAQnjhpmLeyK6TBlN YeFA/StkeXNcO340E5YTIFRNycTSdPo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-661-KYNiiJa1Mw2guuIt9QrgQg-1; Fri, 18 Mar 2022 04:29:23 -0400 X-MC-Unique: KYNiiJa1Mw2guuIt9QrgQg-1 Received: by mail-wm1-f69.google.com with SMTP id k26-20020a05600c0b5a00b0038c6c41159bso2978653wmr.0 for ; Fri, 18 Mar 2022 01:29:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=LDoEDSiNBMa0d/W0Sq58qXmb+e3TteSbt+UhcZgHo1g=; b=vduAjBbauCFt0T16CH1W5iAnZNX5yD+117pDUyDUajyTlRekowxsG1Q41k8QoRGbAH 6iDZfS/52yvqZcFsxa+QAzWkneTcZZ8d4XGgrIceHNSEdU2rLxp/Y3nthDTxF2RPZrR8 o4Yye8320YFpg7CdqUAoIOwz04Bdb2QKEBAz1q2fOHcLlLMxkNHg+QBlyY9tlqrXmcUw O1mHfvZOa+7LUeQJRkeUXWWco8+8DRtauX8aTTXkd3AcqImMg6lC1SSZ/YvWQdu7JP6F wrx6x5+2CJsrERM1zyjhXMIaDQSmt8hwu46ZOQkHOo3Cr3oY0bhrBDuJbxnS7OKAlrlH jv6w== X-Gm-Message-State: AOAM5309FyHEiFhiX6sn5izrUTYHPvLHorAgeNcc+vxLQ8LPl5BVxXIw bThbpY/+jk/jmfXkS9nuPbcSjAOBNYo2FNqPsUt1Xt+jwbJ4Q3nW5vVdl+eFyI6Ev6GUVSKYroN zs6J2r7IdfVs= X-Received: by 2002:a7b:c3d5:0:b0:389:a49f:c7e6 with SMTP id t21-20020a7bc3d5000000b00389a49fc7e6mr14793743wmj.99.1647592162298; Fri, 18 Mar 2022 01:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkPC1mF1Lx1YUqLN1xR6qms12TLZDWMc4+fr+Mty0rmuPrDlL/XBjnqqVxOKdNJCpuxEZkCw== X-Received: by 2002:a7b:c3d5:0:b0:389:a49f:c7e6 with SMTP id t21-20020a7bc3d5000000b00389a49fc7e6mr14793725wmj.99.1647592162025; Fri, 18 Mar 2022 01:29:22 -0700 (PDT) Received: from ?IPV6:2003:d8:2f24:9200:124e:f0bf:6f8c:cbd8? (p200300d82f249200124ef0bf6f8ccbd8.dip0.t-ipconnect.de. [2003:d8:2f24:9200:124e:f0bf:6f8c:cbd8]) by smtp.gmail.com with ESMTPSA id p12-20020a5d48cc000000b001e6114938a8sm5784805wrs.56.2022.03.18.01.29.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Mar 2022 01:29:21 -0700 (PDT) Message-ID: <5c46548a-04b9-607e-f43a-63545131d336@redhat.com> Date: Fri, 18 Mar 2022 09:29:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [RFC PATCH V1 0/3] mm/damon: Add CMA minotor support To: xhao@linux.alibaba.com, sj@kernel.org Cc: rongwei.wang@linux.alibaba.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Baolin Wang References: <6e6ef9fa-3916-3449-954d-efd63a959019@linux.alibaba.com> <611f2ec6-04de-440a-3d54-c2bc34f45cf3@linux.alibaba.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <611f2ec6-04de-440a-3d54-c2bc34f45cf3@linux.alibaba.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 X-Rspam-User: X-Rspamd-Queue-Id: 2C5EA20016 X-Stat-Signature: 1fwor7uxn9xdy6xuf6jff38ktu9zsrhs Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XNzMPOBI; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf31.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1647592164-531083 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 18.03.22 06:13, xhao@linux.alibaba.com wrote: >=20 > 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,=C2=A0 i will fix it. >>>>> The purpose of these patches is to add CMA memory monitoring functi= on. >>>>> 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 shou= ld >>>> 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=C2=A0 i mean=EF=BC=8CMy intentio= n is to find out >>> how much of the reserved CMA space is actually used and which is unus= ed, >>> For those that are not used, I understand that they can be released b= y >>> 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 a= t >> the pages allocated within a CMA area doesn't really tell you what's >> actually going on. >=20 > I don't think so,=C2=A0 the damon not looking at the pages allocate, It= is=20 > constantly monitoring who is using CMA area pages through tracking page= =20 > access bit >=20 > in the kernel via the kdamond.x thread, So through damon, it can tell u= s=20 > about=C2=A0 the hot and cold distribution of CMA memory. I'm not sure I follow. With random movable pages being placed on the CMA area, the mentioned use case of "cma_release()" to release pages doesn't make sense to me. I assume I'm missing the big picture -- and that should be properly documented in the patch description. We don't add stuff just because it could be used somehow, there should be a clear motivation how it can actually be used. --=20 Thanks, David / dhildenb