Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10420829ybi; Wed, 24 Jul 2019 22:55:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUHWpyit/NDbY+G4vwAKDhC2vSnJr9UC08DniepZc694unv329CG9Xv6Xn/NUp4N3JX3i8 X-Received: by 2002:a17:902:f46:: with SMTP id 64mr90100499ply.235.1564034128608; Wed, 24 Jul 2019 22:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034128; cv=none; d=google.com; s=arc-20160816; b=C9Km5uPw2toeqw5GkWxXiYvPbW5ZQLIn6XEPff5yJA+9qAMlGJspyDxVmh+Q7kOoaJ 7pmyaw4beijI82RhLfZ47swKw0mkKjXgAmoUG/iZq977StuE5190JXeFDZwPakQ4RyMM kUZo0z0xAtu+UbWWYpzvITqlB9C480u1kYVz7iHXZ/Bv3zYfLYJidjZXAY1bcmzqLsJI ubuGIhd65DRzpptMhM2GpOXsmOIRJjOIiRIhw7d0FZC6wOKT7amdxQDrmhkY2H8lOb5Z vGBn0NC0ud1lzdfIHVDqRLdIHVKN9HKj4S+dqRImmGLqPONtxLUZsPQ0OkyrlwTcIbCE u7YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bvjfb2LhI+/zuz8KHMCw9FpZvOIrarX3w7sAGkpylfQ=; b=Rv6FeGb2sVhisSGNBig6d1sdplRmCTAp2AhWDJm55QnqpBQ3O+2ghnqa+7xrpxwxWd M226BvKhHAqyUV/bWFuDgkAuSEYyZgL+dZwTsKhX0E0XLTOY5Xv0yDyAUg0hO/fg2K8b S0cmI5ydR0ig/nMuEbUE1rfPlDiojed17u5mvAdqly8lA42d1ShJGL5Kzwrg+arw8TCe Z/HyEwe+ip42FEZSo+DeVSvpLrzV8cyma51WPcpvPxo5fEKr6jmF25IRLvJH41j2W0yK xFCc7+lMcZ6hfszrdwKHcNbxty1CSwFe5SfQQZ7ZORf6GBSEMut0lBUK6bq7ZZKKwNcG dhCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="bqG/SvOc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id p4si15794616pgh.350.2019.07.24.22.55.14; Wed, 24 Jul 2019 22:55:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="bqG/SvOc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1725901AbfGYEJm (ORCPT + 99 others); Thu, 25 Jul 2019 00:09:42 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:36339 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725808AbfGYEJl (ORCPT ); Thu, 25 Jul 2019 00:09:41 -0400 Received: by mail-ot1-f65.google.com with SMTP id r6so50225369oti.3 for ; Wed, 24 Jul 2019 21:09:41 -0700 (PDT) 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=bvjfb2LhI+/zuz8KHMCw9FpZvOIrarX3w7sAGkpylfQ=; b=bqG/SvOcv8Mwj5FFO+DrPMKgzVt8YVxd83tsBeTDx8qr7h/3xeBPE6QHnJ0j+vgUSF D1s9NFSpBTA6MHBCz9oMCJvY1gRrKM6xDr8BX+lZ/jbVuqlAypmKNnz+a61C4MBP+v4Y RWZItLoV6itbASo+u1lY1k94/2JQ/JGfv2h4NOs+XvCKFeZoMU0ZOwyjHywbxEM0lvSX g4a6g6tsMJwU8q78cHHaHw+K20eCPD5g0ZpcOmscX5XbUvkgLouh9L3BYcNnewm1z3hR Yixp9kHaKsqmfspUPq6kKp8JqddKAbzgVGkOI7Wq+9FcCW+1wNdA2ELQBS9dtFi6kr6u coUA== 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=bvjfb2LhI+/zuz8KHMCw9FpZvOIrarX3w7sAGkpylfQ=; b=AVmGLNGDFem5HZC0FriTQQNYOfAYJaz9n5R3zncIXsjLrhwNSAvgBK+7M+ZG9eeAEm 4pLpf/np6TwlI9gXsBZfX9PrtOD7qKd+vl20TG7tZKPTiPShrEUTTV3Q/NuyBdptUiDU mDNKu9n29U6AaZttDmM2Fp4sQBlH/nPNMoObYdTa8vDmo6ysbkd5rTraTIoJZLnVTm+E zuVe6BURz0dShvzE//q/qEorxAmJjK7kfOHuT8Higs/w3DEzWsQ32Uj4psYWaysy0/Tg 4XjxJbInlngQInShK2W0zX6WJqVTYsah6JNBHxaLJFiyWqva2gIuyMQa33ZVJ293Wn+q LYuQ== X-Gm-Message-State: APjAAAUjuTQeTduApGSZodXR/gHtNE+1GVynqbiTIAHoWsirmxVTMZjW o5HNseQcOPq5yEK2MUBY1+myo/Y1HVws1pu+tzV/DQ== X-Received: by 2002:a05:6830:12d6:: with SMTP id a22mr34587694otq.236.1564027780397; Wed, 24 Jul 2019 21:09:40 -0700 (PDT) MIME-Version: 1.0 References: <20190717222340.137578-1-saravanak@google.com> <20190717222340.137578-4-saravanak@google.com> <20190723102842.t2s45zzylsjuccm4@vireshk-i7> <20190725030712.lx3cjogo5r7kc262@vireshk-i7> In-Reply-To: <20190725030712.lx3cjogo5r7kc262@vireshk-i7> From: Saravana Kannan Date: Wed, 24 Jul 2019 21:09:04 -0700 Message-ID: Subject: Re: [PATCH v3 3/5] OPP: Improve require-opps linking To: Viresh Kumar Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Sibi Sankar , Android Kernel Team , Linux PM , LKML 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, Jul 24, 2019 at 8:07 PM Viresh Kumar wrote: > > On 23-07-19, 07:47, Saravana Kannan wrote: > > On Tue, Jul 23, 2019, 3:28 AM Viresh Kumar wrote: > > > > > $subject doesn't have correct property name. > > > > > > On 17-07-19, 15:23, Saravana Kannan wrote: > > > > Currently, the linking of required-opps fails silently if the > > > > destination OPP table hasn't been added before the source OPP table is > > > > added. This puts an unnecessary requirement that the destination table > > > > be added before the source table is added. > > > > > > > > In reality, the destination table is needed only when we try to > > > > translate from source OPP to destination OPP. So, instead of > > > > completely failing, retry linking the tables when the translation is > > > > attempted. > > > > > > > > Signed-off-by: Saravana Kannan > > > > --- > > > > drivers/opp/core.c | 32 +++++++++++----- > > > > drivers/opp/of.c | 91 ++++++++++++++++++++++------------------------ > > > > drivers/opp/opp.h | 5 +++ > > > > 3 files changed, 71 insertions(+), 57 deletions(-) > > > > > > Here is the general feedback and requirements I have: > > > > > > - We shouldn't do it from _set_required_opps() but way earlier, it > > > shouldn't affect the fast path (where we change the frequency). > > > > > > > I don't think there's any other intermediate OPP call where we can try to > > link the tables. Also if there tables are already fully linked, this is > > just checking for not NULL for a few elements in the array. > > We should be doing this whenever a new OPP table is created, and see > if someone else was waiting for this OPP table to come alive. Searching the global OPP table list seems a ton more wasteful than doing the lazy linking. I'd rather not do this. > Also we > must make sure that we do this linking only if the new OPP table has > its own required-opps links fixed, otherwise delay further. This can be done. Although even without doing that, this patch is making things better by not failing silently like it does today? Can I do this later as a separate patch set series? > > I don't think > > this is really going to allow down the fast path in anyway. > > > If you have other ideas, I'm willing to look at it. But as it is right now > > seems the best to me. > > > Even then I don't want to add these checks to those places. For the > opp-set-rate routine, add another flag to the OPP table which > indicates if we are ready to do dvfs or not and mark it true only > after the required-opps are all set. Honestly, this seems like extra memory and micro optimization without any data to back it. Show me data that checking all these table pointers is noticeably slower than what I'm doing. What's the max "required tables count" you've seen in upstream so far? I'd even argue that doing it the way I do might actually reduce the cache misses/warm the cache because those pointers are going to be searched/used right after anyway. -Saravana