Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp453127pxb; Wed, 27 Jan 2021 11:48:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRz3YA2zbceehXG68/lL76YHxeyszUL85xvAJR684ltekiz2POaF5Nhfq4vzrCZ3RPIPC3 X-Received: by 2002:a17:906:86cf:: with SMTP id j15mr8127124ejy.216.1611776932672; Wed, 27 Jan 2021 11:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611776932; cv=none; d=google.com; s=arc-20160816; b=X80hkpoonyJf2o3RKr/YDyRa9Hr2y6w1UwqqpNWib5jNqNHpD5slCpXyCsu8tedRui W9zmDeEb3KR+uENLcZ8XeHyW6k/YME1g0GiPzdAiwqpPQ0sSMFASXjYIscg/Iu8YANV5 9yOCvP3ttdTenBs1jxbS/yyz1zUbmYgkk0Ikla+a5DBuiNoDwO/DFfMVkrEywPAN1nxX zs+wlXSdEmUCFe4Bv0Kd8vWklRl6m789XH8A8fk/76S/G5cm11/CAjOtWf3zhHz/Wa8W tMLT6q6EaF8SKsMXqnDWj0LeXsOld6FHPZv0+UM/ngmApB+Q12wOnqiimoMg5AyMaUy0 xagQ== 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=x2kNH7+cdxZlFdBmjjVdHiaBmuB2ew30M8LWE7I7mvU=; b=dHbhga6uZIQAiLdziC/ysT87eTWcennVUDAe77+ZT8AcQuRQpVyLxgp6Za/ywzR0e9 5nD0UlCEQsVPPuxAdy90cx+AeP3hiyzLTrO0Q4fyoHez50rJdW9d1i6o5cvQRS3RSAyT 19osaxUvNMM5zciq4pzfSZiO0td6usihrF/5D6Hwi0xOBDXLmM+3pRirANvypLwFlz2V dLVJ+oLOmxbZZTk0X3WPDvnxdTdm18FXW7qLoPpt3zDHBIm6fYkb4ezbVC5snQP3I63x k2GGdMXlCoZEe+9k6f65hZwRHmpnu+pwvG7IKG/TEg9FuTaZq4gpCcB9nEWh/giRzJG5 VF4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jqTSVnzk; 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 k2si1599474edx.44.2021.01.27.11.48.11; Wed, 27 Jan 2021 11:48:52 -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=jqTSVnzk; 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 S2392018AbhA0B0Z (ORCPT + 99 others); Tue, 26 Jan 2021 20:26:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:48056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728624AbhAZS1h (ORCPT ); Tue, 26 Jan 2021 13:27:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95C32207A9; Tue, 26 Jan 2021 18:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611685617; bh=mS4fwRCoDBpjB2pQf4JgN+vKx0b/jP8+diUiuhUDlNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jqTSVnzkNI1pw4SkMEPZVenKL5EBNeXDXThSaq/NYS00TyHO6RMN9l7n2hF0qgXsB MmXqklVicSbsEwdjASSGGsnFIcqGoc3+4wA3oU1eMIm1RbXQnqQrFbkfcNGrzavQBO Pg7o3dJEkSvfTwxmmGDd06ceJR8iTDcSRfM0HWj6OIgcnLbC/8Sfh9ObjF6rwaLNg7 oMpnRoRgBmyzEpy6dFXw2Bqtr9OBQpV0XP9dj8BgfOKZwkyXxPCzjzo35gsu0bVPdg tdyfLMe3v4qEsQeNzxZfVKe2k0gb6beRA+0RdyW2iee0MqQI8h3DHNvuDy0nNRtSqc 8moYTUwV3ciqw== Date: Tue, 26 Jan 2021 20:26:48 +0200 From: Mike Rapoport To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-csky@vger.kernel.org, Andrew Morton , Guo Ren , Oscar Salvador , Michal Hocko , Wei Yang Subject: Re: [PATCH v1] csky: use free_initmem_default() in free_initmem() Message-ID: <20210126182648.GR6332@kernel.org> References: <20210126181420.19223-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210126181420.19223-1-david@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.