From nobody Wed Dec 17 04:16:46 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E60915B571; Thu, 16 May 2024 19:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715886513; cv=none; b=JlRCxH0bGJYUZRz6RMbOMCY/WvrSUdn+eHq3qTDLxXpEVZPBTjUpTRNQ+gSguf+ijvt7I0VedMiQiCxdndR5zxJDV/9efOtxVZ9UCD2TfT9WgjQS54Jdx3PKhCHjd2yGJBnsEvY2obNifxi3/AvjHnELa0L/eo619/upLwDlwiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715886513; c=relaxed/simple; bh=8kbqqHhC8hqJWztiJ4S0vBrzZ4vEVAmywhl/Drj8bP8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U1DVRFsbszru4/RJYwuBXHclx0dxcTm3KpV4OXEjwPh6gpdVG6msW0H+HZvVa8LY2m/2HhsLBpKFMkCTLe/xrPmau49EnmG4RIqiX0r3ZuevlAoOMBqCIStMM+d2OsCcGZERXS6cyiJdt2DNO28vu5N0+eJTs6UxDhuy8LPRXnM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-420180b5897so34934195e9.3; Thu, 16 May 2024 12:08:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715886510; x=1716491310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KKc3fp/jI+BvIXedy1D0TYqFMPTw9ko9fdbmFGrVOU8=; b=drNowamVeICSyaeTWBAQUoIqHtkZGjREWEdR7cQi4lxBUB5vp8mqHNq+4t8Vv1pYtZ GaV5qn1/vN12rQBax6ADaQYaY5oewd1i2nMu1rXjp63ei3NMpWaNpPQqw6kD1hcDX+zj o1ECya54JQBs95HzjubTpeaFYYQpVzpUc5Q+raOW9jTuiwBa4ca3uzvj1bqFSXtlPmat deNdFVFwPvTnpCfEvemp/eGICtY8kQd4t+jG7KdEb7YPZXjtLGx6o8HPGSvmaQpGqpXs WHszNaKnh3geJHY2LGJBPDNkxw1RA0Bz64yJFEeqaBJTtpNr4btIE6+MQ9GQayphDWSv XWVw== X-Forwarded-Encrypted: i=1; AJvYcCV59nIk/Lo9vlRb7WRyQEiaYU/pj2/6RgT9hBoZW0UrwP5LjJLIslEvLP4jmENKkqCem9I8PTLdeYapLPvTtLI9jwi22gYxPFJNqEN2VH+LzBfqeQbSCKs3AYO77vA4QELw2aVYoQ== X-Gm-Message-State: AOJu0YyFpdClXn4TJXLVAAW6T0Vvu7+LOAQJ7R1pzaAIS+Kjq9YxFsrk y8BMCUUHYVTO8hEydGnaLWWhjXlUObbJUn+SZfapbfFAhtmmLNp+ X-Google-Smtp-Source: AGHT+IE+8OzEl7GN/XD1Evd2s20T59JGOPsfzEjJ78E96nJYaDJAN5YoScVDZUfO86b85wduS8T3cQ== X-Received: by 2002:a05:600c:4a16:b0:41a:5d49:6143 with SMTP id 5b1f17b1804b1-41feaa3873dmr163546945e9.12.1715886509604; Thu, 16 May 2024 12:08:29 -0700 (PDT) Received: from costa-tp.redhat.com ([2a00:a040:1a3:c059:8b18:f13e:da9b:5a8e]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9335sm275834155e9.29.2024.05.16.12.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 12:08:29 -0700 (PDT) From: Costa Shulyupin To: longman@redhat.com, pauld@redhat.com, juri.lelli@redhat.com, prarit@redhat.com, vschneid@redhat.com, Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Zefan Li , Tejun Heo , Johannes Weiner , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Petr Mladek , Andrew Morton , Masahiro Yamada , Randy Dunlap , Yoann Congal , "Gustavo A. R. Silva" , Nhat Pham , Costa Shulyupin , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: [PATCH v1 5/7] [NOT-FOR-MERGE] test timers affinity adjustment Date: Thu, 16 May 2024 22:04:35 +0300 Message-ID: <20240516190437.3545310-6-costa.shul@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240516190437.3545310-1-costa.shul@redhat.com> References: <20240516190437.3545310-1-costa.shul@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There must be no timers on the specified cpu at the end of timers_resettle_from_cpu. Signed-off-by: Costa Shulyupin --- kernel/time/timer.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 2d15c0e7b0550..b7d253d230453 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2658,6 +2658,27 @@ int timers_prepare_cpu(unsigned int cpu) return 0; } =20 +static int count_timers(int cpu) +{ + struct timer_base *base; + int b, v, count =3D 0; + + for (b =3D 0; b < NR_BASES; b++) { + base =3D per_cpu_ptr(&timer_bases[b], cpu); + raw_spin_lock_irq(&base->lock); + + for (v =3D 0; v < WHEEL_SIZE; v++) { + struct hlist_node *c; + + hlist_for_each(c, base->vectors + v) + count++; + } + raw_spin_unlock_irq(&base->lock); + } + + return count; +} + /** * timers_resettle_from_cpu - resettles timers from * specified cpu to housekeeping cpus. @@ -2697,6 +2718,7 @@ void timers_resettle_from_cpu(unsigned int cpu) raw_spin_unlock_irq(&new_base->lock); } local_irq_enable(); + WARN_ON(count_timers(cpu)); } =20 int timers_dead_cpu(unsigned int cpu) --=20 2.45.0