Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp524826lqt; Thu, 6 Jun 2024 10:08:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXdHmGvXbFAngZkJJsfG8w11BcJb99Bgrhbck12OpqXQNSzAI3MM/635Ls/qI96oksAQ29wPLnPrg585PZGNr14pK57gb0B8PcxfxFeTw== X-Google-Smtp-Source: AGHT+IE0iCDyzMULYDr2ftqrfz7d0vsRZQAKcCUImmHyxmwETL9BVqYpMGLqlmTkP8ce+wwSq222 X-Received: by 2002:a17:90b:20c:b0:2b2:81c0:268d with SMTP id 98e67ed59e1d1-2c2bcc77302mr113059a91.43.1717693738515; Thu, 06 Jun 2024 10:08:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717693738; cv=pass; d=google.com; s=arc-20160816; b=bPn3SNKbDP9eLEiu4Ga8R8Txs4y4tR8z7A2IchhlnkQCGaxKMRQcV/gcqaGA4PQtpI A380OOOcn/4o5ruNERhUIc2In1WvStSki4IEz+NCTHp07FWvC8/Pbd62uH8QBco7hXcc SX9WdwQBe8OnAmYMJPg7ENBQvU72nznRcpnTYv7IImQCUoB0WGP10SZQZZdZx2r369E4 WrzsPIoo7bbwD2OJygGZYblYK0OpUFuWFkmC8ATNz8KbmHtdCHHRY0XMMiKKvY/EPvSM zPg9XLnSQ2VFGkjxr5uKmUDhLKSHs+oNQX4cn/fUI7gestolPzEbvf9c1OD8Qodu6bvl bVEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mossFrfLBIFS5TeUwJVxWGUASOFeK4FGEjDFWEjUtm8=; fh=2ulWwCUcR0s/Jg1Y5DAahgqjK2ziD3eP4M/0RXXJMZE=; b=YWKX5uMMfgVfEdtj/2MjLm03/BG5cG2S5/buqFrSnGpgpWkJ50rzx0ZeolQGx/VPpK KAxRRF1TTur3UP//AMnzmL7oe0L7zI6Tv9BHefpyO5Z/4dWqtHRBrV//JJTF+m/fGZj0 dDX+jBaYvu0DbsMbx9QpZLqmIt61NiyGA/Dby+DUIVbcbtRuafrZvSzvu64aI3WFyUtU 7+aIDPO7QwljVePjqlFRkbIcQbMfW2yKYVcZDV0wfNNxjkLuwZ++8CykN82OZCnt4wVw e7ZrWz+aTh9D5+KKBndYthvCILzHm9hbH44eBa6LUYC2lSypZdsoh/p64KMmrv46ocPu YM3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e3yfbXCA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204731-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204731-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806d2a38si3356953a91.147.2024.06.06.10.08.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:08:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204731-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e3yfbXCA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204731-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204731-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 B1BC628E60B for ; Thu, 6 Jun 2024 16:50:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46478198E8C; Thu, 6 Jun 2024 16:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e3yfbXCA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 69D3E198E88; Thu, 6 Jun 2024 16:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717692600; cv=none; b=WwOaUKXeclN9obyHduYSEO/bmQ6JeTpEMbXabr1dTo5xu6dpyjMm1/AU53yr9QBp4C7gR/pO2VmaD25DbJfp48aemIAgU8HrGGSYFJxwmplUcarDUYusiEzgnhExKdjZ8xEtl9W9AdKBof6F6GVrZpVJ1CJNt6VVcIpYeCF6F8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717692600; c=relaxed/simple; bh=Hg4pytPcshJ5Vzw0x241oxxxQys6HoLuHWw6mFPLn8E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SWhIiDaJuuBVMT6fRHBFGdV6YI37uyHdb+RLz2Fjf3x4ZpjL7O45oQvtSK/TEgbyHpOSNN49XobWUg7IOQrk/zAfJ0jcFN3IVNQS1VZ3+zdJKqToFrGPlfmrpbkD3gQYqra1+P/dbdvMnvdEL7vy8G2E6yG6Ehva37+eP8T2VqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e3yfbXCA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED54DC2BD10; Thu, 6 Jun 2024 16:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717692600; bh=Hg4pytPcshJ5Vzw0x241oxxxQys6HoLuHWw6mFPLn8E=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=e3yfbXCAXuC3R6OV8jc4OSsJCSGMdLDXIpC9Mg5QkQkblbPsf/ViCa/8PdzjmhzBN e9hVL3PeCaJCFkn00KUNpywqYQhDaXS1WOTriYDioxkcEI4cpbEaL2aiSzEq72MqQR CTrlnQ1RQKL5rI+kqUL8zSTJkVz6mF+P11dl+XpVOnSh/m1nR/z79qUID/TEZaJzT+ zfhYkqgAmlnbbNWZu9wAtkxJzMBfMYeb5y1aZSRUsvPMTmdkxm1GeSSSHfU9y3JNX1 MOZP8/42JlzXe2uy5WxvHNn9D+HDxzDGtakyXjG0Z0gAAUu8LSoYgq/xO1XBRLW6HU LOzr8KkKPkzYw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 88570CE3F34; Thu, 6 Jun 2024 09:49:59 -0700 (PDT) Date: Thu, 6 Jun 2024 09:49:59 -0700 From: "Paul E. McKenney" To: Neeraj Upadhyay Cc: Frederic Weisbecker , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org Subject: Re: [PATCH rcu 2/9] rcu: Reduce synchronize_rcu() delays when all wait heads are in use Message-ID: Reply-To: paulmck@kernel.org References: <657595c8-e86c-4594-a5b1-3c64a8275607@paulmck-laptop> <20240604222355.2370768-2-paulmck@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Jun 06, 2024 at 09:16:08AM +0530, Neeraj Upadhyay wrote: > > > On 6/6/2024 12:08 AM, Paul E. McKenney wrote: > > On Wed, Jun 05, 2024 at 02:09:34PM +0200, Frederic Weisbecker wrote: > >> Le Tue, Jun 04, 2024 at 03:23:48PM -0700, Paul E. McKenney a ?crit : > >>> From: Neeraj Upadhyay > >>> > >>> When all wait heads are in use, which can happen when > >>> rcu_sr_normal_gp_cleanup_work()'s callback processing > >>> is slow, any new synchronize_rcu() user's rcu_synchronize > >>> node's processing is deferred to future GP periods. This > >>> can result in long list of synchronize_rcu() invocations > >>> waiting for full grace period processing, which can delay > >>> freeing of memory. Mitigate this problem by using first > >>> node in the list as wait tail when all wait heads are in use. > >>> While methods to speed up callback processing would be needed > >>> to recover from this situation, allowing new nodes to complete > >>> their grace period can help prevent delays due to a fixed > >>> number of wait head nodes. > >>> > >>> Signed-off-by: Neeraj Upadhyay > >>> Signed-off-by: Paul E. McKenney > >> > >> IIRC we agreed that this patch could be a step too far that > >> made an already not so simple state machine even less simple, > >> breaking the wait_head based flow. > > > > True, which is why we agreed not to submit it into the v6.10 merge window. > > > > And I don't recall us saying what merge window to send it to. > > > >> Should we postpone this change until it is observed that a workqueue > >> not being scheduled for 5 grace periods is a real issue? > > > > Neeraj, thoughts? Or, better yet, test results? ;-) > > Yes I agree that we postpone this change until we see it as a real > problem. I had run a test to invoke synchronize_rcu() from all CPUs > on a 96 core system in parallel. I didn't specifically check if this > scenario was hit. Will run RCU torture test with this change. Very well, I will drop this patch with the expectation that you will re-post it if a problem does arise. Thanx, Paul