Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1104973pxb; Fri, 6 Nov 2020 00:41:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7ucvVvouU+1dahD5KGa4K9RgOE9RpBbgAndrnSYEc/qaVuaUrd0Q7bqbKEuhTfOv3Wv4s X-Received: by 2002:a50:b062:: with SMTP id i89mr912099edd.248.1604652063596; Fri, 06 Nov 2020 00:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604652063; cv=none; d=google.com; s=arc-20160816; b=jbR83B/dbJFe1gVmG1FzbGIOR4FE5J3tMnbUA5XJhnbpiu3FXmruUHzNWUuVJJQNv7 nFAEIr9GwM1cbGqzo6ExcbfuQr3D//qv/9SHc11lV9+KQpIfc03rPOnSW+pxJOZwSnEh cI6UKRW3R4nbCFPQ5RIZHDUBTlWdR//DrN5j1wvs73sIN0nXOfQwomdrgDDLsBNcUxtE 67pGGBG86Mi1prHPXkqXP/OxeoOA+nD9+hAWjLQ1AlEveWuWwclKTkYeuD/fHEZpUCnr pb4d8H407nu+8lGqUEf2lx9WI1XT4k8wNOi/26VNUWTtWvRyQMFtX8ABnXdbaQcKoBdY HuPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qEZLCwayVmjTSz55WLFDrASQyKwm9AzKbv8zrefCiDk=; b=lNOLlnCC0cbZrRaOD+5xJIMEaPRiBfoGYmuW8C83d9eY6JMNWnPh8dMb9pzX3m/dIF sIIH0O6Ws4QnawQFV78zeNq/z3JAVVC2EqzT+PqjGirEsT5PSkvA/77iSfmMZRdXLRJf R6KqJiaY+L/x90g4uw1QeAtciQ7NvICCvh4vzi02cCCtlwq4j+KZDbjqZpoycm0/o3c2 YyvEsgPGKkyg7zFkrReMcxdY77oLGTibg6XmOMUVxNM8wJelIce3RHd+Tv9d9HFDoX61 5k28M9ft/XMJ1wv3lbd5xxVvbY8s0Zi+z4T39O/QQ8WXNArQjgK5I3iReO9QpIknWgXF 7RYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Ji/jXL4w"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si356632ejx.648.2020.11.06.00.40.40; Fri, 06 Nov 2020 00:41:03 -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=@google.com header.s=20161025 header.b="Ji/jXL4w"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbgKFIgq (ORCPT + 99 others); Fri, 6 Nov 2020 03:36:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgKFIgp (ORCPT ); Fri, 6 Nov 2020 03:36:45 -0500 Received: from mail-yb1-xb41.google.com (mail-yb1-xb41.google.com [IPv6:2607:f8b0:4864:20::b41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A042C0613D2 for ; Fri, 6 Nov 2020 00:36:45 -0800 (PST) Received: by mail-yb1-xb41.google.com with SMTP id b138so474154yba.5 for ; Fri, 06 Nov 2020 00:36:45 -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=qEZLCwayVmjTSz55WLFDrASQyKwm9AzKbv8zrefCiDk=; b=Ji/jXL4wApkUI69Y5av8UFEa6ZvMG8Mm7sMdeBuZf7EoU4V1ZJLIvyslti7xbYYgOo 7sI5169sAiOnVjscRjwLSG5mTCDgJbsvvoyW7NaM+rXP+TANNYM9GzJTJeHzh5IJBSn6 jCu4ranqabbyvqfRRUp8VUmP12hOGnUWANJ2MHUcQuqSD+QuRogFeUpnHgYeTln5Ymb2 IxW851j1Otp0qXE2KbajHox2eLThi38VBbZU7+cZkmlqcN1NRpsNCkHTGxZofwDuILfd YJVqD/sCpYRPLK+Qa+6GsSNblgKHxW6x/FkEn9nScueY9kHi8mFdGrFX2iHrBlCcY0aX 0Zzg== 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=qEZLCwayVmjTSz55WLFDrASQyKwm9AzKbv8zrefCiDk=; b=UWqosGShPi3/RIprXl1Lbx84WaAajDhofXVGPIHe6sxy/ndCcTV9PI9ZjzBzsVTErw bspF/3Q3d6TqniaDDyXA8HSfWWKX2vBww8O9wUpuGxcO9g7GKfx2iuyxLXADgqmMwzLL qVccRPokJ+LoTJPgpkvJk5XIXRUFyQ9WY6MmQ9dTr+c3vtFdoJY2cgDA0pi765r+32sN tuMqUCYGqZlY+2jKS9Meds65HG7gz4+uQdxiN7AxujQ40yLm3rf3pmKahXFXm8PiVTrb 2mEsA/nqna5WbBsul6AO3qo/N5TGECAKS6BWER5iQY9QOKEZlX5HTCue+QCtP18l99Yx oauw== X-Gm-Message-State: AOAM531wqe0ARBgDExIULFHgT6nKdAR+721yIMvFcqv6g//qbQmOE271 IYSUTRRFhV+8dVWc9Ims2xVrmrekxSQpHIr+lIXseg== X-Received: by 2002:a25:d2c5:: with SMTP id j188mr1358442ybg.32.1604651804489; Fri, 06 Nov 2020 00:36:44 -0800 (PST) MIME-Version: 1.0 References: <20201104232356.4038506-1-saravanak@google.com> <20201106050940.GG16469@pendragon.ideasonboard.com> In-Reply-To: <20201106050940.GG16469@pendragon.ideasonboard.com> From: Saravana Kannan Date: Fri, 6 Nov 2020 00:36:08 -0800 Message-ID: Subject: Re: [PATCH v1 00/18] Refactor fw_devlink to significantly improve boot time To: Laurent Pinchart Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Ard Biesheuvel , Rob Herring , Frank Rowand , Marc Zyngier , Thomas Gleixner , Tomi Valkeinen , 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-kernel@vger.kernel.org On Thu, Nov 5, 2020 at 9:09 PM Laurent Pinchart wrote: > > Hi Saravana, > > Thank you for working on this ! > > On Wed, Nov 04, 2020 at 03:23:37PM -0800, 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! > > I gave it a try, rebasing my branch from v5.9 to v5.10-rc2 first. On > v5.10-rc2 the kernel dies when booting due to a deadlock (reported by > lockdep, so hopefully not too hard to debug). *sigh*. Fortunately, it > dies after the fw_devlink initialization, so I can still report results. Phew! For a sec I thought you said fw_devlink was causing a deadlock. > > Before your series: > > [ 0.743065] cpuidle: using governor menu > [ 13.350259] No ATAGs? > > With your series applied: > > [ 0.722670] cpuidle: using governor menu > [ 1.135859] No ATAGs? > > That's a very clear improvement :-) Thanks for testing. Great to hear it's helping! > Tested-by: Laurent Pinchart I'll add it to my v2 series. -Saravana