From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 738ACC021AA for ; Wed, 19 Feb 2025 23:55:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D84CF28027B; Wed, 19 Feb 2025 18:55:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D32A2280276; Wed, 19 Feb 2025 18:55:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD3DB28027B; Wed, 19 Feb 2025 18:55:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9ED89280276 for ; Wed, 19 Feb 2025 18:55:12 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3FB8780487 for ; Wed, 19 Feb 2025 23:55:12 +0000 (UTC) X-FDA: 83138352864.24.EEFB2A9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 701871C000D for ; Wed, 19 Feb 2025 23:55:10 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of "SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740009310; a=rsa-sha256; cv=none; b=Nf5WdgYO/Dw/Wo4ba35OYANVZczh1jPj6LF8Y6JOpzmtM8uh7HZsH7mAEbL2RaXhNW/Mfs /8sx77uTuQmFkIl2KjZCNyagYm0OH3QhpVR402z7+JlLO/iopjgCU7v4vJ13KZVXkS/aXG L3An5Lsf5dKE/LWKmKiR6PQQPxIuac8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of "SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Eo3P=VK=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740009310; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AEvp8qkEnoo0bCLRmj21SDnTfFiXxVovzpV7Fx/UXZI=; b=pSMyR+r/ge0u8uk3oF2NftU0VqUDZmwDHjAN606JSPJWOCL8B7P4ArS4Kk17U8hmzkZPmE eIqYXv2Y0hMv+3i8gXcB2MKU+aHbkZr/AQQSQHxeRWqvl4tA4wUgCn1kItqnh+8iEIQThO hIIV5oFK4OZOFqKhcTsala8/yB+TVh4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7D1775C5CF3; Wed, 19 Feb 2025 23:54:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3781C4CED1; Wed, 19 Feb 2025 23:55:06 +0000 (UTC) Date: Wed, 19 Feb 2025 18:55:31 -0500 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Waiman Long , Peter Zijlstra , Ingo Molnar , Will Deacon , Andrew Morton , Boqun Feng , Joel Granados , Anna Schumaker , Lance Yang , Kent Overstreet , Yongliang Gao , Tomasz Figa , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Linux Memory Management List Subject: Re: [PATCH 1/2] hung_task: Show the blocker task if the task is hung on mutex Message-ID: <20250219185531.1140c3c4@gandalf.local.home> In-Reply-To: <20250220075639.298616eb494248d390417977@kernel.org> References: <173997003868.2137198.9462617208992136056.stgit@mhiramat.tok.corp.google.com> <173997004932.2137198.7959507113210521328.stgit@mhiramat.tok.corp.google.com> <20250219112308.5d905680@gandalf.local.home> <0fa9dd8e-2d83-487e-bfb1-1f5d20cd9fe6@redhat.com> <20250219152435.35077ac3@gandalf.local.home> <20250220075639.298616eb494248d390417977@kernel.org> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Queue-Id: 701871C000D X-Rspamd-Server: rspam12 X-Stat-Signature: euj3jp38mttrzdujfyw18yuyjd4ehcqb X-HE-Tag: 1740009310-767707 X-HE-Meta: U2FsdGVkX1/vjRXXAdxO+eVxkdbvnxydevfxHRZH1VO5cG21LYEBCxe5rUJHq7JfTaFd+LpyUgA2uHrzd0FFACUndBDS4+pIV3uJorH2MnZCvD+mmrWwuGCkZc4/YU9Wy8g6LcRqp54LaJEAT/FwYqJ9dXMZG4PSYOr4VCtwQytFTauwMLn5QiQMG9L0H60lfNmKV5i1lGUnnYIXmfMQ4xAGWdghChlnMeUQnvrBPglaIpQT2VS4sRuewYtXg1GmNwQPrBVom/+Ou3GfSYe72HACp89ZWxpZfNd1AlTqq/8twYyjx/yLuyo6toFLvbGJl+6GuwchhvmI6sstNoXcDO6HIUnjo3fAmiR1gbfKff2ELts7S1TXmrvqworv3MosF2euTkr8Lf+1MRcrafkGn0pnIQSIuovnN9i/PKAsBgmRBZn6UIp681lW3atMCn/ijmmPQRaq2tG57sCrzu2zaEBuzWlCJh3bA1HJrvDpeVXvn07JNcd1bfF3zy6SP4CmwFvj33SXHgwoBOhFuTwfwnTGak5YVX2utGjfsrA+cKODeVEvUNE2I2D+tSQbWmFMf2B3k4aJO8PvfCsKXYaWhGa+hhuNyIni5Q505f7VCkmgaHZy55U2eoVPI8SaEgRLF4T57jCAN1VK2LrmuEWvpRDuUrREtGMoKFtlIXGpH9/JN3QXsjp5RtK6RAalPGffwkLdIDl2Wyta+Vj+hpKuDD3+KGqfrjIG/9rfWs2RkoPNDzW5gZMGgfzsnQlAsSRmqD1riUBJYX8BiuDhRaWh0MRNWWmp1f2J/n3LiJOQKVwyZmnMr82cI1w9M+8odTJa0qs1Lh24K30I+6vsCCkJHb9/GuQiwREZlzcTz1AGVD2TFJDrB2vZDP46RR4in8qHPGv9SIpukBxhALf+j/YzWW5l6yTJw5IQSegY3gW0lyoJiQwF9dYA/wEuS3vvlofvd5B6vzjxwEGhaBvaDh5 Fe7BkYyN zTtMku79AZj/u4G3MtZt/C+32oFrHeqCKUjRutsOaBHFewXOhyZFGcpemoqoRPkMH0I1S0Qdhhzbl6gKD4ujirpkQCW9iiWVSy8xNqa8mfpENbXm+j89WdSbUdh+mrUEPG+YmGWnQkh8/1aIo9mMGlrpEN5xmeN5l2Q22RvTtttzrJPMXSDU3OEvDqhANLi4p8OeCri9ShvOLH+h//gPeETBNxXSkufxdfBADvu1RUCgx0degcHdUFnkIn5wPXAUogB9mOuzYAkzrCW0g7Uk9csM6WVCcMnRW5mCDBukyEMTIsb+Zz9G/vJp7s9wN0/DcqU+a19tMH1x4T1t2CmmudqqlYCebgeMJDKWXqZU12foZAR52+nhMW+ulfBPqqFd6NMqLB4Wy9qSv5+4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 20 Feb 2025 07:56:39 +0900 Masami Hiramatsu (Google) wrote: > > >> this field, we don't need to take lock, though taking the wait_lock may > > >> still be needed to examine other information inside the mutex. > > Do we need to take it just for accessing owner, which is in an atomic? Updating the task_struct would be in the same location as the blocked_on is anyway. I would make it into a wrapper function that is a nop when disabled. > > > > But perhaps if we add a new config option for this feature, we could just > > > add the lock that a task is blocked on before it goes to sleep and > > > reference that instead. That would be easier than trying to play games > > > getting the lock owner from the blocked_on field. > > > > Yes, it could be a new config option. This will be a useful feature that > > I believe most distros will turn it on. Or we may just include that in > > the core code without any option. > > Do we need another option? or just extend DETECT_HUNG_TASK? DETECT_HUNG_TASK is just that, for detecting hung tasks. This adds more information to that, which increases the size of the task_struct not to mention adds code in the mutex/rwsem handlers. I would definitely make it a separate config that may depend on DETECT_HUNG_TASK. -- Steve