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=-1.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS 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 BE0BDECDE46 for ; Wed, 24 Oct 2018 21:26:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6351B205F4 for ; Wed, 24 Oct 2018 21:26:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="WFc9fBtW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6351B205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbeJYFzo (ORCPT ); Thu, 25 Oct 2018 01:55:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:45666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbeJYFzn (ORCPT ); Thu, 25 Oct 2018 01:55:43 -0400 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E951A205F4; Wed, 24 Oct 2018 21:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540416360; bh=DrYv3rOz4s3YKUAS25iDFbj9u1gmDS7kDGOLP8aXMPU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WFc9fBtW/wQk5rRBn8pd4zZ4GV3BDaqF2IH3xf//pL9gti9zT6wmhauZ04ZVAXXAX tEwOtwUKBf3yqR/uZINoF0Q7yqXohdhB5HZrxBB0n6o3r1fLXBC0QLTGFNZeObXs3r Pmm6zykqDp7m/QuWcNSZX2FpHTMf09MjtrWfpZfw= Received: by mail-qk1-f180.google.com with SMTP id m8-v6so4380448qka.12; Wed, 24 Oct 2018 14:25:59 -0700 (PDT) X-Gm-Message-State: AGRZ1gJKm0qMChzWJIuil/CmfjNbIoJoP/4OlrOhw9cpwGINyTN+wDnY iJLypuU6wyWdv26ORszoDUCTQWyiMWrVoXCBuA== X-Google-Smtp-Source: AJdET5fLeqEQvAx6hoB3x+b9qFI1ZHrue/yG2wOqJqu736uN/9NeIxzvWV7airWmV10BuVn5dG9cretcBZt5Df4K5Vc= X-Received: by 2002:ae9:edd8:: with SMTP id c207mr1630980qkg.184.1540416359162; Wed, 24 Oct 2018 14:25:59 -0700 (PDT) MIME-Version: 1.0 References: <20181024193256.23734-1-f.fainelli@gmail.com> <6e647f76-8523-09d3-9b72-d8d8abd213a4@gmail.com> In-Reply-To: <6e647f76-8523-09d3-9b72-d8d8abd213a4@gmail.com> From: Rob Herring Date: Wed, 24 Oct 2018 16:25:47 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] arm64: Cut rebuild time when changing CONFIG_BLK_DEV_INITRD To: Florian Fainelli Cc: "linux-kernel@vger.kernel.org" , Catalin Marinas , Will Deacon , Arnd Bergmann , Greg Kroah-Hartman , Marc Zyngier , Olof Johansson , linux-alpha@vger.kernel.org, arcml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-c6x-dev@linux-c6x.org, "moderated list:H8/300 ARCHITECTURE" , linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Linux-MIPS , nios2-dev@lists.rocketboards.org, Openrisc , linux-parisc@vger.kernel.org, linuxppc-dev , linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, SH-Linux , sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, devicetree@vger.kernel.org, "open list:GENERIC INCLUDE/ASM HEADER FILES" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 24, 2018 at 3:01 PM Florian Fainelli wrote: > > On 10/24/18 12:55 PM, Rob Herring wrote: > > On Wed, Oct 24, 2018 at 2:33 PM Florian Fainelli wrote: > >> > >> Hi all, > >> > >> While investigating why ARM64 required a ton of objects to be rebuilt > >> when toggling CONFIG_DEV_BLK_INITRD, it became clear that this was > >> because we define __early_init_dt_declare_initrd() differently and we do > >> that in arch/arm64/include/asm/memory.h which gets included by a fair > >> amount of other header files, and translation units as well. > > > > I scratch my head sometimes as to why some config options rebuild so > > much stuff. One down, ? to go. :) > > > > This one was by far the most invasive one due to its include chain, but > yes, there would be many more that could be optimized. > > >> Changing the value of CONFIG_DEV_BLK_INITRD is a common thing with build > >> systems that generate two kernels: one with the initramfs and one > >> without. buildroot is one of these build systems, OpenWrt is also > >> another one that does this. > >> > >> This patch series proposes adding an empty initrd.h to satisfy the need > >> for drivers/of/fdt.c to unconditionally include that file, and moves the > >> custom __early_init_dt_declare_initrd() definition away from > >> asm/memory.h > >> > >> This cuts the number of objects rebuilds from 1920 down to 26, so a > >> factor 73 approximately. > >> > >> Apologies for the long CC list, please let me know how you would go > >> about merging that and if another approach would be preferable, e.g: > >> introducing a CONFIG_ARCH_INITRD_BELOW_START_OK Kconfig option or > >> something like that. > > > > There may be a better way as of 4.20 because bootmem is now gone and > > only memblock is used. This should unify what each arch needs to do > > with initrd early. We need the physical address early for memblock > > reserving. Then later on we need the virtual address to access the > > initrd. Perhaps we should just change initrd_start and initrd_end to > > physical addresses (or add 2 new variables would be less invasive and > > allow for different translation than __va()). The sanity checks and > > memblock reserve could also perhaps be moved to a common location. > > > > Alternatively, given arm64 is the only oddball, I'd be fine with an > > "if (IS_ENABLED(CONFIG_ARM64))" condition in the default > > __early_init_dt_declare_initrd as long as we have a path to removing > > it like the above option. > > OK, let me cook a patch doing that and meanwhile I will look at how much > work is involved to implement the above option you outlined, which also > sounds entirely reasonable. BTW, I would suspect that initrd_below_start_ok being 1 is not okay for most arches. I'm not sure how that would work. min_low_pfn is typically based on the start of memory. arm64 is not even setting it. Rob > -- > Florian