Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3667777imu; Fri, 18 Jan 2019 14:49:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Di2HgO1UGHPaQQ9SAt+6v6Zs0hxUuMcpba2mTmdbQeyhLtJB2sDrlbL9jReG9CGDX7xpG X-Received: by 2002:a17:902:14e:: with SMTP id 72mr21065114plb.287.1547851750063; Fri, 18 Jan 2019 14:49:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547851750; cv=none; d=google.com; s=arc-20160816; b=XHy569VSE6DsihYZhM7praizXpbhVEkUERLN/4TRIyq85k6zfTxGDpOlr6F5MDYqLJ jEdKgF0Ev1zq2zmgl2Mr6LtPX9/HnHUs1xpgLQFLzFDrVtZQRvaLPH2PG4+cETsSkcDy 2hSY5lG2RFy0zHDYP5WZ1pME8s8T+pn8Jm7TbxHomYrCIbxIzRDU2AjMvQR+cPOKh8sv iMRvp8SK4/8Hnkf1Bdy7XPJehD+Fo28DtGmXByYzpPQnAatwlzEVrVZMLA5PA4M2VL1x JvHbwmqXzS8f6kAAIA01zSlf/oFwrC73Qp1ARazI/NRiwgO5CgMNoDhz8aSvE0p5P7ww H9bA== 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=vE+GFFAs0SL0g7lQx5BpIQpFtFj61cY+qRhW080jkkA=; b=TowYI2P5Rs7KGmWrifXRt015XvsBf+0J29BSFljPqF16jlOsTAgPSncsg/LF/q6I2o SwF1wpxv0tz7nOwKP7sJQ22M65Eicj3zvI4LyIbxBMthJx7kOoXCb/nEtFELPpku2E/v NzJsWS+2Q0qNys1HsKjpC2SK3zGRBpoqrAYnxm3bJLb6cHz1HmM3tcbQ3L541vP3ELXY cutr9OVOuI6AuKwBt4GRe4gsEq357nQJaSKBBXFC92HAT2oA6xAxRZkrWEfQrUzfTkBK NmFyu6rHrHxqtqdD7+dnA0Hd5Dpv51MX2ls3k3Gm+HlCjI9z1Foet8LXEpbsqMzvnvkg 8KtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dzuWUGp8; 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 v2si5978877pgn.451.2019.01.18.14.48.54; Fri, 18 Jan 2019 14:49:10 -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=dzuWUGp8; 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 S1730027AbfARWph (ORCPT + 99 others); Fri, 18 Jan 2019 17:45:37 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44754 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729746AbfARWph (ORCPT ); Fri, 18 Jan 2019 17:45:37 -0500 Received: by mail-pl1-f196.google.com with SMTP id e11so6940528plt.11 for ; Fri, 18 Jan 2019 14:45:36 -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=vE+GFFAs0SL0g7lQx5BpIQpFtFj61cY+qRhW080jkkA=; b=dzuWUGp8pUVAry45JBppGT6bUTDsk3bhemfCoUpnZZjC7HWF/kgxe8MHNIeTW3mTJM 39v9aMShMzW6M24m5F+l6OzQ+6o0/0Yg8fopgcs/fkTlA0nRjoEy5FbVNaNkvGQRMsME H8lhz90E6R2GdxNHAga6bew4nZNDynhZcOsu4= 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=vE+GFFAs0SL0g7lQx5BpIQpFtFj61cY+qRhW080jkkA=; b=hN34CeZ1jpPMrfxz80uwb0c1+fTMlwOW1rLzaVR7h/eOZ9DV9+y1TPoIH3E1Ig3chE fbiS7OwSswxFVXrkEU6UKr1mqbmQpHxGn22gH9BIdO5QEVMc0RgjL59UynI5dcY5FtnH hw52BRoBbGMxdRU8q/PQ40ZN+SbNGeT8gV+Qc5VfrRpJ9lhtbIX8ZVXkP7DLTRoAy5aI f+kuwNOmiN42X2ht/lvDZ0KIpPGAK180OAUbbI2L7ViuOVhjCZIqqubjXmFU2e8hM7oU KATp+sQmazZcooRiZr5VRqr+dn3BVG830OC43fHnvNia4GcpfJJVKgEWkYHwww40fSy+ fYfQ== X-Gm-Message-State: AJcUuketdDRf0WbVIh2UsJfKlrTYdP0zoH/lJQt07dCxz3RFTZZeplpB PsxDgdj0CPBJcyQJKwEftuBmYTDPKRw9EQ== X-Received: by 2002:a17:902:b494:: with SMTP id y20mr21294702plr.178.1547851536468; Fri, 18 Jan 2019 14:45:36 -0800 (PST) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id g136sm7242097pfb.154.2019.01.18.14.45.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 14:45:35 -0800 (PST) Date: Fri, 18 Jan 2019 14:45:34 -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: <20190118224534.GC261387@google.com> References: <20190118010305.GX261387@google.com> <20190118100234.kq37hc4ldujqvvrb@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190118100234.kq37hc4ldujqvvrb@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 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. Cheers Matthias