Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp226318pxb; Thu, 25 Feb 2021 00:23:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV5KBTTno3UaJZAPajimT6zOZ620HaHhJME6D7f6WUvxy6Qnt10+O72baFNW0405kcq6t6 X-Received: by 2002:a17:906:6dd2:: with SMTP id j18mr1622832ejt.480.1614241420474; Thu, 25 Feb 2021 00:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614241420; cv=none; d=google.com; s=arc-20160816; b=qJosD1P6sIrgWYX396A0uzVJS/cl2vrXFlUiCyoClh6zUqnn/2GRqfYXd1OUIxoNsQ fvF/kRNuW1GJoDaxnIC7sImnrP4ilP0ikiAAtYC8jMhMkg1VW0Ckt8lQXMPSfboIK6Q7 6rrvIsXCGoMGmHUfxjQBrZcnFMibnYVAquWaqv0LYChAQ+hpuvfgN3GY79DGSkg3Y3x9 SD/55LYA4ORrUdGn1wgLmBkEYVAGqcXBvIGb98Vq99YcyaZMNoGQBpSDzz5/35qg67M9 BrX3f1+x6pOdbRRcLxyyQmt24nCYA+S1mUGyl4VLgfIjJJHK5KDL6HX5bwX4oT1z6WCK j7JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=68WvU6dZB6wfp/pWyLq9ADh9neuhi/AO3vxhEuEpZLU=; b=x5Wohr3SwmmTyzsRfhMLxzVRlhkMtdwcaWmZRvp31BgTcTcwKC2tNAehZGPAKDIVQV 4QmsioERMdsuocTZR9w4pnR09UGfrKtZ48Lgyrce09PZy38sSjWgcEmLtW0VXC//5hhR trdItiTqy7/g8vCZiEaK5ud7p4QJBp0Ff4g+F4tXspgIEnHHb34pu/Y21BMkswYqmMfr /kGrWBrLqRc5ONrEk+xI7lw9UuJfwrdZjQu0xNOzFZgrbLsDxxTkesXOcHfvY0d9Snui HAf75TwZwA4di02UFmxfjNHSLHzN3O5WBCDN+KHuqv1AK/vfzqP1R/mb2o0SsetWFfwz 8meg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YnciVnY0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si3017304eju.664.2021.02.25.00.23.16; Thu, 25 Feb 2021 00:23:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YnciVnY0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236424AbhBYAtB (ORCPT + 99 others); Wed, 24 Feb 2021 19:49:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:44222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236421AbhBYAs4 (ORCPT ); Wed, 24 Feb 2021 19:48:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 684EA6146B; Thu, 25 Feb 2021 00:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614214096; bh=P6YhKinu23PkPP/k4EIifcZhpqaz7+hAFMZPWD9ydqw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YnciVnY0U5Lq9txw9Utq5s5oIj/cjMLXbwnMAK2V9DohXcNKzS8uCHJUQhznFjpca SOt4TnUjtzN0nUxG/3R5/RvH1c4lFEBzxDOSQlGddaihTng6zuMFANX0l2VswfN/2n lMKDxUZqdfTDvPBMvQYlxBMIdFEVV9Ozi9AyuErQVfs/8V/ex8knfPBDHSWuF6CxiC hEOsWkVWLMeb7vPosjtLQDcONJ+D5oQCVBrVzZzWZj2JRwHDLJCvYne4YLP7a5jCkh pQi0YTcX7K8JFWbABg3BfX2guAOLVmqb26SvHsQRYUa5c8fUrWleJiCuyLauiNbved onePSotlk5WBg== Date: Thu, 25 Feb 2021 01:48:13 +0100 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: LKML , Thomas Gleixner , Boqun Feng , Lai Jiangshan , Neeraj Upadhyay , Josh Triplett , Stable , Joel Fernandes Subject: Re: [PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm Message-ID: <20210225004813.GB12431@lothringen> References: <20210223001011.127063-1-frederic@kernel.org> <20210223001011.127063-2-frederic@kernel.org> <20210224183709.GI2743@paulmck-ThinkPad-P72> <20210224220606.GA3179@lothringen> <20210225001425.GL2743@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210225001425.GL2743@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 04:14:25PM -0800, Paul E. McKenney wrote: > On Wed, Feb 24, 2021 at 11:06:06PM +0100, Frederic Weisbecker wrote: > > I managed to recollect some pieces of my brain. So keep the above but > > let's change the point 10: > > > > 10. CPU 0 enqueues its second callback, this time with interrupts > > enabled so it can wake directly ->nocb_gp_kthread. > > It does so with calling __wake_nocb_gp() which also cancels the > > pending timer that got queued in step 2. But that doesn't reset > > CPU 0's ->nocb_defer_wakeup which is still set to RCU_NOCB_WAKE. > > So CPU 0's ->nocb_defer_wakeup and CPU 0's ->nocb_timer are now > > desynchronized. > > > > 11. ->nocb_gp_kthread associates the callback queued in 10 with a new > > grace period, arrange for it to start and sleeps on it. > > > > 12. The grace period ends, ->nocb_gp_kthread awakens and wakes up > > CPU 0's ->nocb_cb_kthread which invokes the callback queued in 10. > > > > 13. CPU 0 enqueues its third callback, this time with interrupts > > disabled so it tries to queue a deferred wakeup. However > > ->nocb_defer_wakeup has a stalled RCU_NOCB_WAKE value which prevents > > the CPU 0's ->nocb_timer, that got cancelled in 10, from being armed. > > > > 14. CPU 0 has its pending callback and it may go unnoticed until > > some other CPU ever wakes up ->nocb_gp_kthread or CPU 0 ever calls > > an explicit deferred wake up caller like idle entry. > > > > I hope I'm not missing something this time... > > Thank you, that does sound plausible. I guess I can see how rcutorture > might have missed this one! I must admit it requires a lot of stars to be aligned :-) Thanks.