From owner-svn-src-all@freebsd.org Mon May 2 16:13:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A0B0AEE852; Mon, 2 May 2016 16:13:56 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA61144E; Mon, 2 May 2016 16:13:55 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u42GDtPm051954; Mon, 2 May 2016 16:13:55 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u42GDtIJ051953; Mon, 2 May 2016 16:13:55 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605021613.u42GDtIJ051953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 2 May 2016 16:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298927 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2016 16:13:56 -0000 Author: royger Date: Mon May 2 16:13:55 2016 New Revision: 298927 URL: https://svnweb.freebsd.org/changeset/base/298927 Log: xen/timer: remove the timer setup loop With the removal of the usage of the VCPU_SSHOTTMR_future flag, now all errors from xentimer_vcpu_start_timer should be considered fatal, and the loop is no longer needed since in case of setting the timer in the past we will get an event interrupt right away (instead of returning ETIME). Sponsored by: Citrix Systems R&D MFC after : 2 weeks Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Mon May 2 16:13:11 2016 (r298926) +++ head/sys/dev/xen/timer/timer.c Mon May 2 16:13:55 2016 (r298927) @@ -76,8 +76,6 @@ static devclass_t xentimer_devclass; #define XENTIMER_MIN_PERIOD_IN_NSEC 100*NSEC_IN_USEC #define XENCLOCK_RESOLUTION 10000000 -#define ETIME 62 /* Xen "bad time" error */ - #define XENTIMER_QUALITY 950 struct xentimer_pcpu_data { @@ -295,7 +293,7 @@ static int xentimer_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { - int error = 0, i = 0; + int error; struct xentimer_softc *sc = et->et_priv; int cpu = PCPU_GET(vcpu_id); struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); @@ -312,21 +310,8 @@ xentimer_et_start(struct eventtimer *et, first_in_ns = (((first >> 32) * NSEC_IN_SEC) + (((uint64_t)NSEC_IN_SEC * (uint32_t)first) >> 32)); - /* - * Retry any timer scheduling failures, where the hypervisor - * returns -ETIME. Sometimes even a 100us timer period isn't large - * enough, but larger period instances are relatively uncommon. - * - * XXX Remove the panics once et_start() and its consumers are - * equipped to deal with start failures. - */ - do { - if (++i == 60) - panic("can't schedule timer"); - next_time = xen_fetch_vcpu_time(vcpu) + first_in_ns; - error = xentimer_vcpu_start_timer(cpu, next_time); - } while (error == -ETIME); - + next_time = xen_fetch_vcpu_time(vcpu) + first_in_ns; + error = xentimer_vcpu_start_timer(cpu, next_time); if (error) panic("%s: Error %d setting singleshot timer to %"PRIu64"\n", device_get_nameunit(sc->dev), error, next_time);