Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp730493imm; Fri, 12 Oct 2018 05:56:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV61wfdaGXnuJn/efAZC3+P7ID9kF9+Du6QW7K8tR8Ad78I4aE2FP0POCNg3hx+NrXFA7TUd7 X-Received: by 2002:a17:902:854c:: with SMTP id d12-v6mr5832692plo.313.1539348983238; Fri, 12 Oct 2018 05:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539348983; cv=none; d=google.com; s=arc-20160816; b=PmHai/iDD3zHcvLuHtFLyZYBY5+lvmN88x46T7uqoCMoTF4xOdfrTstPx3hA+nQJcD TTjdxCjTM7OC1PeCwPBnivJuLTfR+AXRCvBUnEUP4P5Y13gRPgMNddfBg2YwSptoUxYy y5PLoNNsitx5q+y9HYnJIYXJmhBgUvIUXrxfRPnJrv7H3zp2dGzsOIwoI9geQqwukXG4 jXVZ7HiiwSWdNRPAgCvGj2LkzfuhNhT1H4kWMR25rIdhzgrWJLW0CGMN4WHzPy/swn4K EJvNRwPAxsLFvMfMhVbWSnVH4mSGumHir7I36y3Dt/ftLE3L2DVETPtlYpwwEd1nR2uq 9Oow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=gRaht0Wn9l/bmdViGBi/Bl/xV25Z9xrv1T7Ed1PCfyk=; b=KSQMhEzbAp5w4+yyfYT8ACy2oqBFoA+DXriIPdEzf/F9+EFKixRcRqP8jPLFdHNTjd 3XUA4wJuZH28HOqvWBnQ1l+iwYZwgc7O7KCG+5UfeWJOzROY9aI7v/fhHvdDBAr5D8ui AgmrX9xjXqL2sEDblcuzXHMrsRu5Uba1yC4PDNadOGBeLvP5jRgK6YFIYcFzeZHPsIHN Qt64LAX69i3IQsWnM6JMJ7pGLeEE1u2j2prTmK/Qh3z4rIymZp91d8B/8BKvvSvjC9AH A0f7cq17jKsMFrZQkfpvC3aul2gOM9/XKjHR3jD70uQ3185NBRFAJ1C2HpImREYFR8uh /njA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZfS4nbFz; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZfS4nbFz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c31-v6si1245804pgl.166.2018.10.12.05.56.08; Fri, 12 Oct 2018 05:56:23 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZfS4nbFz; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZfS4nbFz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728503AbeJLU1u (ORCPT + 99 others); Fri, 12 Oct 2018 16:27:50 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57876 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbeJLU1u (ORCPT ); Fri, 12 Oct 2018 16:27:50 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E94F360116; Fri, 12 Oct 2018 12:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539348928; bh=Ev0I13m5cYLwqIYwfwPSm3OR0pkwNn5w5dCv4c7K0zM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZfS4nbFzd4pwLNLQtl/VbYVuZ13PUBXAv2Va0z/rxbRormv6cUh/06nP/4+AGi8SB Uhz6oV9VSzxRKL06v5/vN3LsiwfqgXRiSE4geD0XUUN+CmLHvqL7wEdGeO/8gkfHJq IERQRroavXT0EN+lH7eKhuqj1y8IwHUa7rEg/MHI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 44ABC60116; Fri, 12 Oct 2018 12:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539348928; bh=Ev0I13m5cYLwqIYwfwPSm3OR0pkwNn5w5dCv4c7K0zM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZfS4nbFzd4pwLNLQtl/VbYVuZ13PUBXAv2Va0z/rxbRormv6cUh/06nP/4+AGi8SB Uhz6oV9VSzxRKL06v5/vN3LsiwfqgXRiSE4geD0XUUN+CmLHvqL7wEdGeO/8gkfHJq IERQRroavXT0EN+lH7eKhuqj1y8IwHUa7rEg/MHI= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 12 Oct 2018 05:55:28 -0700 From: Sodagudi Prasad To: Will Deacon Cc: catalin.marinas@arm.com, gregkh@linuxfoundation.org, ard.biesheuvel@linaro.org, robin.murphy@arm.com, ynorov@caviumnetworks.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: livelock with hrtimer cpu_base->lock In-Reply-To: <20181010164919.GA16512@arm.com> References: <8f671ebb6b331cd00ce17d111f28c548@codeaurora.org> <20181010164919.GA16512@arm.com> Message-ID: <63fae7b2ef8dc4cc67928329cf7fcb60@codeaurora.org> X-Sender: psodagud@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-10 09:49, Will Deacon wrote: > Hi Prasad, > > On Tue, Oct 09, 2018 at 01:56:14PM -0700, Sodagudi Prasad wrote: >> This is regarding - thread "try to fix contention between >> expire_timers and >> try_to_del_timer_sync". >> https://lkml.org/lkml/2017/7/28/172 >> >> I think this live lockup issue was discussed earlier but the final set >> of >> changes were not concluded. > > Well we basically need a way to pick a value for > CPU_RELAX_WFE_THRESHOLD. > Do you have any ideas? It could be determined at runtime if necessary. > Hi Will, Please share what are values need to be tried for CPU_RELAX_WFE_THRESHOLD. It would be great if it can be determined from runtime. Please let me know if any testing need to be done with dynamic detection patch. -Thanks, Prasad >> I would like to check whether you have new updates on this issue or >> not. >> This problem is observed with 4.14 .64 stable kernel too. >> We see this problem 2 times in overnight testing. >> >> I have to add the following code to avoid live lock. I am thinking >> that >> fixing this at the cpu_relax() level. >> >> +++ b/kernel/time/hrtimer.c >> @@ -52,6 +52,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> >> @@ -152,6 +153,7 @@ struct hrtimer_clock_base *lock_hrtimer_base(const >> struct hrtimer *timer, >> raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags); >> } >> cpu_relax(); >> + udelay(1); >> } >> } >> >> @@ -1067,6 +1069,7 @@ int hrtimer_cancel(struct hrtimer *timer) >> if (ret >= 0) >> return ret; >> cpu_relax(); >> + udelay(1); >> } >> } >> EXPORT_SYMBOL_GPL(hrtimer_cancel); > > This is just another bodge and likely to hurt in places where 1us is > excessive because there isn't contention. > > Will -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project