Message ID | 20230808225320.310926-1-sean.anderson@seco.com |
---|---|
State | Not Applicable |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=seco.com header.i=@seco.com header.a=rsa-sha256 header.s=selector1 header.b=O4qK0F0F; dkim=pass (2048-bit key) header.d=seco.com header.i=@seco.com header.a=rsa-sha256 header.s=selector1 header.b=O4qK0F0F; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RL7mf3txHz1yfB for <incoming@patchwork.ozlabs.org>; Wed, 9 Aug 2023 08:54:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DAFDC8683C; Wed, 9 Aug 2023 00:53:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=seco.com header.i=@seco.com header.b="O4qK0F0F"; dkim=pass (2048-bit key) header.d=seco.com header.i=@seco.com header.b="O4qK0F0F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D78E5867C3; Wed, 9 Aug 2023 00:53:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20627.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::627]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CA835867A8 for <u-boot@lists.denx.de>; Wed, 9 Aug 2023 00:53:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sean.anderson@seco.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h6fu0AlYlG1Dsu4zqp8IA+8S7qVFne7flSe/G4BepRQ=; b=O4qK0F0FkbO3p3BDpPjPww3VBtQ/XkaQeMjDuA6TrSjILoZQOVKqIEbsYnY9Yx61Gr8nmXJIxYBe5kUcNUn96Bu1N8zrfGys701AQANvSXEjBEz4DUhHqhNYwiFVeB+h2f1N2nrmVnwwgtqoD2jPVjR/bAvcG/BPnrNBb4rDzXgdygxaCJC0KmMXCi2yHbzxM5YdOSY/Afa73+keKhhP6I3/p9K7GQzLSqFxRrc3alN4unLBRXEVGzEy1JjSmpW0t8AIPou9pSUzVmMwvSm2m46IBEniGMDkth/7gd3yePyA4xtGU3qn1xzmbM1EHmCW75kDLphHoHoO5m9g7y+p2w== Received: from FR0P281CA0100.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::6) by PAXPR03MB7746.eurprd03.prod.outlook.com (2603:10a6:102:208::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Tue, 8 Aug 2023 22:53:46 +0000 Received: from VI1EUR05FT048.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:a9:cafe::d1) by FR0P281CA0100.outlook.office365.com (2603:10a6:d10:a9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.16 via Frontend Transport; Tue, 8 Aug 2023 22:53:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.160.56.87) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.87 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.87; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.87) by VI1EUR05FT048.mail.protection.outlook.com (10.233.243.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.18 via Frontend Transport; Tue, 8 Aug 2023 22:53:44 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 4D8972008009F; Tue, 8 Aug 2023 22:53:44 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [104.47.14.59]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 728C52008006F; Tue, 8 Aug 2023 22:53:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=diB3QvenR6d6GuWR4QYvr8E6m3GMd3Z37RtbUkBDJmlpLcYY3u+mulXG+hv9LJvtDb/r1qMgf3VEvv1uZwCPnE98G2M2VWHOHeo7P+n98W+Rho68l2hSo5IoVoBOpcoKtWK+yvcMThgEwwCbmIyLc5OeiZmWwt1FrFYuLLLvKnCCDOLhczr1sfP8Wzb4JZp7QsiX3e7oWU97/2DpG0U+1k+cpobHyqOIeVaVfG40bhZlR+l19cbsIrz2YJk2GyES5Jtv21PY8JJLq6zm+orH7V2LNVAVhPiJKcmSubTk/rHWcYDpZsTee/KlGqOQz4Bv+d1GhvQafx5PyIWaqOPnkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h6fu0AlYlG1Dsu4zqp8IA+8S7qVFne7flSe/G4BepRQ=; b=R1PMxSrcUkWLWmoihD8lMPqd3eAPq9SbNsN115KfVGtU9c92BriT2HyPiY5KMGrCXvf2Nt4yfnkgMOGPm96wXRlUrccPTznc4H/EjDkNvmz8d4m7mNMGyabZmDwxRJzNmpFYl4EalN4fBA7EJTtIEVMONg6QooAPD1RPzkWtqJFFzDTBwWaAt/wroX7juupwIdzbOfSRb0giyBlY0dnqQyjohsCBK420jGDnub+Tu5JScsbkm+QrgW1jCTDmdQCk5psCz82hRuRzIzBdwRW80krafK7j+q0qLX3sn8ii7Hb7y3SbUbZaXmdf3/pF4S/OE25BtYtpE12SwQkzT2QXqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h6fu0AlYlG1Dsu4zqp8IA+8S7qVFne7flSe/G4BepRQ=; b=O4qK0F0FkbO3p3BDpPjPww3VBtQ/XkaQeMjDuA6TrSjILoZQOVKqIEbsYnY9Yx61Gr8nmXJIxYBe5kUcNUn96Bu1N8zrfGys701AQANvSXEjBEz4DUhHqhNYwiFVeB+h2f1N2nrmVnwwgtqoD2jPVjR/bAvcG/BPnrNBb4rDzXgdygxaCJC0KmMXCi2yHbzxM5YdOSY/Afa73+keKhhP6I3/p9K7GQzLSqFxRrc3alN4unLBRXEVGzEy1JjSmpW0t8AIPou9pSUzVmMwvSm2m46IBEniGMDkth/7gd3yePyA4xtGU3qn1xzmbM1EHmCW75kDLphHoHoO5m9g7y+p2w== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by PR3PR03MB6634.eurprd03.prod.outlook.com (2603:10a6:102:7d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Tue, 8 Aug 2023 22:53:33 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::65d7:d7d8:711b:2514]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::65d7:d7d8:711b:2514%5]) with mapi id 15.20.6652.025; Tue, 8 Aug 2023 22:53:32 +0000 From: Sean Anderson <sean.anderson@seco.com> To: Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de Cc: Simon Glass <sjg@chromium.org>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Sean Anderson <sean.anderson@seco.com> Subject: [PATCH v2 0/4] malloc: Reduce size by initializing data at runtime Date: Tue, 8 Aug 2023 18:53:16 -0400 Message-Id: <20230808225320.310926-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MN2PR05CA0036.namprd05.prod.outlook.com (2603:10b6:208:c0::49) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|PR3PR03MB6634:EE_|VI1EUR05FT048:EE_|PAXPR03MB7746:EE_ X-MS-Office365-Filtering-Correlation-Id: 28be14da-6074-42e0-f83c-08db986251a0 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: YXHGSB5KD93Hj8uKXc1/Bn6YIIL5PLbRkUvRNLAwCB42EsVsUFp14/b5oQmsqk+JFvdhik5vWsA+3XsPqYAmB2/Q9eWz8D2RS8RQ44S0rxDnBaaS2srclocGKwnlqfmYYy3q3eog3fZ87J6Kbq6myJ8hVkXL5VezDsebaxERd3qoIWMFKqR+qAYWduY6eggAV7jC1QiCg4QkmE63tB892zTJgnNcsVkN6dDJK/B8BAFP0SNFO55q4SBhSjCWBUoPfR4saOQaX7km7XTKNESJmXyDe/n5HUKHqr5ER3fb2Fjja45DZpOASpvaQWqLkbO/MW1jlW5Gfrkld9SEO6vzAYHUGOGz61sh+96lAg6pwShbkLZ03znpfJ4squ4wx+oFKalwN6LkLBQoHXQ75m58P01Dfsv9n10liGO/U5LHAqHHEbaY6zfsJYm2ERAcQ8R3L0Jc3rHSDyA0HbLHGHRskpxP9/djWUZ+/mak7IGp5mXuVH+qOPiIVF5Z6zT0m/4lmwc1upUpwGJ24JS6kgTXHM8KsxV8X1P8p9u9q8I3cC3LVGq1s4dTsTRsyoM/7kfRHNtshsbzKRkrg1ZIhLo1LRmGwuVFhzpo/fWWSWnuDvfELKDtpEXz0vEU5B0ijlZu X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR03MB8847.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(366004)(39850400004)(396003)(136003)(376002)(186006)(1800799006)(451199021)(2616005)(36756003)(1076003)(26005)(52116002)(6506007)(107886003)(6486002)(6512007)(6666004)(478600001)(38350700002)(38100700002)(54906003)(66476007)(66946007)(66556008)(4326008)(316002)(41300700001)(8936002)(5660300002)(44832011)(8676002)(2906002)(83380400001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR03MB6634 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT048.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d331a9d9-82c3-461b-d446-08db98624a46 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pTP7sZzAV+125/i32QPr0HEJnGSJUEYfXv2AAV5y77i5aTRwt5VAclPZOSGCn6pC6kflw0qVfOVvPeG3baPNJf86wr1obBPzLVwT17n05nY8GV0vnhLejHaujcPZEzr9OQiw5c7CTGMG3PIeibiNNArN0+FiWpZzSAu0TvYM7v/kxs4AaMN5CMD/WAaaMYs9g/2KrZHXLJXDuOGzk2LGlqAwfeA4VVAFqmX8RPsIb/9a38llHPszbXSCHLn5sK7Q1QuVhO2g0GfL3jDhwTFX3QofWmOq7fjnpH4T6DvZkUgPE2Rcl8oDX8ZkCV8Y4BHn7rP35BnBiF5UkmJs8gSHm2uKJtLvhR63+LhjyGuLWayf6s7W/rh96PJ3Q4y/UaE1Evrvcno7CKnB6eAhVFdQchMH1S1HirEnhLG2nUn1nkJjvPbLkNyP1XC6JDz2Wi9SStHEIMVNU6uVhMgVuZTOVMiSP8wDZEVwPSovJHfbhSDNRtBJr9D9S8HQvVKe/ScItkhlOMBmCQcAkZTwmGSak8BNsJpFKIhaOKpBSFoCKDfMESuV5boUhzspbx5jwImznXZFHvwIaOtmSkkprI4PT1zKC63hEfkX8oDN5HyjESMuyU+qPHy2hCx4AzgOxRpFKA0y+aOzFoplqN1wW+ioF9gi8gvVkt1GNbcMQEfw7XSH1OAlpiCulnFsCQnZgqBYk3VvsR31p9GZOaPA43pV2DWhFq45Y6NUZc38jFsAqtyOkg8wShe1530LkmFBPDQeo2YSehlTYHCl77mKcraKOA== X-Forefront-Antispam-Report: CIP:20.160.56.87; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(136003)(346002)(39850400004)(376002)(396003)(451199021)(186006)(1800799006)(82310400008)(46966006)(40470700004)(36840700001)(47076005)(7596003)(83380400001)(2906002)(2616005)(5660300002)(36756003)(36860700001)(54906003)(6666004)(6486002)(70206006)(356005)(6512007)(4326008)(82740400003)(316002)(70586007)(40480700001)(41300700001)(86362001)(7636003)(44832011)(107886003)(40460700003)(8676002)(8936002)(26005)(1076003)(6506007)(336012)(478600001)(34070700002); DIR:OUT; SFP:1101; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 22:53:44.5996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28be14da-6074-42e0-f83c-08db986251a0 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733; Ip=[20.160.56.87]; Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT048.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR03MB7746 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
diff --git a/common/board_r.c b/common/board_r.c index 58a5986aa54..ca624b20d46 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -194,6 +194,7 @@ static int initr_barrier(void) return 0; } +static ulong malloc_begin, malloc_end; static int initr_malloc(void) { ulong malloc_start; @@ -208,8 +209,10 @@ static int initr_malloc(void) * reserve_noncached(). */ malloc_start = gd->relocaddr - TOTAL_MALLOC_LEN; + malloc_begin = timer_get_boot_us(); mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN), TOTAL_MALLOC_LEN); + malloc_end = timer_get_boot_us(); gd->flags |= GD_FLG_FULL_MALLOC_INIT; return 0; } @@ -570,6 +573,8 @@ static int dm_announce(void) static int run_main_loop(void) { + printf("malloc_init took %luus (%lu %lu)\n", malloc_end - malloc_begin, + malloc_begin, malloc_end); #ifdef CONFIG_SANDBOX sandbox_main_loop_init(); #endif diff --git a/common/spl/spl.c b/common/spl/spl.c index d74acec10b5..b34d1f4b4e6 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -755,7 +755,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) spl_set_bd(); #if defined(CONFIG_SYS_SPL_MALLOC) + ulong malloc_begin = timer_get_boot_us(); mem_malloc_init(SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE); + ulong malloc_end = timer_get_boot_us(); gd->flags |= GD_FLG_FULL_MALLOC_INIT; #endif if (!(gd->flags & GD_FLG_SPL_INIT)) { @@ -817,6 +819,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2) spl_image.boot_device = BOOT_DEVICE_NONE; board_boot_order(spl_boot_list); + printf("malloc_init took %luus (%lu %lu)\n", malloc_end - malloc_begin, + malloc_begin, malloc_end); ret = boot_from_devices(&spl_image, spl_boot_list, ARRAY_SIZE(spl_boot_list)); if (ret) {