Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2840947imu; Mon, 17 Dec 2018 08:38:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZGYheAAiHnP+x/bfuzK5Jyj6K5yeUJ9XLv8lpI7OidOeHNKXh9uRj0IGSDZ8qT5ijugI5 X-Received: by 2002:a62:1a91:: with SMTP id a139mr4503191pfa.64.1545064728788; Mon, 17 Dec 2018 08:38:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545064728; cv=none; d=google.com; s=arc-20160816; b=AcCgj0orhtN4D0yzrNk4Dp8PHSRNcDoZJUNZtfDWEWmjrKz8hBZHTXCb159QQFET/F dkEecehARjtnFDhHHtakQJgBZK/wZ5Tv0gGmvvQ2hPHblvlMJHS20yhfYFfNKNG00T/4 d4iJ4iKS8Oi7HCHSqbQkiQmaPDQ4skErd8HQ+PzENwKCliREiUrnxPAd68EKSmQLObM2 wAzlXgXZ8CobOkvK6M1Faq9zVRYtwyilj8GTALM4rHxB1Uug4rs+QW8b2Wbx85v/O7dl DKKUAp4Mq3Aq5QHZqyAxqc3THdADvJI125ysEg40ufl6WfDIhqiPCCeNmqCpE1Gg19Er InjQ== 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=tvRn8uif1FnxMDVH2moPVASXN2XAW1fiY/rFaMZFEyI=; b=AHDUATFGN15HLG4Vr/Gxj71GO4jb2on9U5ATWd+SM5LUqLFgZUld8E3PJvVIY4WLP/ ekt6mN+59sANvLZoSaymG/BS6AKLNENv+1KbnHTvkI/KndFbEM5BP+0orkLDaJnEhkwW aWK4/Rx7TWAB3/lZjYcFuTIH1CqlnI25Hwz4ZVIw1Ipu4gkwtdvuoce77QEvdKissG+Z ycaUoH6LxyvmDX4zCu0R5SlkQBBAxiEapPcSAk/Y7WgH10EB0Nk8ojkoF9HynSpJL+v3 +BiLFT3rDYYOdCKd9ZfHJYRnuJPwDXsa/64o61wDUMBLowtPtM8vRs4iOWokLaQDQzzp 91aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dQXzUi5N; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si9186341pln.289.2018.12.17.08.38.32; Mon, 17 Dec 2018 08:38:48 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dQXzUi5N; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbeLQQhi (ORCPT + 99 others); Mon, 17 Dec 2018 11:37:38 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:60048 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387833AbeLQQhi (ORCPT ); Mon, 17 Dec 2018 11:37:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tvRn8uif1FnxMDVH2moPVASXN2XAW1fiY/rFaMZFEyI=; b=dQXzUi5NrkierFSHvM7QCXs/O ZWFNmaeehaYNLpnR9GzryAAPBBuVRKGb5l5VBNg47EzvcT89POWv2REMMhC0649KvhmagRsJd1tAe CWc/ezl7zDP9exWBlWQqVDFjwSShk2d317FMyVCXlrY+5VwqB0lgpwGiPAS2S7juxUN90QpPCo335 w1nOWDyeWHwjeWfpfeglVR7q5ulW8OAr7kzgQwyk72FblOry58HlIPfwfLw+tOfINWShO3EXTyu9c 801sQ9YVHkOnYX7T5Py6gD59cwK0XaIHPSww5RXI6TDjy8JZFY5geZl+5MLUlQDc6vioOAhAuiKu1 po2hgPN8g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYvtX-00011h-MH; Mon, 17 Dec 2018 16:37:27 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8D56420276ABC; Mon, 17 Dec 2018 17:27:13 +0100 (CET) Date: Mon, 17 Dec 2018 17:27:13 +0100 From: Peter Zijlstra To: Suren Baghdasaryan Cc: gregkh@linuxfoundation.org, tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org, axboe@kernel.dk, dennis@kernel.org, dennisszhou@gmail.com, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 6/6] psi: introduce psi monitor Message-ID: <20181217162713.GE2218@hirez.programming.kicks-ass.net> References: <20181214171508.7791-1-surenb@google.com> <20181214171508.7791-7-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181214171508.7791-7-surenb@google.com> 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, Dec 14, 2018 at 09:15:08AM -0800, Suren Baghdasaryan wrote: > @@ -358,28 +526,23 @@ static void psi_update_work(struct work_struct *work) > { > struct delayed_work *dwork; > struct psi_group *group; > + u64 next_update; > > dwork = to_delayed_work(work); > group = container_of(dwork, struct psi_group, clock_work); > > /* > + * Periodically fold the per-cpu times and feed samples > + * into the running averages. > */ > > + psi_update(group); > > + /* Calculate closest update time */ > + next_update = min(group->polling_next_update, > + group->avg_next_update); > + schedule_delayed_work(dwork, min(PSI_FREQ, > + nsecs_to_jiffies(next_update - sched_clock()) + 1)); See, so I don't at _all_ like how there is no idle option.. > }