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 X-Spam-Level: X-Spam-Status: No, score=-18.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,URIBL_RED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E485C433DB for ; Wed, 27 Jan 2021 08:06:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52F412074F for ; Wed, 27 Jan 2021 08:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234650AbhA0IGJ (ORCPT ); Wed, 27 Jan 2021 03:06:09 -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-Google-Smtp-Source: ABdhPJy0vzzTa8tPz7BihHnETMHW4VOoner3DlexSXYzwwBiLgRdzOTa7biZMZ4cBO/OO2xwH6haTVe7HcWoFCBJlQY= 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/ 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 X-Spam-Level: X-Spam-Status: No, score=-18.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E498FC433DB for ; Wed, 27 Jan 2021 07:52:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58FEE2074B for ; Wed, 27 Jan 2021 07:52:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58FEE2074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7F9806B0006; Wed, 27 Jan 2021 02:52:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7813E6B000A; Wed, 27 Jan 2021 02:52:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 649FB6B000C; Wed, 27 Jan 2021 02:52:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 4A1136B0006 for ; Wed, 27 Jan 2021 02:52:41 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 178DD180AD83E for ; Wed, 27 Jan 2021 07:52:41 +0000 (UTC) X-FDA: 77750788122.21.park38_270abb027595 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id F1FCD18046DAA for ; Wed, 27 Jan 2021 07:52:40 +0000 (UTC) X-HE-Tag: park38_270abb027595 X-Filterd-Recvd-Size: 4685 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 07:52:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id EB0C720754 for ; 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-f42.google.com with SMTP id h7so1344255lfc.6 for ; Tue, 26 Jan 2021 23:52:38 -0800 (PST) X-Gm-Message-State: AOAM530dMXxLHB0RJsI1Y4jOobXj/LSHVbuIPyT9S/BQ+hXB3dstxMvH DqZ8Ni0BzqRzzF9ktP8HqutkYXOigap3yRmQ2ds= X-Google-Smtp-Source: ABdhPJy0vzzTa8tPz7BihHnETMHW4VOoner3DlexSXYzwwBiLgRdzOTa7biZMZ4cBO/OO2xwH6haTVe7HcWoFCBJlQY= 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" 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: 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/