From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755699AbcGHOfN (ORCPT ); Fri, 8 Jul 2016 10:35:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33081 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754069AbcGHOfE (ORCPT ); Fri, 8 Jul 2016 10:35:04 -0400 Subject: Re: [PATCH 4/4] irqtime: drop local_irq_save/restore from irqtime_account_irq To: Rik van Riel , Frederic Weisbecker References: <1467315350-3152-1-git-send-email-riel@redhat.com> <1467315350-3152-5-git-send-email-riel@redhat.com> <20160708123010.GD30200@lerouge> <1467983987.13253.25.camel@redhat.com> Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, fweisbec@redhat.com, wanpeng.li@hotmail.com, efault@gmx.de, tglx@linutronix.de, rkrcmar@redhat.com From: Paolo Bonzini Message-ID: <4738023a-adcf-69b5-5856-12c4dc619363@redhat.com> Date: Fri, 8 Jul 2016 16:34:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1467983987.13253.25.camel@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JpDnPOjbP2tjlE1uhciuvI84x2ke8qVqf" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 08 Jul 2016 14:35:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JpDnPOjbP2tjlE1uhciuvI84x2ke8qVqf Content-Type: multipart/mixed; boundary="iqcCCMNBQsIWWxt1GahTVFh7cmsBLM6CD" From: Paolo Bonzini To: Rik van Riel , Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, fweisbec@redhat.com, wanpeng.li@hotmail.com, efault@gmx.de, tglx@linutronix.de, rkrcmar@redhat.com Message-ID: <4738023a-adcf-69b5-5856-12c4dc619363@redhat.com> Subject: Re: [PATCH 4/4] irqtime: drop local_irq_save/restore from irqtime_account_irq References: <1467315350-3152-1-git-send-email-riel@redhat.com> <1467315350-3152-5-git-send-email-riel@redhat.com> <20160708123010.GD30200@lerouge> <1467983987.13253.25.camel@redhat.com> In-Reply-To: <1467983987.13253.25.camel@redhat.com> --iqcCCMNBQsIWWxt1GahTVFh7cmsBLM6CD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/07/2016 15:19, Rik van Riel wrote: > On Fri, 2016-07-08 at 14:30 +0200, Frederic Weisbecker wrote: >> On Thu, Jun 30, 2016 at 03:35:50PM -0400, riel@redhat.com wrote: >>> From: Rik van Riel >>> >>> Drop local_irq_save/restore from irqtime_account_irq. >>> Instead, have softirq and hardirq track their time spent >>> independently, with the softirq code subtracting hardirq >>> time that happened during the duration of the softirq run. >>> >>> The softirq code can be interrupted by hardirq code at >>> any point in time, but it can check whether it got a >>> consistent snapshot of the timekeeping variables it wants, >>> and loop around in the unlikely case that it did not. >>> >>> Signed-off-by: Rik van Riel >> >> So the purpose is to get rid of local_irq_save/restore()? >> Is it really worth such complication? >=20 > local_irq_save/restore are quite slow, and look like the > largest source of overhead in irq time accounting. I'm looking at an upstream tree, without your patches applied, but it seems to me that irqtime_account_irq is always called with interrupts disabled: irqtime_account_irq -> account_irq_enter_time -> __irq_enter -> HARDIRQ_ENTER [1] -> irq_enter [3] -> __do_softirq [1] -> account_irq_exit_time -> __do_softirq [1] -> __irq_exit -> HARDIRQ_EXIT [1] -> irq_exit [2] [1] =3D does local_irq_disable/enable [2] =3D contains WARN_ON_ONCE(!irqs_disabled()) [3] =3D calls rcu_irq_enter(), which checks irqs_disabled() I don't think your first two patches change this, so perhaps it's enough to remove that local_irq-save/restore? Either this, or ENEEDWEEKEND... Paolo --iqcCCMNBQsIWWxt1GahTVFh7cmsBLM6CD-- --JpDnPOjbP2tjlE1uhciuvI84x2ke8qVqf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXf7oPAAoJEL/70l94x66DJ8gH/2KqPhENJLTjmUbilJhD0dfh eubKM784IQoQcdDQgsCpg0bXWJZvwbAO3RRZLJRqNhqRNJufwTHzS76Xyz6J1B49 mDzNtjJ0AnpxZlBBP4bYbKOjuQkMxN4a90QXj3OsrFrN9LZCWjJYrq79k2JhOGD/ 4DHKAAUD7uG9TV+V4jCUWQCiOYI8+WBWwDJsHGt0Cwo2bdo150UWVVMI0GMj25ML KeOQ9WIb214Xb6P3ptHiTOd5/dlaxCpxSJS81DV/J7SHY6ARvLg64kWXlIrtjVLD +m2SNkeGBMJGzXw/ILDejx36cjxyttrDZ5EOX9targclEcksuyiq27nP6zqliQw= =EZ1B -----END PGP SIGNATURE----- --JpDnPOjbP2tjlE1uhciuvI84x2ke8qVqf--