From patchwork Thu Oct 22 09:28:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 55418 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 0AD9823024 for ; Thu, 22 Oct 2015 09:38:35 +0000 (UTC) Received: by lffv3 with SMTP id v3sf29345864lff.1 for ; Thu, 22 Oct 2015 02:38:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=9J2aXnpbIWtvtjDvm3yQ3XAih9ibAYjj1OSfZnshuNc=; b=HI5FxCE/l4IrdEBYBGpqptmyqMMo+1lJzW1hsj0vSwTQ3qmYTYHY86j9D4ofJaeL7u 7aCL6sE4r1NUig5Zzfd33k4+cknnzSB8iM2dH+5H27M8DdZ2tyEurEGM3YWsRZBO//KS uxD8jVJDFd8onKGqjRpxsh9B8M/E/yl/jq4+HlazEHKunk+L7Dh/sSIy9vGWQ991akLp CfsHVnwnqdO3s8ZlBbMIArFMWMO3YQ9AbIusvfXfzPxUrE+wEU4zTEXau2wRSDCcycDO rbQEs2PwDazrj+22kE1EQ1pwVvLBIGN4jnUs3M0xvt7oVSS0uXDbpfxaJ862BxCaPb70 XNjQ== X-Gm-Message-State: ALoCoQm3PD6wh6NuvLhJIS6knTGeqxDdvbRsKtBbnR+Kcb5B59FYh/RKCy/CEEzvQGhc0EfwFcfS X-Received: by 10.112.198.33 with SMTP id iz1mr3400150lbc.8.1445506713846; Thu, 22 Oct 2015 02:38:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.20.202 with SMTP id 71ls299211lfu.95.gmail; Thu, 22 Oct 2015 02:38:33 -0700 (PDT) X-Received: by 10.112.54.169 with SMTP id k9mr7646070lbp.95.1445506713682; Thu, 22 Oct 2015 02:38:33 -0700 (PDT) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id m72si9054094lfm.71.2015.10.22.02.38.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 02:38:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lfaz124 with SMTP id z124so41108657lfa.1 for ; Thu, 22 Oct 2015 02:38:33 -0700 (PDT) X-Received: by 10.112.198.69 with SMTP id ja5mr6774152lbc.106.1445506713571; Thu, 22 Oct 2015 02:38:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp483450lbq; Thu, 22 Oct 2015 02:38:32 -0700 (PDT) X-Received: by 10.66.217.138 with SMTP id oy10mr16185576pac.149.1445506712577; Thu, 22 Oct 2015 02:38:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ow7si19798315pbb.237.2015.10.22.02.38.30; Thu, 22 Oct 2015 02:38:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965218AbbJVJiY (ORCPT + 28 others); Thu, 22 Oct 2015 05:38:24 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:38493 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964883AbbJVJiQ (ORCPT ); Thu, 22 Oct 2015 05:38:16 -0400 Received: from 172.24.1.50 (EHLO szxeml426-hub.china.huawei.com) ([172.24.1.50]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CXL04586; Thu, 22 Oct 2015 17:29:08 +0800 (CST) Received: from [127.0.0.1] (10.177.22.246) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.235.1; Thu, 22 Oct 2015 17:29:00 +0800 Message-ID: <5628AC58.2030509@huawei.com> Date: Thu, 22 Oct 2015 17:28:56 +0800 From: Ding Tianhong User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Thomas Gleixner , Yang Yingliang CC: , , Hanjun Guo Subject: Re: Problem about CPU stalling in hrtimer_intterrupts() References: <56288585.40204@huawei.com> In-Reply-To: X-Originating-IP: [10.177.22.246] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dingtianhong@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 2015/10/22 15:43, Thomas Gleixner wrote: > On Thu, 22 Oct 2015, Yang Yingliang wrote: >> I use the kernel-4.1.6 running on arm64. >> My testcase is that it calls clock_settime and clock_adjtime alternately with >> random params on each core. My system has 32 cores. >> >> I found the cpu stalling in hrtimer_intterrupts(). So I added some debug info >> in hrtimer_intterrupts() and found that the while loop runs 1020437660 times >> and takes 98761 jiffies(HZ=250). >> >> Some debug log is here: >> ---start--- >> Jan 01 00:03:32 Linux kernel: i:0 basenow.tv64:4809284991830 >> hrtimer_get_softexpires_tv64(timer):4440120000000 ccpu0 >> timer:ffffffdffdec6138, timer->function:ffffffc000129b84 >> Jan 01 00:03:32 Linux kernel: i:0 basenow.tv64:4809284991830 >> hrtimer_get_softexpires_tv64(timer):4440120000000 ccpu0 > > Something is rearming a timer over and over with expiry time in the > past. > > Thanks, > > tglx > Hi Thomas: This problem could only occur on the system with 32 cores, when I cut the cores to 16, this problem disappeared, so I think there is some parallel problem when the 32 core set clock time together: I try to reproduce the scene: 1.do_settimeofday64 2.update tk time 3.update base time offset 4.update expires_next the 3 and 4 will be called in softirq, but the hrtimer_interrupt may break the order and run before 3, I am not sure whether this could make the problem, do we need to update base time and expires_next in the hrtimer_interrupt? maybe I miss something, thanks for any suggestion. Thanks Ding > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > > --- 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/ diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 93ef7190..9adab23 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1254,6 +1254,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) raw_spin_lock(&cpu_base->lock); entry_time = now = hrtimer_update_base(cpu_base); + hrtimer_force_reprogram(cpu_base, 0); retry: cpu_base->in_hrtirq = 1;