Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3242825pxb; Mon, 18 Oct 2021 11:01:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK6OGfPidd4Mw7xN58eRFY3DlQRbpSCmQHUS20Rzf9Ghq9fXALUJAgHM7QXIAekcGrgdfN X-Received: by 2002:a17:903:1c2:b0:13f:2893:de99 with SMTP id e2-20020a17090301c200b0013f2893de99mr28434798plh.80.1634580082559; Mon, 18 Oct 2021 11:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634580082; cv=none; d=google.com; s=arc-20160816; b=tk8Z4ahnnDo3T6m8GzhviyFw2RHncLjtznOw5PgvQwjXaGIHwGR+VWWc6uAvyF8iyI OfTuCrP2rE+OWErFNXxs4GlVOCZXmfm+Rouuyq/YGr/V6MEfVuEMCQoGVsvD8MhgAL5r zgXKHbegQ78DakhKbmFaebKlFmQyZK9Q/bR3/vgrc8VyN2sAgSXA0XgPy6IVio/ddOt+ WIsSsaD4wNxlC6WNOZ6ybxN8fKHCPX4QxxteZ3Yh0QiWyNSfg9q5I3NdyOHkZAfxc8DT w2hiHrzgaF45n7nR/F9kQoDSwhKf39I8Of1fbetvCbhyfqMTkUG9RTOYG5VPZMa0ugfo itgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Fwo1FlSWmGfR8EgNguoUcrUiHiDPPtb3Jg26oLyc2fA=; b=cU5mRWXtS23ldE4MnwBPepJDP45lvibNqIwsck9/7yxWEq/4wz/L09fAP3HzKcNlKL StKAeQvOqpUUGdjbUUEfxcWSQRYA7jRgf1ILWIam9UBfwNveCWQLb7EEsMuzUl5sptqG WdZ/EyiZf2OyqDixb9oOmFszzPtmm0lIdwqtS71f0nhFHfjJ7NDfI6hJMHIp+j1nSj2l R04J0EiOcR77PklDkO3q4/FK9ni/aq9QRz8G2pc+oTLEHWUF1q7/xy+EC/KMMzRBbVpj h+IXxBmCNl7Hrmc8FXEd1U9+zzCTEvixUY84a/9ajhHTrrxWJKlHl0Lq/rwnYnWSIL3l a3cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=YltaWPED; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si20746770pgp.53.2021.10.18.11.01.05; Mon, 18 Oct 2021 11:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=YltaWPED; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbhJRSCR (ORCPT + 99 others); Mon, 18 Oct 2021 14:02:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:43348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhJRSCQ (ORCPT ); Mon, 18 Oct 2021 14:02:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2CB260F02; Mon, 18 Oct 2021 18:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634580005; bh=BzISW9vyCKuOW8xX5ed1YJPxUHasRv0VhWVr0H1nVr8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YltaWPEDnGWX746jv/XUcHZOMV4RwfbENAUTpboIsTVBKh+ca3cfqONB/Y0mICkxm 0w+TSJa8mzhTYVDo1si/VhBrStWjlpvlwzJG/TxNjFYFgyelmdqbGhYSikzy8TJeiM U4mH1DEmzSHdLMfCIObWdyYMdwnEDfpG6Dge+yvQ= Date: Mon, 18 Oct 2021 11:00:02 -0700 From: Andrew Morton To: Faiyaz Mohammed Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@redhat.com, guptap@codeaurora.org, Mike Rapoport Subject: Re: [PATCH v4] mm: page_alloc: Add debug log in free_reserved_area for static memory Message-Id: <20211018110002.596d03206aa849eec06d11f5@linux-foundation.org> In-Reply-To: <1634540053-23304-1-git-send-email-faiyazm@codeaurora.org> References: <1634540053-23304-1-git-send-email-faiyazm@codeaurora.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Oct 2021 12:24:13 +0530 Faiyaz Mohammed wrote: > For INITRD and initmem memory is reserved through "memblock_reserve" > during boot up but it is free via "free_reserved_area" instead > of "memblock_free". > For example: > [ 0.294848] Freeing initrd memory: 12K. > [ 0.696688] Freeing unused kernel memory: 4096K. > > To get the start and end address of the above freed memory and to account > proper memblock added pr_debug log in "free_reserved_area". > After adding log: > [ 0.294837] 0x00000083600000-0x00000083603000 free_initrd_mem+0x20/0x28 > [ 0.294848] Freeing initrd memory: 12K. > [ 0.695246] 0x00000081600000-0x00000081a00000 free_initmem+0x70/0xc8 > [ 0.696688] Freeing unused kernel memory: 4096K. The above log appears to have things backwards. I assume you meant > [ 0.294848] Freeing initrd memory: 12K. > [ 0.294837] 0x00000083600000-0x00000083603000 free_initrd_mem+0x20/0x28 > [ 0.696688] Freeing unused kernel memory: 4096K. > [ 0.695246] 0x00000081600000-0x00000081a00000 free_initmem+0x70/0xc8