[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v1 4/6] xentop: collect IRQ and HYP time statistics.


  • To: "dfaggioli@xxxxxxxx" <dfaggioli@xxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 12 Jun 2020 22:27:31 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CX7rNOWmTwqIS4t0nZcNAiKNmekxJymKS62aZAzJS1E=; b=X0FOqdItB0Wm2XnCx2ts01kyXerKIkRfbWQ2ogIyhUj1385f982trBgQMe6Yoa1I0mDknuF4DZiGX1Vz+H4CEPCeGauyoNlBFbsYIiSu1mX0szBkVfQGjlydpXzp9blCwuEPVReEElM+PeWiVw8L89KAWw3V7p8Wz817BeZDvQiLqy6ko2RLJ3/N0qMZmyF+YUMZX86lBZtn7N0KqeheUprrd+b5a8pt8yfkWT9bv8Rmm31YifmQdtwqBHCO6afVtgS9rIQwIlnDzeOTbaC4/5zQb0ivuswQpTNlbtd2eGmXk8rmKwHU6HEHS3O5TiURCZpLNQt7LxbaXecwg1wt0A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c8wE5PIIcjnrnBa5qCRO/jWdkesSwAOYUztS0JA1Wzr9m+OjLt310MbJn3+qjlD1B0hxTLzLloH6LunF5j6NLEt2dekJgXHGc1o/2Y7kP6mSARnUgbNNjsG6gWqM7OvnFfuEmrmIHjAMj3LZOmqyvwhPmOz+7zhg5XYwfvo3+Qzzx2mc0UW8xcpsDT+q2YfpIXG3N99BMFmbp4du9z1pdJvkxKh4cx1xHEzZpm7l1PweSvzHyiW+UzuYxfBjDiUyk0s8vp4cHZjvcwIPXYF+j7hhOA1wIrUYHH+PtEBdL/SSBOV0WVAyFzdozcY7Igi3RkgoPD6wuKy8KFDGpPCWFA==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=epam.com;
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "ian.jackson@xxxxxxxxxxxxx" <ian.jackson@xxxxxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 12 Jun 2020 22:27:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWQE+Tib/gTK49mk6bUudd1VvXZqjUa0CAgAB+fACAAANFAIAALvMAgAB0vgA=
  • Thread-topic: [RFC PATCH v1 4/6] xentop: collect IRQ and HYP time statistics.

On Fri, 2020-06-12 at 17:29 +0200, Dario Faggioli wrote:
> On Fri, 2020-06-12 at 14:41 +0200, Jürgen Groß wrote:
> > On 12.06.20 14:29, Julien Grall wrote:
> > > On 12/06/2020 05:57, Jürgen Groß wrote:
> > > > On 12.06.20 02:22, Volodymyr Babchuk wrote:
> > > > > @@ -994,9 +998,22 @@ s_time_t sched_get_time_correction(struct 
> > > > > sched_unit *u)
> > > > >               break;
> > > > >       }
> > > > > +    spin_lock_irqsave(&sched_stat_lock, flags);
> > > > > +    sched_stat_irq_time += irq;
> > > > > +    sched_stat_hyp_time += hyp;
> > > > > +    spin_unlock_irqrestore(&sched_stat_lock, flags);
> > > > 
> > > > Please don't use a lock. Just use add_sized() instead which will
> > > > add
> > > > atomically.
> > > 
> > > If we expect sched_get_time_correction to be called concurrently
> > > then we 
> > > would need to introduce atomic64_t or a spin lock.
> > 
> > Or we could use percpu variables and add the cpu values up when
> > fetching the values.
> > 
> Yes, either percpu or atomic looks much better than locking, to me, for
> this.

Looks like we going to have atomic64_t after all. So, I'll prefer to to
use atomics there.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.