Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4505129imu; Tue, 29 Jan 2019 02:45:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN4lbvfQhIR0edI5KYm5Z1P1gwSRc5R2Ke6R1WCoLOfQ6ssZeaTTxQxddEUiHnRt2eyFsrm5 X-Received: by 2002:a62:e044:: with SMTP id f65mr25421640pfh.208.1548758755826; Tue, 29 Jan 2019 02:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548758755; cv=none; d=google.com; s=arc-20160816; b=pvBEZToI3Ty52398kErAmASUUQ9Y8kI42akBVn4OllOxIgpVYFg5RySoTnMY2OOlV8 jZZ925P7AeBkfngt9REkuPMZSAFe3MxLtH2eu9jSmNpxHjKdkeqti2vB/5ft5OOxMPer /TM6R9OC4Durc77A+DUn3f5R5sagOgrNYLGj9xuJVhfVlZF796s7kEGjiRt2vDkxPIgh xPYxwVZMwvb9OfYi2u/2DXvoif+tFtptpJ8Nwhem+P81Bx4Hnq/HAEO1QY2wIHmcBcF6 neJFyFm8XAvpHgdNSOzaAqimN58j8WZE/Vub5BuUQjYetEWEjB5hf9beCvyy49O4dlLj kFcQ== 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=/DYnSP8wwfkVagxlcXdbh9VOXn6NyWlZWTa5ybGjpLI=; b=W3xj6TkOoZZ1vd60ilWJz4xQrU3zPE6+IdjXYiU8NfZ03wM3Z0s8z4+/ObajitCwco sSeV/6d50Y/rzVzYNNkdqRWnh7V8/gcyX//mvAYg1NryrV5Z8ADKhhm07siStFFXBNgs WfTzxwH8PkTwOoFGaQhJYe5OYzImvTUIFaSN1QHtSjNx8vtjWTqobRxWhYkhsA6awy7z ztVKYMXC4ST20OJ9cvgv9eyXwu2coHr7mejDDBwO7aAKlNfT1/4+MnfRbwfk8DbBh11C c3ppg7N4BS7luN2ueUMIq/r79TxFIazgAlI0IVn007XABtjrGwXRstnZs/TbsxxNfH30 nV6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Jk0fptbw; 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 h127si36370484pfe.204.2019.01.29.02.45.40; Tue, 29 Jan 2019 02:45:55 -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=merlin.20170209 header.b=Jk0fptbw; 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 S1728367AbfA2Kow (ORCPT + 99 others); Tue, 29 Jan 2019 05:44:52 -0500 Received: from merlin.infradead.org ([205.233.59.134]:57220 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbfA2Kow (ORCPT ); Tue, 29 Jan 2019 05:44:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=/DYnSP8wwfkVagxlcXdbh9VOXn6NyWlZWTa5ybGjpLI=; b=Jk0fptbwefzDq9+8zgftkY20d 8S0HjEYx3W+J+CiaW3yCBRQi0gRLhDpQapl661tD+UD51GNxqwhk4DCEsUZTZO0URngSGCK5T59xD JtGj8ZWFL4Jt8tnkbUuNnyncF4lIH7sm7URnzzp9WO0be1AhK4U0uo8lmZy3mtvJPMwV9Rutb50Sv DVZ2ZTggkXUTqp2XPUldmoZJG04oFmB+wx66t18Imh0r+agjQTCJ0aK0nGIgFR9aCVHnHx969KoX0 bG7U89mBgq3HA5cZqmkgbLkeTbk2UYHcFEhwAAs7mfqs7H41qw4fuQGDYKzQ+KPu/p4uasxvQIGQh D0KFbAGpQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goQsa-0000Kv-H3; Tue, 29 Jan 2019 10:44:32 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4EECB201EC171; Tue, 29 Jan 2019 11:44:31 +0100 (CET) Date: Tue, 29 Jan 2019 11:44:31 +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 v3 5/5] psi: introduce psi monitor Message-ID: <20190129104431.GJ28467@hirez.programming.kicks-ass.net> References: <20190124211518.244221-1-surenb@google.com> <20190124211518.244221-6-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124211518.244221-6-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 Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > static void psi_update_work(struct work_struct *work) > { > struct delayed_work *dwork; > struct psi_group *group; > + bool first_pass = true; > + u64 next_update; > + u32 change_mask; > + int polling; > bool nonidle; > + u64 now; > > dwork = to_delayed_work(work); > group = container_of(dwork, struct psi_group, clock_work); > > + now = sched_clock(); > + > + mutex_lock(&group->update_lock); actually acquiring a mutex can take a fairly long while; would it not make more sense to take the @now timestanp _after_ it, instead of before?