Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1954606lqz; Tue, 2 Apr 2024 02:52:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlL9f47pN9Nkv7ZIerudabvEWP1ggfbhtF8XsjsGIH8TZ80ifbMA/0rVXWLpuWFAvw9IGuQ0Qn54tPGvdgDulFQ3cWo06njtkpDnqHwQ== X-Google-Smtp-Source: AGHT+IG4HcEY2srhjA9w5BCTjwZhY1yxMWbe1C5vx9tIB1kMkqda1qB4hcXCJ9M2Eh7pyS//6C81 X-Received: by 2002:a05:6358:7215:b0:17e:a9b7:2636 with SMTP id h21-20020a056358721500b0017ea9b72636mr16254131rwa.22.1712051556385; Tue, 02 Apr 2024 02:52:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712051556; cv=pass; d=google.com; s=arc-20160816; b=Kb73+qFJpznBXmntZJNmCtP3ghAkcf6HoWZtrZ5HTPVWEjxiLp4vn3iyyaSU5+Ft+b hOuxc6VYjS3X4mpolvRPNGhsoejtk3vYfYMWAWiUMulraMo0zKMlYN4jYUZSDiXwpxyC DeupoDpI8vE+UzkZobZZ1B7ABEtvWSOGHd9HD/qmhajAX6ktN91CG9o1HXe+Ue5R9cqB pfsP3icgpD8CzY0JKJcNdMPMSlE6pJFeVHsDf07Gz37SUIOdp4s82M6ybrPKME73G6U7 Mh+dIQ6R08CUfX8GeJEqkfbZcpja2vi7Tq9TUqIAlDl1Id5myiSpnGnrPNxHpnXWtEQr 6B7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=MfofgMPYhY/CqWyYNBhoezw1zH/eEREYv39qPQ0r7r4=; fh=ezROCTUZ6g+lCJ1JQRtjNPMeI9ZnsIE0ysxlRkrOQ54=; b=evBSTlbDaDwFWWdwTkWh+qNSyhY4+bgQe1ZMT2ifWW9kT0CWszStH2OAc3XCJaxNSW IMkBcja87S7Hy7fvhrbpGea8ZA81AhHTwmTRO6z8F4ziN7uI0Oxk1MZfsysFQY8HHhlA pK83diG+NQ22YZDKPkJtRSc+mXQt/cc1Qe+zDjZHFEf5Q/i8hP4krLlkpxGvqIetNsWX 21Kz9xZx1sQj0HS9FdpXc5+TNqzLyBbeiLC79VFhD8oa8bnB9eGuqFLxIZ115JOhrZfX BXXET2czEJRTtWmIdZ0+en+y46Vexcl3tpBRdCjI+QCwifw8zNZW5w+uSy09XfD5A1YJ kyoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AHkTsqkj; 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-127663-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127663-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t6-20020a63eb06000000b005dc97d88897si10961970pgh.698.2024.04.02.02.52.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 02:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127663-linux.lists.archive=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=AHkTsqkj; 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-127663-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127663-linux.lists.archive=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 0BBB3282073 for ; Tue, 2 Apr 2024 09:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88A5959155; Tue, 2 Apr 2024 09:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AHkTsqkj"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2VkLTX1t" 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 3FE8A5731E for ; Tue, 2 Apr 2024 09:52:24 +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=1712051546; cv=none; b=b1S2cZ0jkDXZKWm50yV/sl4W8I34en6LLSTausHB+kRc5QxwEGPo+GsqOBRxrB10x/R3F6m7jYH1nBn8qyz496MXunnH37HmrRLweQYf+VX6D5K5qPLO6iFTK4w8wSfJgWWQTKCX5OwIvm2SKgJOnHQD+HyxfxpyHaC62hl+Auo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712051546; c=relaxed/simple; bh=AvNwNwPRatiYJ8KSWOBnIOETxBQESg1ookNNE0WUh5M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=pHvEI7GiGKQ6NsfdDIGZnQjRdC+pKqy57u4K2pAP/uy4EG4i0hcqLjdolh8RbnRzZnzRF7zV42+WeyUMONmQD0Y7m/NbL62uyo/WFPgB0WcEn7Y1cCWwVHoOradjOU6gZNmgABOUtTWXFUWW+lYDE4QISPAGaoWCTvf8gavf+rY= 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=AHkTsqkj; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2VkLTX1t; 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 From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712051543; 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=MfofgMPYhY/CqWyYNBhoezw1zH/eEREYv39qPQ0r7r4=; b=AHkTsqkjQbHXXaFvQ5UP2Gi8kNOdjZjU203GN+COJzt1HFQ4x7JUpwRuZZnLoMepVZCVqM FHI+kivziADmv/gyOxAVJSnj9Z6GiWWO23uPtRL/wmb+rtAx4luGlrxP/eqA14bZWJfg91 PFQ/1ZF1de7dNSkjEHRuiDSqctQ+4eO4kwRDVFehyEurKX/ZEY7k9DU1oEONSQsPzOMD2+ gdhwVDmjnF2myapYukatzEUIvql7EHVqsE1BdWGg9YE/zuBIN1Hfneu52OjK8NErvpPwv1 eP4wblcEmJfSL5lhg0kHwuQfcEAxKMvRlPvePFvLesbcYUC/iouMQ0CZe1Pifw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712051543; 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=MfofgMPYhY/CqWyYNBhoezw1zH/eEREYv39qPQ0r7r4=; b=2VkLTX1t5a2XWVXNN/izKQSB9OB8uZt0ALZgP3O9/xbc48FDbcAHos1B+zl2EnD65HECRO KQhxGEJ0320vDbBA== To: Frederic Weisbecker , Thomas Gleixner , Ingo Molnar Cc: LKML , Frederic Weisbecker Subject: Re: [PATCH] timers/migration: Fix ignored event due to missing CPU update In-Reply-To: <20240401214859.11533-1-frederic@kernel.org> References: <20240401214859.11533-1-frederic@kernel.org> Date: Tue, 02 Apr 2024 11:52:23 +0200 Message-ID: <87r0fo9jmw.fsf@somnus> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Frederic Weisbecker writes: > When a group event is updated with its expiry unchanged but a different > CPU, that target change may go unnoticed and the event may be propagated > up with a stale CPU value. The following depicts a scenario that has > been actually observed: urgh... > > Signed-off-by: Frederic Weisbecker > --- > kernel/time/timer_migration.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c > index c63a0afdcebe..90786bb9a607 100644 > --- a/kernel/time/timer_migration.c > +++ b/kernel/time/timer_migration.c > @@ -762,8 +762,11 @@ bool tmigr_update_events(struct tmigr_group *group, struct tmigr_group *child, > * queue when the expiry time changed only or when it could be ignored. > */ > if (timerqueue_node_queued(&evt->nextevt)) { > - if ((evt->nextevt.expires == nextexp) && !evt->ignore) > + if ((evt->nextevt.expires == nextexp) && !evt->ignore) { > + if (evt->cpu != first_childevt->cpu) > + evt->cpu = first_childevt->cpu; Why not just unconditionally overwriting the evt->cpu value here? > goto check_toplvl; > + } > > if (!timerqueue_del(&group->events, &evt->nextevt)) > WRITE_ONCE(group->next_expiry, KTIME_MAX); Thanks, Anna-Maria