Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7687083imu; Tue, 22 Jan 2019 09:53:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN5K9QRZQbf8UWRHSqhMOY6BaYmFWS55VZfjFhrrRKtdL7+AYTDwBE1B+X5znlK12nnOqJSQ X-Received: by 2002:a62:1e45:: with SMTP id e66mr34032106pfe.152.1548179585171; Tue, 22 Jan 2019 09:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548179585; cv=none; d=google.com; s=arc-20160816; b=UAm4Jz6ARcSK2/IQPhiV6YXPIIH+GwkrZTXzIn31dLeKdtTSc3AfHlSVwTZn3sFsX+ qN9HdUaB18ODi/gjecfyvlA0XkHGcds/FzTs2dubZIzLWxENufWsDWhboLns2PGnWtnf JoX1HEINfUqdyqM8U2x+1CcREGxTf9uFYpT0Z5M7MSC6/3jxIZ4kGtcQW9pWrCxR+r5t ktH2JtCbnEQhd9cq8YaaqIM21OBaO5mQrmgdr1FJDKlTi+KcEWyiiX29mPoAVfX2JtdS 5AQvbqBZrMCFyhwz2dHgNmqLHjzFEuhYPxdNSXCo6bDrqBfyjN8qP9ApMaJUCPNphH0k 4Aig== 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=J0lWivIqJSWPLJEIUEj0z08uyJuPVVlNV6NSc61Yen0=; b=pAGFdVbtYt4ykzFOb/uQVsZQzwxoWrU7Be8d02Q8BNIwHtLNnurnzsEDhASti17YaS yIoYJgJwrPRVy6uieS09wKsTnPat+xSnNd9mr9Ha84rm4bvgQjIqZY1ZxrhpPDTx6iRY fMkJ2MYfZ+rb7ye0KrJ/0LBDooBva0znxdUF6myFPdIx14IdcRu8XXpEjUi18cKdOZeH M3E9ehoIyV8VBsEsGyPXdQprp9ROjFJVoY6tlCShhTHyWnvmMLanOCsdC8YuDVBJ2fDj AjvZXcYS4bu61ipQfhqtpYsSA/l3/YTG4A4oATRwBVTPDRt6XOH0ACHB1YKoViZa9bYb 3L/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jvtpsnKN; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si17506361pgf.521.2019.01.22.09.52.48; Tue, 22 Jan 2019 09:53:05 -0800 (PST) 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=@chromium.org header.s=google header.b=jvtpsnKN; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbfAVRuo (ORCPT + 99 others); Tue, 22 Jan 2019 12:50:44 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42529 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbfAVRuo (ORCPT ); Tue, 22 Jan 2019 12:50:44 -0500 Received: by mail-pg1-f195.google.com with SMTP id d72so11382004pga.9 for ; Tue, 22 Jan 2019 09:50:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=J0lWivIqJSWPLJEIUEj0z08uyJuPVVlNV6NSc61Yen0=; b=jvtpsnKNpO1tYovFfMhDqz4FL2D8L3fYoEOkTadwHPmhkRiyhuBB6gC8qsIaq+WHRd Gr9Elf+M4jSvpb9eR+hYuoO9hIOL3n0tpk7poSeVu6jMtKe96JRqaRE/L00uhmQzYbfH nnrn/qO0Xi6UHGHUWdJmmsDO6mzC0DepC5nKk= 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=J0lWivIqJSWPLJEIUEj0z08uyJuPVVlNV6NSc61Yen0=; b=GjDVKhjIUXSfBXIEbvyyu/dvnc0WO8NwQrZv9dzPxYmnCXCv+1SALelMWXuZTxdbLN HRMhuufK0SZXCwqul18a8derQAH4+Z7cs8nQ7IoQ9VwPPX5TpfmDVboQatOsLo9EOGyc hg7PFW/ZIqft8S+Ruk+tWFD5fCYZCohZR+zJ8RsgJERK3esouKOuiBdhQnZ6s46J2BzH FO/QdD+tRUwXDaD+uEp8EjuriSOZ6y2xv/9/Rdfqvt3tz2D/USMo+uiUOuPsTqiAO3q8 8IayzqziprtgtNnBR9ngmgzhETmdLhooq66P6AZ9Z7Es/2baS9TeTUQJDb98sZrBa0BS krYw== X-Gm-Message-State: AJcUukdYI9vdAlpMJSB7O9auTG8QRoBFUjoBRcyaWIuBG5ObtIoHhlSc bA/EqkXGvTR7BdDrnDX2RPoXOA== X-Received: by 2002:a63:d604:: with SMTP id q4mr32492081pgg.175.1548179443509; Tue, 22 Jan 2019 09:50:43 -0800 (PST) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id u69sm28069187pfj.116.2019.01.22.09.50.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 09:50:42 -0800 (PST) Date: Tue, 22 Jan 2019 09:50:42 -0800 From: Matthias Kaehlcke To: Viresh Kumar Cc: Rafael Wysocki , Greg Kroah-Hartman , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] drivers: base: Add frequency constraint infrastructure Message-ID: <20190122175042.GE261387@google.com> References: <20190118010305.GX261387@google.com> <20190118100234.kq37hc4ldujqvvrb@vireshk-i7> <20190118224534.GC261387@google.com> <20190122070936.jsjvivzplfpdweck@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190122070936.jsjvivzplfpdweck@vireshk-i7> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 12:39:36PM +0530, Viresh Kumar wrote: > On 18-01-19, 14:45, Matthias Kaehlcke wrote: > > On Fri, Jan 18, 2019 at 03:32:34PM +0530, Viresh Kumar wrote: > > > On 17-01-19, 17:03, Matthias Kaehlcke wrote: > > > > On Fri, Jan 11, 2019 at 02:48:34PM +0530, Viresh Kumar wrote: > > > > > +static void fcs_update(struct freq_constraints *fcs, struct freq_pair *freq, > > > > > + enum fc_event event) > > > > > +{ > > > > > + mutex_lock(&fcs->lock); > > > > > + > > > > > + if (_fcs_update(fcs, freq, event)) { > > > > > + if (fcs->callback) > > > > > + schedule_work(&fcs->work); > > > > > > > > IIUC the constraints aren't applied until the callback is executed. I > > > > wonder if a dedicated workqueue should be used instead of the system > > > > one, to avoid longer delays from other kernel entities that might > > > > 'misbehave'. Especially for thermal constraints we want a quick > > > > response. > > > > > > I thought the system workqueue should be fast enough, it contains > > > multiple threads which can all run in parallel and service this work. > > > > Ok, I was still stuck at the old one thread per CPU model, where a > > slow work would block other items in the same workqueue until it > > finishes execution. After reading a bit through > > Documentation/core-api/workqueue.rst I agree that a system workqueue > > is probably fast enough. It might be warranted though to use > > system_highpri_wq here. > > Is this really that high priority stuff ? I am not sure. In terms of thermal it could be. But then again, thermal throttling is driven by input from thermal sensors, which often are polled with periods >= 100 ms rather than being interrupt driven, so the type of workqueue wouldn't make a major difference here. I now think it should be fine to use the normal workqueue unless problems are reported.