Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbdCMPdL (ORCPT ); Mon, 13 Mar 2017 11:33:11 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:7526 "EHLO imgpgp01.kl.imgtec.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750772AbdCMPdD (ORCPT ); Mon, 13 Mar 2017 11:33:03 -0400 X-PGP-Universal: processed; by imgpgp01.kl.imgtec.org on Mon, 13 Mar 2017 16:38:12 +0000 Date: Mon, 13 Mar 2017 15:33:00 +0000 From: James Hogan To: Thomas Gleixner CC: , Martin Schwidefsky , Ian Pozella , James Hartley , Matt Redfearn , Daniel Lezcano Subject: Re: [PATCH] clockevents: Retry programming min delta up to 10 times Message-ID: <20170313153300.GL996@jhogan-linux.le.imgtec.org> References: <1461321611-6159-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LZ7ZmEAmJ6juC7Oo" Content-Disposition: inline In-Reply-To: <1461321611-6159-1-git-send-email-james.hogan@imgtec.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [192.168.154.110] X-ESG-ENCRYPT-TAG: 1b7d744b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2499 Lines: 62 --LZ7ZmEAmJ6juC7Oo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Apr 22, 2016 at 11:40:11AM +0100, James Hogan wrote: > Under virtualisation it is possible to get unexpected latency during a > clockevent device's set_next_event() callback which can make it return > -ETIME even for a delta based on min_delta_ns. >=20 > The clockevents_program_min_delta() implementation for > CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=3Dn doesn't handle retries when this > happens, nor does clockevents_program_event() or its callers when force > is true (for example hrtimer_reprogram()). This can result in hangs > until the clock event device does a full period. >=20 > It isn't appropriate to use MIN_ADJUST in this case as occasional > hypervisor induced high latency will cause min_delta_ns to quickly > increase to the maximum. >=20 > Instead, borrow the retry pattern from the MIN_ADJUST case, but without > making adjustments. We retry up to 10 times before giving up. >=20 > Signed-off-by: James Hogan > Cc: Thomas Gleixner > Cc: Martin Schwidefsky This is still an issue, both under virtualization and on hardware-multi-threaded MIPS cores with the mips-gic driver where general latency can by impacted by the behaviour of software running on other hardware threads (which are seen as other CPUs from Linux' point of view) in the same core. Does anybody have any more feedback about this patch? Thanks James --LZ7ZmEAmJ6juC7Oo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYxrusAAoJEGwLaZPeOHZ6P/IP/AwJbBNyxnAuNmHHQRohKQ6E UbivYbtXebCN5QcULOHOY42nry9t4aQA/IJtDJfA6Ovp/Iz/RdmCSDGuoz/Ncs5v C/KJoGYlEFFuxu8FRobw7UMtYFE7K+MpxUyI0z63XserxjIW0GJCTxQjingbCMEI e38kSWE9bqG0hqF1xyDRUGb8l98mg8akL106QOkIziUX6HcBDZWpALRJOnb+dbsx oGP/BDkRoSlci2uhBsKLIo8uWuFi53E1PxNJXg0bWto8A/pCsZDqeKYGr/8irmxx hyVba0M5qmRTVv6FjOqWoAXZl7B21GdP3WTZEN9a+8wT5CALVfFJHAYu3/tyoPbg Z3eYoaqCpPiG/VpMmSxdgOaGs2REps7rj23np0Ic8+WUb4cVOITxQCDRcUvp2dp4 mC3L6S4SHYpY0nm4fMw/12wWr4H2jW2zYDv66VwBHvrQfNd03JEBiluvfqCyMxgx eQjX6mnQfF13oCt3ENvi65ICbj/tIgl7AmvuUk0kYhbLGnnXC1jjg09BxaE4YkdY KXmgHwQwm9qYvHeqs7zkInTY0UpKeN/cTieiW7SLm4dATsSCJ1yXj/wz55TiG8qe wJ3BlzlZwjUKJWcrdCk3zxSdC1tZoHJ49r993P56IYHhDZygmZWU1whkMlK0MXrO n1NhYA8EjXi9ziBwQvM6 =BmCs -----END PGP SIGNATURE----- --LZ7ZmEAmJ6juC7Oo--