From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C816EB64D7 for ; Wed, 28 Jun 2023 21:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbjF1VMP (ORCPT ); Wed, 28 Jun 2023 17:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232634AbjF1VKB (ORCPT ); Wed, 28 Jun 2023 17:10:01 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 268771FDC for ; Wed, 28 Jun 2023 14:10:00 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687986597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NfWivBbB9CVFPmfW5ghsqhRiOMsMXKFj03Bb7yAbSp8=; b=iwxulBDyqoxoYc67idxuGHptPiqIEcYN4K6VgcWFrLzinJoQIJoCWiXwyq66wOOiMhsBYw WjneLK8b51+VPCbFxPTAlLDZcwTP6naRW6BDbmbQwptP4uqGbvZFvSbSWLIjLOAouRxw8b nldD2D2+NKBGvHs+59birCNOA7tnchadsquq8EXPBGbDXqt7ram36aY5UiaGnzgpXKjTt9 xQaTwhT5tFQy9J8vQYiEpH2rT5Bm6iZwCpaLpeAhyEd994p27rhYhUrU4EPmFzmnQAQAiW X9t5p+MX0dPsFgORQUvYC+TaFsSz5ROA5P8DFwh54tItqws7rM3nOk4XzpbIgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687986597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NfWivBbB9CVFPmfW5ghsqhRiOMsMXKFj03Bb7yAbSp8=; b=Prt+vhMvrIzR39qAU+NqSLzDhp4jinRyajpUKYGx0SKEFvHWr0cIwcutxl4oMRAv3Sek1P 6fV/yVMOFsdXZ5Aw== To: Vincent Guittot , Xiongfeng Wang Cc: vschneid@redhat.com, Phil Auld , vdonnefort@google.com, Linux Kernel Mailing List , Wei Li , "liaoyu (E)" , zhangqiao22@huawei.com, Peter Zijlstra , Dietmar Eggemann , Ingo Molnar Subject: Re: [Question] report a race condition between CPU hotplug state machine and hrtimer 'sched_cfs_period_timer' for cfs bandwidth throttling In-Reply-To: References: <8e785777-03aa-99e1-d20e-e956f5685be6@huawei.com> <87mt18it1y.ffs@tglx> <68baeac9-9fa7-5594-b5e7-4baf8ac86b77@huawei.com> Date: Wed, 28 Jun 2023 23:09:56 +0200 Message-ID: <87zg4j2t0b.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28 2023 at 15:30, Vincent Guittot wrote: > On Tue, 27 Jun 2023 at 18:46, Vincent Guittot >> > > + struct hrtimer_clock_base *clock_base = cfs_b->period_timer.base; >> > > + int cpu = clock_base->cpu_base->cpu; >> > > + if (!cpu_active(cpu) && cpu != smp_processor_id()) >> > > + hrtimer_start_expires(&cfs_b->period_timer, >> > > HRTIMER_MODE_ABS_PINNED); >> > > return; >> > > + } Can you please trim your replies? >> I have been able to reproduce your problem and run your fix on top. I >> still wonder if there is a > > Looks like I have been preempted and never finished the sentence. The > full sentence is: > I still wonder if there is a race condition where the hang can still > happen but i haven't been able to find one so far As I explained before. Assume the timer fires on the outgoing CPU and the other CPU tries to rearm it concurrently. It will stay on the outgoing CPU and not move over. Thanks, tglx