Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp516237pxb; Wed, 27 Jan 2021 13:36:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZuC2j1VgME6TG2ltnbozZdSPURjEwXs8tYlld4yJmvC6lQXowlgBWPVsaWW1opuCeq44n X-Received: by 2002:aa7:da98:: with SMTP id q24mr8903501eds.370.1611783400030; Wed, 27 Jan 2021 13:36:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611783400; cv=none; d=google.com; s=arc-20160816; b=EcHSVwcPGUBKqNjzfk59ZBjZCAxWaIJGdQ1e0umtATvGrUC50/WRSzXXxqZsUX8VoX D4v9Sq5DXjNmKvgFzgTAN4qp19rKwDbktCh+uAdt2liTPpCHmrER68eaXHUG2xQEB567 9WLXNwkcN+q2hKGD7UN9/3a7vMX+8uhb8Lp2p/HDRCTMyaN9zHGpmelQLZtPHyzmLOPT qjieMF82Zm9Z1K9ED5v6Tlwb43Yt6QeyhgDxIN9aSizhnWdGXeF7oFARZWqsihie9eUm MByf5Cc82/tePrM5VwMi2JriIyto73gXKD/QYvd/FUWUm9TowYshY2B4Zkfh/on6RviK 7jSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+uTwZ7H70BpnOwXysnVVYng8fslThvDyRYbqGY/09LY=; b=cEpocFDsYoiiyHlR8BfvX0S5SSpI/9IvKNeNWRCLsauXg4c0CfDBeuEKFjhWVTQFmU 8qiSmHnJpBmkFw14XvaxgWZnInvjqNEfTZBzbyVi6fqoZhul9RFO8eDFRTsFWfiIlC1G bAgJtUwaUoK4/WICgnuU+LOpRtgj2lldLz8pab1hJSDHb5YPaTCNyqQD3poXe42rc9sk z7EUedp1OExujmNy5Lxt/mTtEia6Mt2EIzMLIJfJC8tI8+d1lUrJcBdWv6vspSIivbXD 9grCzXmqqPKDjUEPgkhlXshpzJxd08sQD/EA47NkwONvTLRIP1dhdEpmAJmr0rZ3nH1l Kbgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZLPBWbOU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si1334097ejc.354.2021.01.27.13.36.15; Wed, 27 Jan 2021 13:36:40 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=ZLPBWbOU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231432AbhA0IGE (ORCPT + 99 others); Wed, 27 Jan 2021 03:06:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:54158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbhA0IDn (ORCPT ); Wed, 27 Jan 2021 03:03:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED20920756; Wed, 27 Jan 2021 07:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611733959; bh=Tv+8y3pzWOHQkpR7Hs5hm5r5DosoTs5SyOgTkiddGHs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZLPBWbOUAdOHMPEoSwF7KtfjQYE2wJtn/7k3Bxd26KW9RHbAyfv1qUwzd5vT6n12W w1wGGebrYPmJhNBi/NOhv9uquUI8zULSDvRfVSi7PRk9NZ646lVmde6SdIB/SwAl8p 70RtrTXtspXp6RIHreqDfCkMW2UPOey7BEehAYpnQiYCjsCCNwIMNPYcerKnv3ki4l tS3XseuWB8NOkzkfPk+hGQDh3NYdjRaRwcMSVcfEolbClP+W2dkn6tTE4L7g2y8VAZ AkaYkg3gS8mcZBHJT49dRFGEgsN8l9JtKuv4SYs7ruHpQw4HYACPb5p5hW6qMIj/f1 UD5yoLiN9UX8w== Received: by mail-lf1-f52.google.com with SMTP id p21so1325621lfu.11; Tue, 26 Jan 2021 23:52:38 -0800 (PST) X-Gm-Message-State: AOAM532Jm1jZMe56OqU5rHQSI/fHaJGBpkXaz3SYlkvT13Y3NwECJX42 JmBRWciBth0f9srESlX446A7z6it/EmUcvne0W0= X-Received: by 2002:ac2:4436:: with SMTP id w22mr4276748lfl.41.1611733957044; Tue, 26 Jan 2021 23:52:37 -0800 (PST) MIME-Version: 1.0 References: <20210126181420.19223-1-david@redhat.com> <20210126182648.GR6332@kernel.org> In-Reply-To: <20210126182648.GR6332@kernel.org> From: Guo Ren Date: Wed, 27 Jan 2021 15:52:25 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1] csky: use free_initmem_default() in free_initmem() To: Mike Rapoport Cc: David Hildenbrand , Linux Kernel Mailing List , Linux-MM , linux-csky@vger.kernel.org, Andrew Morton , Oscar Salvador , Michal Hocko , Wei Yang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thx Mike, It's under test: https://gitlab.com/c-sky/buildroot/-/pipelines/247353584 kernel: https://github.com/c-sky/csky-linux/commit/9d986b01feb991ded3fb8c1f8153a0c80ea84b9c On Wed, Jan 27, 2021 at 2:26 AM Mike Rapoport wrote: > > On Tue, Jan 26, 2021 at 07:14:20PM +0100, David Hildenbrand wrote: > > The existing code is essentially > > free_initmem_default()->free_reserved_area() without poisoning. > > > > Note that existing code missed to update the managed page count of the > > zone. > > > > Cc: Andrew Morton > > Cc: Guo Ren > > Cc: Mike Rapoport > > Cc: Oscar Salvador > > Cc: Michal Hocko > > Cc: Wei Yang > > Signed-off-by: David Hildenbrand > > --- > > > > Not compile tested as documentation on how to get > > https://gitlab.com/c-sky/buildroot > > running, especially with a custom kernel, is a bit sparse. > > You can pick a cross-compiler from here: > > https://mirrors.edge.kernel.org/pub/tools/crosstool/ > > > --- > > arch/csky/mm/init.c | 17 +---------------- > > 1 file changed, 1 insertion(+), 16 deletions(-) > > > > diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c > > index 81e4e5e78f38..894050a8ce09 100644 > > --- a/arch/csky/mm/init.c > > +++ b/arch/csky/mm/init.c > > @@ -110,24 +110,9 @@ void __init mem_init(void) > > mem_init_print_info(NULL); > > } > > > > -extern char __init_begin[], __init_end[]; > > - > > void free_initmem(void) > > { > > - unsigned long addr; > > - > > - addr = (unsigned long) &__init_begin; > > - > > - while (addr < (unsigned long) &__init_end) { > > - ClearPageReserved(virt_to_page(addr)); > > - init_page_count(virt_to_page(addr)); > > - free_page(addr); > > - totalram_pages_inc(); > > - addr += PAGE_SIZE; > > - } > > - > > - pr_info("Freeing unused kernel memory: %dk freed\n", > > - ((unsigned int)&__init_end - (unsigned int)&__init_begin) >> 10); > > + free_initmem_default(-1); > > } > > > > void pgd_init(unsigned long *p) > > -- > > 2.29.2 > > > > -- > Sincerely yours, > Mike. -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/