Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2079501pxb; Fri, 25 Mar 2022 10:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyyUcXKYEU4sVus+hfWqbUmb68bZWAnQn4VNU3nke9wKjKKZ5BatL4MfVVSMsPs4IW9ilF X-Received: by 2002:a17:902:d2cd:b0:154:418d:e3a4 with SMTP id n13-20020a170902d2cd00b00154418de3a4mr12568201plc.34.1648230159262; Fri, 25 Mar 2022 10:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648230159; cv=none; d=google.com; s=arc-20160816; b=hvCMm6xcQ5kMc8rvOlQOedZTDCqyD9OZoNB9knDLKUbR0jjaM/YjIoT/MwOX5ZgoUB xKO8+aXd2VXD8C2WgWT+mzamKQwWvemsJBEwsvMSG2glwmqfItlFZyK8gI+haA22dzem NIvqACur0yS2q1LQxgmpdH+GrbRDggEQQuXI4XVEPhRl2rmRjIFIXzY/AK62e2Ik8jpj UIwPAKxjdoTqPeafInS70BD+4QyHaHVPtHhwDjPUNUFg6UyBXTghyKfkzgWPf9m9R/IH bfdXNz3FAm0R/JFVxCVqNGIRpV+cLHRfOr0TdAykpXhmEnHYyh7SlXonYE6xnxObFLG7 CZyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NXy3iAmEWX5wVxAK6LsFtVOzoIWNNqx4Rz1KiLIq6h8=; b=q8FWAzqbp1nDsnwWHTBXmagVcBkVkfGraXEnUbabllOTeeMhv1beheaMmzuUcU5Vij YxoQ1Vu3sdOfnS0CkxU1unQzVn+x+vnc7HlpmkV8wetFl+Wbd60xRXnvpFS9WF43D0Oy 9hA7/NMMaUsegGBi/7PY+Q/v1FJG0Fct56augtKUOZ/XX5APoJhDI6J74GIubOrd2Hho NnbOBebIxNywdc2DzQmrUX33emIqpLNovcI/KEMmJ8NAxWWLCYngkxbXhstyCNMB+E7O rTW+s0CCUqvzZCeMXMWAoKEzC7Gl4+6H2X6FykuyKrCT3oFwCMIKsQSsrHabdwJ6VAJu L0Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EvQGqDqq; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y18-20020a056a00181200b004fa3a8e0074si2420844pfa.299.2022.03.25.10.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:42:39 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EvQGqDqq; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5CA06FABCA; Fri, 25 Mar 2022 10:29:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354721AbiCYHsN (ORCPT + 99 others); Fri, 25 Mar 2022 03:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242995AbiCYHsM (ORCPT ); Fri, 25 Mar 2022 03:48:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F5E7CA0DE for ; Fri, 25 Mar 2022 00:46:39 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BD1D961B6C for ; Fri, 25 Mar 2022 07:46:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA036C340E9; Fri, 25 Mar 2022 07:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648194398; bh=mhnz9m6G+ghJ/c67sYiI4HzhlXpK6Em9Vo4Mqbapwuw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EvQGqDqqnUSxKTt2t0t4cWF1xH287iAC8iM8/isfkxlA0f+qsJH/EkrE1wOFuhBWc 2sRBpIYRJximcGYj3lJBeuD3wcR0c4lqI+MnS53WmYC6JOKImEVCMzWofRpuo4O3kx LYH+aOUGiWRy6L0xwhq48RVSyJfQagn312WjdW9yiYrt4DWlMnFZLah1Y1lS4AMXem YYSCByZf6uDud6Jt/jnW8bWVab0LoF/97uqljKBaTaWvNFR0+TaDujhsjuaGl0rhZK p++qDnbWvoSd6Thd0a85Swa0zuG685IXpE6M8Eu6aw6WG/CcALKLdpx+89H56yslvT kWIeJmH2v0Sew== Date: Fri, 25 Mar 2022 10:46:30 +0300 From: Mike Rapoport To: Jaewon Kim Cc: vbabka@suse.cz, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ytk.lee@samsung.com, jaewon31.kim@gmail.com Subject: Re: [PATCH 0/8] memblock: introduce memsize showing reserved memory Message-ID: References: <20220324070158.22969-1-jaewon31.kim@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220324070158.22969-1-jaewon31.kim@samsung.com> X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi, On Thu, Mar 24, 2022 at 04:01:50PM +0900, Jaewon Kim wrote: > 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 > 0x0f9000000-0x0fb000000 0x02000000 ( 32768 KB ) map reusable linux,cma > 0x0b1900000-0x0b1b00000 0x00200000 ( 2048 KB ) nomap unusable test1 > 0x0b0200000-0x0b0400000 0x00200000 ( 2048 KB ) map unusable test2 > (snipped) > > Reserved : 746924 KB > .kernel : 137027 KB > .text : 28158 KB > .rwdata : 3238 KB > .rodata : 13468 KB > .bss : 12570 KB > .etc : 79593 KB > .unusable : 609897 KB > System : 3447380 KB > .common : 3152468 KB > .reusable : 294912 KB > Total : 4194304 KB ( 4096.00 MB ) Most of this information information is already available at various places, like the existing memblock debugfs, /proc/iomem and DT sysfs. I don't see why we need yet another debugfs file to expose it. > Jaewon Kim (8): > memblock: introduce memsize showing reserved memory > memblock: detect hidden memory hole size > memblock: handle overlapped reserved memory region > memblock: track memblock changed at early param > memblock: track kernel size on memsize > memblock: recognize late free by checking PageReserved > memblock: print memsize summary information > memblock: print kernel internal size > > drivers/of/fdt.c | 10 + > drivers/of/of_reserved_mem.c | 7 +- > include/linux/memblock.h | 21 ++ > include/linux/mm.h | 3 + > init/main.c | 13 +- > kernel/dma/contiguous.c | 9 +- > mm/Kconfig | 7 + > mm/memblock.c | 434 ++++++++++++++++++++++++++++++++++- > mm/page_alloc.c | 15 +- > 9 files changed, 506 insertions(+), 13 deletions(-) > > -- > 2.17.1 > -- Sincerely yours, Mike.