Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp584840rdb; Thu, 22 Feb 2024 12:46:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXI3gj4qef9zHnRIOIeZGsmUqyQeiymhIpw0/BAfhlHZW1PprKazcmVtB8qCz1YbzQRzOr98N2TvSwG+fIB4jEd4/x+OlgV9K+UfV/6XQ== X-Google-Smtp-Source: AGHT+IG3Y+ZEKgI5LLNZAcxozChXVNQl2FWjIc/YtY116V1+9kvFoVo9Q6GEg/9BBmwBnmKOgipJ X-Received: by 2002:a05:620a:1a82:b0:787:a306:feaa with SMTP id bl2-20020a05620a1a8200b00787a306feaamr158477qkb.27.1708634773339; Thu, 22 Feb 2024 12:46:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708634773; cv=pass; d=google.com; s=arc-20160816; b=eTeG5aM+1pC3PO6oxTr2yqaa4Nvm8fX/xbgbsMugIvtFuqgQOpqALqp8F4Ld+r8x3n u0WPow4HfjDdhfylFDYQO2usl76Rvh+cDzx1oEKnj/AKfAEPGr9MFpy2/Klzsr6C666c VrDxcMdWI/1pgF1G68oNJ+ljDwdwVVZ479ICSM9b9/1vFDJl/jjXJzzdIARz4aNPSp6u G/+dFRq6BOsZp5DzluLf3k/L2CvOMgDw6/DmWNY2ofaRZcINRmgZaTYA/vIIP8Pdyp3o NugjgQdyLzFMhi81p+iywztF234euPribpmnrq0L8RtXelN8Fb8ddKoTnyPdIN2IuLpb KtKw== 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=tzSOpJpImr2vFjXsHXbd7vGbFCj+mWfxsQrIkDZ+SUg=; fh=G4e11n510c4MNCW7QhEKm/PSIlB7+l+IsE6v3acieBI=; b=KXNQxiQTwmn6JqwB+cmfAExXVhP8hnljGrdSyRvAC1Mi0D+G0NU4QhhyL4IItoD46G PI1r6r7bF5xwkRt78thXO0KH/5IlE7EU91yRZ94+tcxr/VI6crpiTVXrChuhFTJrg+0D K7bOk1cDIdm67gbTjd8eM5rUQx/s+IsYH287WDS0PZ3TJWQ6K5402fPjYdywBjpb1AJr fds8gVR4+NuOSdtD5wfRf7dSq8QVKO2XSzaOIOQQAgn9hZFRi2IDuT6c1DEYGouhzdMz 6vU+awT937BxTFs6wYpUplUAskQJTAr5equcwAt8s68o4v6rnfrvqu5sqcCy9MYkVhfg Nu6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S4d+tJLJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id br11-20020a05620a460b00b00787879dd09bsi4537979qkb.570.2024.02.22.12.46.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:46:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S4d+tJLJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77332-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B05951C24E1E for ; Thu, 22 Feb 2024 20:46:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F10E371736; Thu, 22 Feb 2024 20:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S4d+tJLJ" 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 1D62F6AF8B; Thu, 22 Feb 2024 20:46:04 +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=1708634765; cv=none; b=hFRk4LWBaUhSQStJ1776JyhF54OgIVlKorX33DRKIKqw3QaCHxmI+OoiGMXJnFgXlgn1aH2FUDmLLfdAQF2sfpRbCBqXS4YoZWJKpI4TnHXCBiST/k+ert21dJWSX5rkU/GGN/W5RGAnlxmgt83Oj43KZ7eHasBxDZpe3rfqgTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708634765; c=relaxed/simple; bh=5HxuEoK3YkrACdtWuNiKltFl3vPUbSE33TPRYygQcuI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i2m89ySRgZ1zIqvA3KdKV9VynimPVrWCZyM5Lbv4zVEKunWbG8muXN6d2eaawa77Q1XLvUOWZdp7mhu9blFIXGY4o5VZ7kEbKMM5rkf6FvYm2pmogyPtM0D/vQThSQruyj23ghNJze4NXuTioteJoGOTU5AkWuTUiD94pwhwgUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S4d+tJLJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E36EC433F1; Thu, 22 Feb 2024 20:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708634764; bh=5HxuEoK3YkrACdtWuNiKltFl3vPUbSE33TPRYygQcuI=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=S4d+tJLJaY1a/gKVk4dRG215qcKo8JvQq8+jWscR74XlXY+Avpc8OZwPBL4H4PoZH zKhCxYf27GZFV6MN2P0+fMd0aDO1iOj6h+l4EapJtKco4TCkULKEoWQRz3kIZa7vvB QG2QrI3G6ru3XtEfqQ6vdSksQQrQPuP6B51muEnLpqelwbjuXau6Hjdt/U4A+RMJYT tLRvWoPMimVUxY83pLUBJSDmKr4NjGlWkwK/so/zLMVSFtj5fwo3Ly8wW67MfiAr8V 2RKwtS8Holtahqpe2Lg1d87jNm8/4qorKPc3vuSX1WlQDIfYVqCqKTK7tGWHyKEnTT 60OqniFzdQdVQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 309B3CE0738; Thu, 22 Feb 2024 12:46:04 -0800 (PST) Date: Thu, 22 Feb 2024 12:46:04 -0800 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: Boqun Feng , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, Neeraj Upadhyay , Chen Zhongjin , Yang Jihong , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: Re: [PATCH v2 2/6] rcu-tasks: Add data to eliminate RCU-tasks/do_exit() deadlocks Message-ID: <142b955c-5984-4eeb-b170-9cc516f90131@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240217012745.3446231-1-boqun.feng@gmail.com> <20240217012745.3446231-3-boqun.feng@gmail.com> 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, Feb 22, 2024 at 05:54:48PM +0100, Frederic Weisbecker wrote: > Le Fri, Feb 16, 2024 at 05:27:37PM -0800, Boqun Feng a ?crit : > > From: "Paul E. McKenney" > > > > Holding a mutex across synchronize_rcu_tasks() and acquiring > > that same mutex in code called from do_exit() after its call to > > exit_tasks_rcu_start() but before its call to exit_tasks_rcu_stop() > > results in deadlock. This is by design, because tasks that are far > > enough into do_exit() are no longer present on the tasks list, making > > it a bit difficult for RCU Tasks to find them, let alone wait on them > > to do a voluntary context switch. However, such deadlocks are becoming > > more frequent. In addition, lockdep currently does not detect such > > deadlocks and they can be difficult to reproduce. > > > > In addition, if a task voluntarily context switches during that time > > (for example, if it blocks acquiring a mutex), then this task is in an > > RCU Tasks quiescent state. And with some adjustments, RCU Tasks could > > just as well take advantage of that fact. > > > > This commit therefore adds the data structures that will be needed > > to rely on these quiescent states and to eliminate these deadlocks. > > > > Link: https://lore.kernel.org/all/20240118021842.290665-1-chenzhongjin@huawei.com/ > > > > Reported-by: Chen Zhongjin > > Reported-by: Yang Jihong > > Signed-off-by: Paul E. McKenney > > Tested-by: Yang Jihong > > Tested-by: Chen Zhongjin > > Signed-off-by: Boqun Feng > > Reviewed-by: Frederic Weisbecker Thank you, I have recorded your three review tags. Thanx, Paul