Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10421720ybi; Wed, 24 Jul 2019 22:56:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4wD10Gla+hBQ/rbXQ6jHEmwVt2bvorFjvombqXmaza3g38ge8vuJu4z0JAThDxyWH5+av X-Received: by 2002:a17:90a:3463:: with SMTP id o90mr93163346pjb.15.1564034186733; Wed, 24 Jul 2019 22:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034186; cv=none; d=google.com; s=arc-20160816; b=FSBy6/HYRnCrJv8iieMqpElckUN3TQ6fuqh+wrw01nHLKUsPff3BuC2vZGq79SPX3T fSC7U3GoPdeTDYBwzFQfRzCnDB1XpQ+zrsEIkHLZ29hMKG7RdIi6fZEEEyUIU+N5fkT8 sB6nBnsry0MYir1pcf2QcYwfIczV6UTFAB/gZHRPEdRnZRNIPzZW4ORs5xvBe/lx0TnP y5hZDRFvy2NnHoWtBft0oT6iuR2t/tRpJ06HG0YFnLXbp4XoTRnn78vuf1lzGgEvElqR Fr1EyEZAnOGpZGhMMY/0tV54QVEfUsTxBSnAouxDAGbqX14C5SE6GaEeb8yorzfF3Wyt 0jLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/u83+hQ1QJSZQhZrXmEUjb2K6ijc3Xy3tbFtshDxhfA=; b=jq+aYjDaHxzPAXyRg6XLRQjKcjyOucNo0m0vUADpaHM/S0kQortHPYH/kPRlbYqR/b q14YJSF4wlik2JRgorAh33W0xrm7RO8geszQvt74B46Xq/9hu4DcilnJt9hm4Ac5/C1c ekGiIMl5WnjKBXZ8tt1PWd6IjEoHSRoMp8eQVJoYvXz5VDa0UR2psuI/MF3zvV4rNDdr ub2hYeWSa0vfmBcmdqkltjK0BDo2DmXByh/JPdj//UGEu32y5CuMesb2SWQEkDXG2wWc QFxN120BUgsv+0dpraBeilYSt0A+Gl8BEROguv2lgzKkfhOG5iGlLIuw1PO1XrISwJA/ Bs8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLPjA6eb; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si15992738pli.12.2019.07.24.22.56.12; Wed, 24 Jul 2019 22:56:26 -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=@linaro.org header.s=google header.b=DLPjA6eb; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390514AbfGYFRr (ORCPT + 99 others); Thu, 25 Jul 2019 01:17:47 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42793 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390368AbfGYFRr (ORCPT ); Thu, 25 Jul 2019 01:17:47 -0400 Received: by mail-pg1-f196.google.com with SMTP id t132so22371714pgb.9 for ; Wed, 24 Jul 2019 22:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/u83+hQ1QJSZQhZrXmEUjb2K6ijc3Xy3tbFtshDxhfA=; b=DLPjA6ebSqQMnWFq4JJNbgskYTCbvMXOTpeb8SzA8dD4lhEAgVdGspxIw+UuL7XB8h Gv4P7+W73rim2Ym3ir6uigy++MwBE7jbkrV+NBR0y87WvSD8U9kKhEZCh7kngp+1mzoj GZXUawj94hGsKbTlIbluVoxHyEigED8f5YqicUEqymMAO/V2uMTGGTDrLusi4YjnEb85 8iGdPO6D9jhR9M5yCZ1AK5Lnw2YT6ti5IUvLqL7JwX7xlv/HWIEFJpuOqk1LNDlXq9w7 BqJMbrNM5/+c+kNO7xfx9wIkPkoybKFjTYoCW7g2pIbEbA8JALpEZjFLLk486+T0gBb/ wrYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/u83+hQ1QJSZQhZrXmEUjb2K6ijc3Xy3tbFtshDxhfA=; b=sWxrrgeFg3XROm2mnp74Rmq80FTnb7fxZzvthC60WVNGR8jjLvvkURp8deJxmdVVZ+ Xe0ShbY8h00rsZQzXOtv2OWt0emaZb+5cUg8tvuD/BeCs6XETcG+gdL3W0jUuXluHf+M Qd+9zKt3u7Brq6cjk7fXggkCLQIzh4WlkV6khwNzExjUaJ8i5VWRrpJcmMhvuJOSpLlq bd3+RJf0N2OMyQZHxDiF+RfTvjGInTOsXxPNrEGu48uWOAxlCfS9fCQbT6WV7oEK04VF EF9cMSeF0oaUdoZIznIHEJRpD9ZkpgDDVMzTixIQ9nBI+mhhOrq0iZD74PUdkP2h0MP9 0TFA== X-Gm-Message-State: APjAAAVBsh1w5zek8GEnpOo7nfNJYWMS0GGfwrh6BjPTwkviOWwrX3Da mDK1K8FnSy8Oefy7CZylEOyJkg== X-Received: by 2002:aa7:8b55:: with SMTP id i21mr14861350pfd.155.1564031866108; Wed, 24 Jul 2019 22:17:46 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id b37sm77297543pjc.15.2019.07.24.22.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 22:17:44 -0700 (PDT) Date: Thu, 25 Jul 2019 10:47:42 +0530 From: Viresh Kumar To: Saravana Kannan Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Sibi Sankar , Android Kernel Team , Linux PM , LKML Subject: Re: [PATCH v3 3/5] OPP: Improve require-opps linking Message-ID: <20190725051742.mn54pi722txkpddg@vireshk-i7> References: <20190717222340.137578-1-saravanak@google.com> <20190717222340.137578-4-saravanak@google.com> <20190723102842.t2s45zzylsjuccm4@vireshk-i7> <20190725030712.lx3cjogo5r7kc262@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24-07-19, 21:09, Saravana Kannan wrote: > On Wed, Jul 24, 2019 at 8:07 PM Viresh Kumar wrote: > > 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. We can see how best to optimize that, but it will be done only once while a new OPP table is created and putting stress there is the right thing to do IMO. And doing anything like that in a place like opp-set-rate is the worst one. It will be a bad choice by design if you ask me and so I am very much against that. > > 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 would like this to get fixed now in a proper way, there is no hurry for a quick fix currently. No band-aids please. > > 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. Again, opp-set-rate isn't supposed to do something like this. It shouldn't handle initializations of things, that is broken design. > 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? Running anything extra (specially some initialization stuff) in opp-set-rate is wrong as per me and as a Maintainer of the OPP core it is my responsibility to not allow such things to happen. > 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. So you want to make the cache hot with data, by running some code at a place where it is not required to be run really, and the fact that most of the data cached may not get used anyway ? And that is an improvement somehow ? -- viresh