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 B1CF8C25B77 for ; Wed, 22 May 2024 08:16:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33B0E6B0099; Wed, 22 May 2024 04:16:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C3FE6B009D; Wed, 22 May 2024 04:16:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13E4B6B00A3; Wed, 22 May 2024 04:16:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E685C6B0099 for ; Wed, 22 May 2024 04:16:52 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 97FEB14143A for ; Wed, 22 May 2024 08:16:52 +0000 (UTC) X-FDA: 82145325864.25.DF302A4 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by imf16.hostedemail.com (Postfix) with ESMTP id 88ABA18000D for ; Wed, 22 May 2024 08:16:50 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cCIQk1rf; spf=pass (imf16.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716365810; h=from:from:sender:reply-to: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:dkim-signature; bh=cWF9+jISPa0SvmLgvqwBtrWZLN0MZwBJjydQ/zsUvNc=; b=zdhoEycICAV8VkDuXjtzSZLJSb8eCG4NY0yEspZqvB/HelyJs5qkLWH6c9+DOXUI2OsB6L xipMqpVMBpN5yzBmvIy+gpHX4tG/xeTfvT+sXrr4LMmdKe5gPNEbl1FXnT8XMVOdxNhn9l pLM3WDILzO8+BcvmtYsUfELrz9bhG8c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716365810; a=rsa-sha256; cv=none; b=Wz1GvDuEcgmzXS10vONmNRwkInAWq1WQJqhzLb7bGUSKHWDvPcOOmVDqwz/n6OnEHgC24c k5mzsuhMBk6KWmXZvCfEH1bnj8JJGeyfknPPLlWV2LeNv9eZQ8jwIkwz7S7qXy9ihSdpJY Au18TInnqukzUu+L5kRmX2KzVOmO4M0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cCIQk1rf; spf=pass (imf16.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a59e4136010so1001698666b.3 for ; Wed, 22 May 2024 01:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716365809; x=1716970609; darn=kvack.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cWF9+jISPa0SvmLgvqwBtrWZLN0MZwBJjydQ/zsUvNc=; b=cCIQk1rfrGG8zJSStIU+w+xHdj7DuBl1/usFegJWBKQPARiQhrM+sj/OSrq6VZo2Kr op6hzX5JyZus7HHzc60lCMkvcL9EnFLtypP4IYRpQCtTIu7N6JJvcmGBJVS2poc62Z/0 AMy0vXAezYlrG4a8kbbDNQC3vIXCZIhGh5TnldLdczZMwzfB0eZw30DyugFKl9D6Oep9 v9TINMJquyyr/Wer1LUV/MgqSZO0urXuWKV6X+kohsSvWqYHwSsixwHm5/2RGmvkv8h5 H1TPYH5cpiZnti06NbEfzzIiByYUorINbz3w4nHiovMVizoTr6q99ERkYyIfTrfbWEkS BUvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716365809; x=1716970609; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cWF9+jISPa0SvmLgvqwBtrWZLN0MZwBJjydQ/zsUvNc=; b=g2uNqjdr+E6rsE+d5LWzfwZ7JHKJ+eJo8K0BaIrbpOd+mT77GQwujgKhO+OKGESUVJ rc96lill9dxDYpnGxgWjPdjJgObZ5xDScYLlv/BcJPjQ4ELVPKtNahkU0jZA4mCNnBXG lseWgeuvByZ2nzB0j8UFMKaa5o/XNcrUzJGbaNzqatWYhENRU8sZBz/vIHm22piIFzS5 OChWiSLtFHzb1NFGpGzITl6DopbL1rFuUz32wmw8ruIe4LuArnd96+VhE8xXYhY5vBEl mDQlgw/mR+9N+ZnHsv6CqwmGxzeof2ehx4sWqu+8+vXGDcmarTqW1njPTTR988CaZnYC aizQ== X-Forwarded-Encrypted: i=1; AJvYcCVTTvQ6hFQ1NLQ5flCNsj/5I+ZcF0XXJhNH2nkH4vL2eA00QbCc8TBgMZY4lFShV61wAdua/3QP77yXcwmYLCON4v8= X-Gm-Message-State: AOJu0YzKH646sZUmgEKwd1AjzGx/lrz5EsiVTG7pH0CIMzG7Q9WIwIe5 e7KxJl9822swEkf6VnPWh7pDB8g/LIJ7/EukDvD0cXa7VUZ6kr25 X-Google-Smtp-Source: AGHT+IFAwo2wFFZHqeFgGha0f7XN6Yby5SI6m6Aol27vpYXjkrNMUOIKkSX1cPRjU/m4x492FGLRvQ== X-Received: by 2002:a17:906:693:b0:a5f:ae29:6a53 with SMTP id a640c23a62f3a-a62281f798fmr67350466b.66.1716365808900; Wed, 22 May 2024 01:16:48 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a179c7da8sm1751489066b.99.2024.05.22.01.16.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 May 2024 01:16:48 -0700 (PDT) Date: Wed, 22 May 2024 08:16:47 +0000 From: Wei Yang To: Jaewon Kim Cc: Mike Rapoport , "vbabka@suse.cz" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "jaewon31.kim@gmail.com" , "tkjos@google.com" Subject: Re: (2) [RESEND PATCH 00/10] memblock: introduce memsize showing reserved memory Message-ID: <20240522081647.zlwenenrbrjemlp6@master> Reply-To: Wei Yang References: <20240521023957.2587005-1-jaewon31.kim@samsung.com> <20240521025329epcms1p6ce11064c0f0608a0156d82fda7ef285c@epcms1p6> <20240521101753epcms1p50443f6b88adea211dd9bbb417dd57cb1@epcms1p5> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240521101753epcms1p50443f6b88adea211dd9bbb417dd57cb1@epcms1p5> User-Agent: NeoMutt/20170113 (1.7.2) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 88ABA18000D X-Rspam-User: X-Stat-Signature: tegi1edi3p4jszfkn1na48sg5umxsj9y X-HE-Tag: 1716365810-807079 X-HE-Meta: U2FsdGVkX18S6J7W6jB3cLywzjfjYvXFq0lEcX1K2MBSR6YkYGnWdnfk+vVgGRfekDU0a0mUt77e7qThfo4aDFqMNfO3eAGWr5xagiCvYdUE4sMQiDmL1ueMO2WyYBJ4nVGt7+IGSbePd71NFUjfbFywejSctha8y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ca4wKHG5XUwBKmtUR7e2QLjPJ7+6dp+1YVnKqZf0gTwu1v8rTIE2WvA+R+7QWAzmzsEWJ2ZrTm01ckomYyh9KAcrvy017AFh0YCqEYWmL8MQf9qFkRLbQepximvUtkNF5F5rLAoiBW630JnJH2d8HWucZ7RwZw9AF9wq1Cjj0XNOImj4pguY9I+AiQNju6KFnjFoOF2XnQN17BTVf6n8IlFuLLxrcnZNajxDMgCr7uM9CQcH8XVnr8pyTzr5yQ9sA/f/Bv/BSkewBc4IpT7HHvuKOF+R2TSk47WoR0DInTMcvW80lnB6Ko9c0mTeRfNzxjOfToaXmjImgIhlqINCTHU8AFaDpDPoviZGu4ecFmvzzeXgOtZ8PHFPlGEjfFF0ZLrIiy+UVTKTLufBZsWV7fkPT8DE2mRwbBv5tOARDvP9NqznYrg4B1oDiq7cjd8uSfX5Eiy4czJ1TWKI+fhYTw5KfDcDQF/maJdshLp1Hdwx182ryq9ykJYAwQ/xQcYOP0M39rWCqfrSUQiXruSxQ7vka7XGjJN9FBXIS/wyv0yuFZs2ofuVke/0h/UxdF+B+r0nG8i53eAuDv/eXICUAJ0EQ== 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: List-Subscribe: List-Unsubscribe: On Tue, May 21, 2024 at 07:17:53PM +0900, Jaewon Kim wrote: >>On Tue, May 21, 2024 at 11:53:29AM +0900, Jaewon Kim wrote: >>> >--------- Original Message --------- >>> >Sender : 김재원 System Performance Lab.(MX)/삼성전자 >>> >Date : 2024-05-21 11:40 (GMT+9) >>> >Title : [RESEND PATCH 00/10] memblock: introduce memsize showing reserved memory >>> >? >>> >Some of memory regions can be reserved for a specific purpose. They are >>> >usually defined through reserved-memory in device tree. If only size >>> >without address is specified in device tree, the address of the region >>> >will be determined at boot time. >>> > >>> >We may find the address of the memory regions through booting log, but >>> >it does not show all. And it could be hard to catch the very beginning >>> >log. The memblock_dump_all shows all memblock status but it does not >>> >show region name and its information is difficult to summarize. >>> > >>> >This patch introduce a debugfs node, memblock/memsize, to see reserved >>> >memory easily. >>> > >>> >Here's an example >>> > >>> >$ cat debugfs/memblock/memsize >>> > >>> >0x0000000000000000-0x0000000000000000 0x02000000 (? 32768 KB )? map reusable linux,cma >>> >0x0000000000000000-0x0000000000000000 0x01000000 (? 16384 KB )? map reusable vxxxxx >>> >... >>> >0x0000000000000000-0x0000000000000000 0x004e0000 (? ? 4992 KB ) nomap unusable unknown >>> >0x0000000000000000-0x0000000000000000 0x00400000 (? ? 4096 KB ) nomap unusable cxxxxx >>> >0x0000000000000000-0x0000000000000000 0x00e00000 (? 14336 KB ) nomap unusable gxxxxx >>> > >>> >Reserved? ? : 1223856 KB >>> > .kernel? ? :? 275208 KB >>> >? .text? ? :? 16576 KB >>> >? .rwdata? :? ? 1963 KB >>> >? .rodata? :? 11920 KB >>> >? .bss? ? ? :? ? 2450 KB >>> >? .memmap? :? 186368 KB >>> >? .etc? ? ? :? 55933 KB >>> > .unusable? :? 948648 KB >>> >System? ? ? : 11359056 KB >>> > .common? ? : 10306384 KB >>> > .reusable? : 1052672 KB >>> >Total? ? ? : 12582912 KB ( 12288.00 MB ) >>> > >>> >Jaewon Kim (10): >>> >? memblock: introduce memsize showing reserved memory >>> >? memblock: detect hidden memory hole size >>> >? memblock: handle overlapped reserved memory region >>> >? memblock: take a region intersecting an unknown region >>> >? memblock: track memblock changed at early param >>> >? memblock: recognize late freed size by checking PageReserved >>> >? memblock: track kernel size on memsize >>> >? memblock: print memsize summary information >>> >? memblock: print kernel internal size >>> >? memblock: support memsize reusable to consider as reusable >>> > >>> > drivers/of/fdt.c? ? ? ? ? ? |? 11 + >>> > drivers/of/of_reserved_mem.c |? 12 +- >>> > include/linux/memblock.h? ? |? 29 ++ >>> > init/main.c? ? ? ? ? ? ? ? ? |? 13 +- >>> > kernel/dma/contiguous.c? ? ? |? 9 +- >>> > mm/Kconfig? ? ? ? ? ? ? ? ? |? 16 ++ >>> > mm/memblock.c? ? ? ? ? ? ? ? | 502 ++++++++++++++++++++++++++++++++++- >>> > mm/mm_init.c? ? ? ? ? ? ? ? |? 6 +- >>> > mm/page_alloc.c? ? ? ? ? ? ? |? 10 +- >>> > 9 files changed, 597 insertions(+), 11 deletions(-) >>> > >>> >-- >>> >2.25.1 >>> >>> Hello Mike >>> >>> This is actually RESEND as it was introduced 2 years ago. >>> Please refer to https://lore.kernel.org/linux-mm/YkQB6Ah603yPR3qf@kernel.org/#t >>> >>> > But you never provided details about *why* you want this information exposed. >>> >>> For your question, I'd like to say ; >>> We can see the same format and exact information between different version of kernel status. >>> >>> 1) Internally we can check if the reserved memory changes. >>> 2) Externally we can communicate between chipset vendors and OEM, with a same format. >> >>Why the existing debugfs interface is not sufficient? > >debugfs/memblock/memory & debugfs/memblock/reserved have changed its format but still does not show name, reusable, kernel size. Would you mind showing which information matters to you most in the following example log message? What you expect to see and helps you on locating problem? 0x0000000000000000-0x0000000000000000 0x02000000 ( 32768 KB ) map reusable linux,cma 0x0000000000000000-0x0000000000000000 0x01000000 ( 16384 KB ) map reusable vxxxxx .. 0x0000000000000000-0x0000000000000000 0x004e0000 ( 4992 KB ) nomap unusable unknown 0x0000000000000000-0x0000000000000000 0x00400000 ( 4096 KB ) nomap unusable cxxxxx 0x0000000000000000-0x0000000000000000 0x00e00000 ( 14336 KB ) nomap unusable gxxxxx Reserved : 1223856 KB .kernel : 275208 KB .text : 16576 KB .rwdata : 1963 KB .rodata : 11920 KB .bss : 2450 KB .memmap : 186368 KB .etc : 55933 KB .unusable : 948648 KB System : 11359056 KB .common : 10306384 KB .reusable : 1052672 KB Total : 12582912 KB ( 12288.00 MB ) >If memory is reserved from memblock, and did not freed back to memblock. Memblock does not know even after the memory is freed to system. You mean we may reserve memory in memblock.reserved, but still have it freed to system? This sounds a bug to me. >I think a simple debug interface is needed to easily communicate with others or compare different SW releases. > >> >>> This helps us to communitcate well, to easily detect changes or just to see differences. >>> >>> Jaewon Kim >>> >> >>-- >>Sincerely yours, >>Mike. > > -- Wei Yang Help you, Help me