From patchwork Thu Feb 22 17:12:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 204873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp82338dyb; Thu, 22 Feb 2024 09:13:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW/RGtSFQoZboMohzyish3MfNQX0fo1ml9x++C70IItTbyTla36MO5Hd+gCnADpuLeLKfNcckdGkbkuuYq/fXSbjKlk3Q== X-Google-Smtp-Source: AGHT+IHLi+UzDIMhAzfIqn1y7DQZckvPdBD6Rj0jsaxzHCd6RzmFTV2sJ3Tapz+JrAWsf8VKInlx X-Received: by 2002:a17:902:b691:b0:1db:a0f0:fffe with SMTP id c17-20020a170902b69100b001dba0f0fffemr15792391pls.17.1708621999646; Thu, 22 Feb 2024 09:13:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708621999; cv=pass; d=google.com; s=arc-20160816; b=qRawkTDZ5kKnc2FaVHsme2pbUrKm4is0H1fA+bPdDTvmLSRXHSvL07lOoXNmFtOKhd hJGQeM28bvCCt4xlj9xo+wQzgjSCneu92xw67K3M6LIKoGyWyv5ktLQLmyNOfhcNY466 HS0RNrhkFFtPgic6iRY8bmEghBWkRFamLfElIaTYAaPQMj8BHoRtXEDhBmAofMRT1PYH 638AJUYkPOTEM1vPBHTQ+sM6J+rzpUXMIv9nvyoIgy8XiepyTz++Mpv3d2R2KsZls5Fu gPBg5MJRC7wr+45LK+yWWvnvUzPVu5OYh+zTFnkEI/6l1j9tknJn30CIpGktzJOHr6r5 dsTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=gKk3ao8eGgoRzZ3lnCXps17lYVWahMhm8Z5PwB6wqqI=; fh=IdquJyaazQ3wXWxdOExnpctJRLX4Jw3HEb/tnyKonzY=; b=z/smB53r0kAyGoeyzharxn4J61OuA0L9xO76inX5VvbPFP/jqYp7Sl26wTup5CaTLq FdSPea2Ok2Z7ame4ZWl1S0o36sgMJWCxlOBGJ6UZ7U4aHHk6k42FZWu79lJbkyA2JypF fjfAMVjqKJwWYaQQFAm1f79x5FQY6eVsjcoPAIz3rGyqgD5sKZ+T4L8jH4FsdDVUU10K sPrClBnPfSQew1LV2AmjyT+o8QpiZlPRGpe1CmN8U58hyRv5/k5sBGtXSQYePELbInBV mJUD0jF+tJGrGUn0+iJxCh+kwlLQypZRY+ryQ6YMIreuAVot9blvm1DHYjE6LXeVESjL YNEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qTui1JCW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76936-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76936-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e6-20020a17090301c600b001db27d25945si10657521plh.560.2024.02.22.09.13.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:13:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76936-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qTui1JCW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76936-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76936-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 764A828B538 for ; Thu, 22 Feb 2024 17:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03BCD156988; Thu, 22 Feb 2024 17:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qTui1JCW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BHYcyft0" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3EF0155303; Thu, 22 Feb 2024 17:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708621932; cv=none; b=HumZhIFHvdLOoKLcR7QCU1irMREI9NY+U/NpCl9r8HVBpF1iBQjpVUN7GBdBSmbpVs+uHdOoZ+/pJqHQFV9P0Rmp6GNIq1jU3/h0c5xTEJkuBawtztuYLEshXLx4Koqj/0QouvysxyTSTtYpvWN95OINxMlX7uDqoPS+xctfHnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708621932; c=relaxed/simple; bh=Y/SgF6ItigDqjLcf85DykyReMmOGZlYFxEVznB+HBmI=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=c+ougTfVuiy8nyjvAM1+2QArgRG6AXfcd/NPg8BbAeiiZB72t4BDFbY3NiefCRfW2nPpPdGdPPIHOhxxKjMsaLFOyIVzlpv4uOLvZvFAM6DeN/wgwzMieM6dOM4QbSMkZEBtkvzeBrJY/RRUTAEEjgH7KGjsLp8jlc4UicV0g4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qTui1JCW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BHYcyft0; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 22 Feb 2024 17:12:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708621928; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gKk3ao8eGgoRzZ3lnCXps17lYVWahMhm8Z5PwB6wqqI=; b=qTui1JCWB4NPagVO5wrDvRioMnr7Rb3FEoJIIu+6LOxu7kdZ5lWXlHjlxUj5WIPmAdKWQx qQ105uytcKDZyTE1N7MBlWvZ9nJeeB2fH+gq7KyTBdLuxqjEHh1+s5ACHq73vBHAzJ7cuO C+/eTLCtxVOuR6VPfjL2hbxBueskjXwtsCOczWkfd7nvZ50ZCPVix3qiviEisP3qssJ+PQ +Tnf7COG5KOn1/I+eRKR2lCFDxv8oV3hGi5UakfOH5Ce/s01F2h0PmVTu3CcSYPri2Aym6 gaLjeJe4ASbp+NjemlqBSOk1O3OZtG3oTsHHxcFA+zLgr8jp49fRPQa5UqRxsQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708621928; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gKk3ao8eGgoRzZ3lnCXps17lYVWahMhm8Z5PwB6wqqI=; b=BHYcyft0zdHIQ3ejlax7QvoKeAWRlpTAEEavMjsG+ETo5raAxMbLWbRLlT1Gd6I4UqIxFt YWP5s7VP2pseQYAg== From: "tip-bot2 for Anna-Maria Behnsen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timers: Check if timers base is handled already Cc: "Anna-Maria Behnsen" , Thomas Gleixner , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240221090548.36600-16-anna-maria@linutronix.de> References: <20240221090548.36600-16-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170862192800.398.8318015316746640187.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791499107831881095 X-GMAIL-MSGID: 1791620022199024973 The following commit has been merged into the timers/core branch of tip: Commit-ID: 89f01e10c99a5ca2ff88b545fad763d360cdbfc8 Gitweb: https://git.kernel.org/tip/89f01e10c99a5ca2ff88b545fad763d360cdbfc8 Author: Anna-Maria Behnsen AuthorDate: Wed, 21 Feb 2024 10:05:43 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 22 Feb 2024 17:52:32 +01:00 timers: Check if timers base is handled already Due to the conversion of the NOHZ timer placement to a pull at expiry time model, the per CPU timer bases with non pinned timers are no longer handled only by the local CPU. In case a remote CPU already expires the non pinned timers base of the local CPU, nothing more needs to be done by the local CPU. A check at the begin of the expire timers routine is required, because timer base lock is dropped before executing the timer callback function. This is a preparatory work, but has no functional impact right now. Signed-off-by: Anna-Maria Behnsen Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20240221090548.36600-16-anna-maria@linutronix.de --- kernel/time/timer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 51053af..4420cdf 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2285,6 +2285,9 @@ static inline void __run_timers(struct timer_base *base) lockdep_assert_held(&base->lock); + if (base->running_timer) + return; + while (time_after_eq(jiffies, base->clk) && time_after_eq(jiffies, base->next_expiry)) { levels = collect_expired_timers(base, heads);