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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 95F6AC4741F for ; Wed, 4 Nov 2020 23:28:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E79C20825 for ; Wed, 4 Nov 2020 23:28:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="job0xAvO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732765AbgKDX2H (ORCPT ); Wed, 4 Nov 2020 18:28:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732738AbgKDX1N (ORCPT ); Wed, 4 Nov 2020 18:27:13 -0500 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB252C0613D2 for ; Wed, 4 Nov 2020 15:27:12 -0800 (PST) Received: by mail-yb1-xb44.google.com with SMTP id k138so351124ybk.6 for ; Wed, 04 Nov 2020 15:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YQrtMynYNNBwA8qq+ZyFclPN8/NJmA2N+Z24IBupICg=; b=job0xAvOoHrj/Gs5xydhQoDZ95FGoulUAPl0tsZzub/IjydlL0DoXac6xuDafHxiMj xbBzqUnzi/vrC9cvqHGiVDXhvkEfnBSdcCVRBwbGLlqTzeCWvmIGhvFE3NDFaN0yX3WE 23BS1Wjxm01fz7J/FHedupmqAGLiFUlKaZhtLBUwBqX10IbngZnGDxm0W536+o9I+Ybu Bybkimi5p5LvRkr7TwkbymtB57gSlEuyapz2EthlZodsWm1qMn03FTE0T9JQ3sGNWkMC /rawXIbTFGM1G98+nQ4hwIXNOHKBxr+VxkfBUAu8mr6kZlUMgmELFj44XQeZdmeuBTqt vhFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YQrtMynYNNBwA8qq+ZyFclPN8/NJmA2N+Z24IBupICg=; b=Lc3KIGpGf3/OJ4mG7dawnZQDrMNxzE3Bez4EkHDuCrCa49XaM3rud29k4/E2VW410o To/3htdwYqXZNFG77uS7i7vNbKwL1fy4nk7xGh2SA+Bw+iDWj3cWwOoH9UbIvpoNsX0H DfD9yUh1iIzBsaXbSr98Z4AwaM8oEuVkp/MlUezaD/wzBM2Getg4h8Bk/f+8t04M/Lgz ryKg4vxjXWc4kFRkiYut21YwfXd+PW9dTSwinwdYCUE09esQKSdZlCMOTPFYZRzxrpHT 3r7TiuUrczAoADWxKtM53hz4sV1UfIQydmC9bwgL07U9cEfsC0KyEdsN3aijXUoZrGz8 CRPg== X-Gm-Message-State: AOAM532mnDmgKRwxRDDRbJ7XztIBscu73tpu9H36doQwesOAqOn2BCCp iO09XWHVbIpuFlkFWfRUXO6AV5gX1Xz3BGBH3pAplA== X-Google-Smtp-Source: ABdhPJyNbMhviT+FJksEuqeKYfy5J/iGJkuVO0TewBoC8SzBUDNxl7f+pTldy3QpUzrxbBlDMcuRt52i3FHGGQ8bYBM= X-Received: by 2002:a25:7452:: with SMTP id p79mr310777ybc.346.1604532432071; Wed, 04 Nov 2020 15:27:12 -0800 (PST) MIME-Version: 1.0 References: <20201104232356.4038506-1-saravanak@google.com> In-Reply-To: <20201104232356.4038506-1-saravanak@google.com> From: Saravana Kannan Date: Wed, 4 Nov 2020 15:26:36 -0800 Message-ID: Subject: Re: [PATCH v1 00/18] Refactor fw_devlink to significantly improve boot time To: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Ard Biesheuvel , Rob Herring , Frank Rowand , Marc Zyngier , Thomas Gleixner Cc: Tomi Valkeinen , Laurent Pinchart , Grygorii Strashko , Android Kernel Team , ACPI Devel Maling List , LKML , linux-efi , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wed, Nov 4, 2020 at 3:23 PM Saravana Kannan wrote: > > The current implementation of fw_devlink is very inefficient because it > tries to get away without creating fwnode links in the name of saving > memory usage. Past attempts to optimize runtime at the cost of memory > usage were blocked with request for data showing that the optimization > made significant improvement for real world scenarios. > > We have those scenarios now. There have been several reports of boot > time increase in the order of seconds in this thread [1]. Several OEMs > and SoC manufacturers have also privately reported significant > (350-400ms) increase in boot time due to all the parsing done by > fw_devlink. > > So this patch series refactors fw_devlink to be more efficient. The key > difference now is the addition of support for fwnode links -- just a few > simple APIs. This also allows most of the code to be moved out of > firmware specific (DT mostly) code into driver core. > > This brings the following benefits: > - Instead of parsing the device tree multiple times (complexity was > close to O(N^3) where N in the number of properties) during bootup, > fw_devlink parses each fwnode node/property only once and creates > fwnode links. The rest of the fw_devlink code then just looks at these > fwnode links to do rest of the work. > > - Makes it much easier to debug probe issue due to fw_devlink in the > future. fw_devlink=on blocks the probing of devices if they depend on > a device that hasn't been added yet. With this refactor, it'll be very > easy to tell what that device is because we now have a reference to > the fwnode of the device. > > - Much easier to add fw_devlink support to ACPI and other firmware > types. A refactor to move the common bits from DT specific code to > driver core was in my TODO list as a prerequisite to adding ACPI > support to fw_devlink. This series gets that done. > > Tomi/Laurent/Grygorii, > > If you can test this series, that'd be great! > > Thanks, > Saravana > > [1] - https://lore.kernel.org/linux-pm/CAGETcx-aiW251dhEXT1GNb9bi6YcX8W=jLBrro5CnPuEjGL09g@mail.gmail.com/ Forgot the update this link in the cover letter. Here's a much better link to the thread that discusses boot time regression: https://lore.kernel.org/linux-omap/ea02f57e-871d-cd16-4418-c1da4bbc4696@ti.com/ -Saravana