Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750860AbbDZUVz (ORCPT ); Sun, 26 Apr 2015 16:21:55 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:65275 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbbDZUVw (ORCPT ); Sun, 26 Apr 2015 16:21:52 -0400 Message-ID: <553D4890.2010708@nod.at> Date: Sun, 26 Apr 2015 22:20:32 +0200 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Thomas Meyer CC: Linux Kernel Mailing List , user-mode-linux-devel Subject: Re: [uml-devel] [UM] Long loop in __getnsdayoftime() after resume from ram References: <5444DC3F.20601@nod.at> <1429905520.157088.6.camel@m3y3r.de> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030508080901070401030507" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2324 Lines: 78 This is a multi-part message in MIME format. --------------030508080901070401030507 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Am 26.04.2015 um 20:32 schrieb Richard Weinberger: > On Fri, Apr 24, 2015 at 9:58 PM, Thomas Meyer wrote: >> Any ideas? > > Can you give the attached patch a try? > Let's see if it proves my theory. > Looks like UML's clocksource needs fixing. Please give also this patch a try. I should fix your issue in a sane way. Thanks, //richard --------------030508080901070401030507 Content-Type: text/x-patch; name="uml_mono.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="uml_mono.diff" diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index d824528..b386cee 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -244,6 +244,7 @@ extern int timer_one_shot(int ticks); extern long long disable_timer(void); extern void uml_idle_timer(void); extern long long os_nsecs(void); +extern long long os_nsecs_monotonic(void); /* skas/mem.c */ extern long run_syscall_stub(struct mm_id * mm_idp, diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 117568d..399687c 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -67,7 +67,7 @@ static irqreturn_t um_timer(int irq, void *dev) static cycle_t itimer_read(struct clocksource *cs) { - return os_nsecs() / 1000; + return os_nsecs_monotonic() / 1000; } static struct clocksource itimer_clocksource = { diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index e9824d5..0ef8faa 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c @@ -79,6 +79,15 @@ long long os_nsecs(void) return timeval_to_ns(&tv); } +long long os_nsecs_monotonic(void) +{ + struct timespec tp; + + clock_gettime(CLOCK_MONOTONIC, &tp); + + return ((long long)tp.tv_sec * UM_NSEC_PER_SEC) + tp.tv_nsec; +} + #ifdef UML_CONFIG_NO_HZ_COMMON static int after_sleep_interval(struct timespec *ts) { --------------030508080901070401030507-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/