Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1493245lql; Tue, 12 Mar 2024 21:50:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCcyrMIOXni1gHQRrZzcOOmwEnB4Mvu+PAs88xDjcmumrO/+mNmxlRLmLFv2tRQZ7TfaUTJLAlSdj/9AWZBmzdnK/gbfR1B2oZnj4zJw== X-Google-Smtp-Source: AGHT+IGftTP0iKMkN9wCknNku2ga/9YgmKlDjLxF2X+IwtA1DgS14GqWzsmlNXg4ZzGddld/Wk8h X-Received: by 2002:a17:902:6f16:b0:1dd:707d:5ff2 with SMTP id w22-20020a1709026f1600b001dd707d5ff2mr8811197plk.29.1710305445885; Tue, 12 Mar 2024 21:50:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710305445; cv=pass; d=google.com; s=arc-20160816; b=G8eoy47ACaHTDeA5CNYyDvUQfyG/i9qv3KyzitkKGPyb6bMmOMdb2QwAWhor+LTLUj 6S+0h0/X7seE56ehedJfQrKrZkDCsLgy/SX0RymRbLvthSnrhLZiQjZAxgExhjFw/HTQ 4Ow+f68YP55VyrPiDFtuZ0KLyj0KpNf8c5JM9C/borTW/ymj69UBcURG4XRPw3cqFki+ eABrJf+Tb8Wa+3hnjDlOGTh7bt6ZKrPa3ivNrY9i69csg79+tCgQ9shYvxABFyPVaoH/ BwmAxmiBTZdXkJ+R20dHQeDFshfH9Ths1/Nin5hUNWtQfzlv25gLkf45p+GqA4qnjz/U KoYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=hdURf2+D6b6wN1i849F0qpjoi0tt6fdpM+XzqHCp8oQ=; fh=kKP2SJboSKEK4o/9qRgCEwfQWN0KBpcqVZ+VIXuI7eA=; b=EvZzGd/JNhBrA5iaCOi5bGgHTHdl/LKHTY4hyBfGHQ9Y5rJNY/mlQUWTrKK8dDng2f nmVCwHj2GrRGA2a7pebsWZycxnbSFjh8+DxgUJTpmKX9pfZvh6xPgitAiu1IDnsOmN7k G72OfHWSIIhkvK1mYWFxeWzb+y3jBgCtMHlYsz1T5zQNORkif1jFv0/eAnQZs2nGeSz9 mjrLf5B6O4AaWucjqRWSnJxxJPB04UHewQuzuWLHbmWTfo3XxRiJaV3j+EmsXG6sLejq eS7mKzZH8TArDOHWluBOlX/5raEUzDtnxsoQO9vz7kzI+Tpt/PDg1feVkmNZF16ZXX62 3y7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="VPwQh8/D"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-101106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d14-20020a170902cece00b001dda03c8fd2si5099074plg.605.2024.03.12.21.50.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 21:50:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="VPwQh8/D"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-101106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 80AC9B21A78 for ; Wed, 13 Mar 2024 04:50:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A284E11713; Wed, 13 Mar 2024 04:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VPwQh8/D" Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 7AB32D2FF; Wed, 13 Mar 2024 04:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710305403; cv=none; b=ut4vdD+TIth9+mxNWEkwc9SIR4tzeP0BLFEvQnZoSGPSiuYjGKiofKs52zF6iGuhpylG6Cd9yQJos5rrYn5jLeXM4RqyTGJLtPtzW9Pz3oXQcnJmg+BxsG2BP91y9lOPI9Elhtf8jzgQeYApOnYQnTBtZ/5aKjBVL9EhPT382fs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710305403; c=relaxed/simple; bh=WwxG/B0gshgsTKOw4me1Uj+A+gU2SI72ZWI+5GdfXWw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gacNzcvZZWqrKZHDzA2vNMMc+TmHPl05YzLKN9AMyzHoDgrd20G+YyUMCMQU1/AXBZQeQwWV0nFHDzCVCphtG+Us0Cma6MBQxzyQp3UTKhEc0ItJonf8lBWQz4VESmlZa63XdKVK9I+kooK+Tuaa4rMv4ORiatNSmUzm1YfwQ8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VPwQh8/D; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-29bc1c64a98so2986799a91.1; Tue, 12 Mar 2024 21:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710305402; x=1710910202; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hdURf2+D6b6wN1i849F0qpjoi0tt6fdpM+XzqHCp8oQ=; b=VPwQh8/D3k9He+eRjw+YW1Bx8j6+UrCSebX7jYbXbWReV/KRxB4ZjAxOfomrwB4zd/ YJKdINMNZKHRNHabz+rB3CvbiXKykdolu571kAv3h+fVCOfU4gKVHoMSB4puuEDPeXlB 4Z+CpAxdrJM05TZxdUJ1bXte/T2FkEsr7xTljWgBkKAz7lK8ic+IuWTbzsu0wnX7nBJD pS59Bk9HELPLmZ7O/aSrOJ7CB1k2U/Ms38D3v4FtZfxllFBnkgoPO2ArGVzbDBjgEQfH UALJLMtzUSusgp9ryc3A23r+LteeUwQSGboDAWEhQ1RZwynM+rB7eS8s5WX6XQf5AClv 3mIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710305402; x=1710910202; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hdURf2+D6b6wN1i849F0qpjoi0tt6fdpM+XzqHCp8oQ=; b=Gf9qytI3gsJ3DLSZ6quvtsv5exyN2DkoU1VBDQgMvRXGEYzIwLqI7SlvyTS/1INIxQ nvbzyT1zb1T/ZafTe30lapcee89IITLzuHv7I93+vnBwgbgpMLbk1EmXaorl3z1xrNPF IeniTjQSzhIXWImN6oRxDTLUUdqcmf148dQ2WpE5CDikDaAm+7FyEFgpV+L5nOlxOlJ5 wbl3L8Z2gYjAp+6gaTQ60j3Bqtc9K8ECmQDBfuKSce8evy0IApGJyA9mV71b6RKdbGUD pl0pXHsxkjqgkmGVJL37qi3sxfw0Wqq4ihawPiFRCmaWqNoHM/gteVtPkdAHOS77NxHR dbEw== X-Forwarded-Encrypted: i=1; AJvYcCWSJ3o/yZ4PTTXFSgZ1pfObflBtbIHXYhmle+m/DFBFClMQ+kBJlkMf9B3xZ4D4QHLCtfn/g7prHBrcdvJLgcB2N53/aaf7aU6lUFyA3QvN7mVl4Q5EvB5mG2CqyoiNmnKF X-Gm-Message-State: AOJu0YykqGN3TyMwbV0M4YyipslgopuuKIFXU9YOG/MbrJLGp245FQb0 pMcf3+kOUHbrsiX2OGk4qpfGHXtkN19YnzqOAhRKkwXFEh9oFwr0fmcTM0pxfkQM1I0t3h9KFBA Gl9atFntzoBkwELAStXnQjbdiRnc= X-Received: by 2002:a17:90a:ad82:b0:29b:cc7d:60cd with SMTP id s2-20020a17090aad8200b0029bcc7d60cdmr7650977pjq.32.1710305401722; Tue, 12 Mar 2024 21:50:01 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240312113524.7654-1-qiang.zhang1211@gmail.com> In-Reply-To: From: Z qiang Date: Wed, 13 Mar 2024 12:49:50 +0800 Message-ID: Subject: Re: [PATCH] rcu-tasks: Remove unnecessary lazy_jiffies in call_rcu_tasks_generic_timer() To: paulmck@kernel.org Cc: frederic@kernel.org, neeraj.upadhyay@kernel.org, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" > > On Tue, Mar 12, 2024 at 07:35:24PM +0800, Zqiang wrote: > > The rcu_tasks_percpu structure's->lazy_timer is queued only when > > the rcu_tasks structure's->lazy_jiffies is not equal to zero in > > call_rcu_tasks_generic(), if the lazy_timer callback is invoked, > > that means the lazy_jiffes is not equal to zero, this commit > > therefore remove lazy_jiffies check in call_rcu_tasks_generic_timer(). > > > > Signed-off-by: Zqiang > > --- > > kernel/rcu/tasks.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h > > index b1254cf3c210..439e0b9a2656 100644 > > --- a/kernel/rcu/tasks.h > > +++ b/kernel/rcu/tasks.h > > @@ -299,7 +299,7 @@ static void call_rcu_tasks_generic_timer(struct timer_list *tlp) > > > > rtp = rtpcp->rtpp; > > raw_spin_lock_irqsave_rcu_node(rtpcp, flags); > > - if (!rcu_segcblist_empty(&rtpcp->cblist) && rtp->lazy_jiffies) { > > + if (!rcu_segcblist_empty(&rtpcp->cblist)) { > > Good eyes! > > But did you test with something like a WARN_ON_ONCE(rtp->lazy_jiffies)? Hi, Paul + if (!rcu_segcblist_empty(&rtpcp->cblist) && !WARN_ON_ONCE(!rtp->lazy_jiffies)) I've done tests like this: 1. runqemu nographic kvm slirp qemuparams="-smp 4 -m 2048M -drive file=$PWD/share.img,if=virtio" bootparams="rcupdate.rcu_tasks_trace_lazy_ms=0" -d 2. insmod torture.ko insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 3. bpftrace -e 't:timer:timer_expire_entry /args->function == kaddr("call_rcu_tasks_generic_timer")/ { printf("comm:%s,cpu:%d,stack:%s,func:%s\n", comm, cpu, kstack, ksym(args->function)); }' The call_rcu_tasks_generic_timer() has never been executed. Thanks Zqiang > > Thanx, Paul > > > if (!rtpcp->urgent_gp) > > rtpcp->urgent_gp = 1; > > needwake = true; > > -- > > 2.17.1 > >