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 40FE1C021B0 for ; Thu, 20 Feb 2025 03:11:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BBDF7280290; Wed, 19 Feb 2025 22:11:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B6E2E28028C; Wed, 19 Feb 2025 22:11:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5CCA280290; Wed, 19 Feb 2025 22:11:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 880D028028C for ; Wed, 19 Feb 2025 22:11:23 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3154DA19C7 for ; Thu, 20 Feb 2025 03:11:23 +0000 (UTC) X-FDA: 83138847246.20.6E51029 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf26.hostedemail.com (Postfix) with ESMTP id 57D33140009 for ; Thu, 20 Feb 2025 03:11:21 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of "SRS0=7baa=VL=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=7baa=VL=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740021081; 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=IbJ+wL32Kc0PqfaxhoK08+oXTgEeD2RkZPbjCnjWYzg=; b=BFx1xD+B5fXpBsbUSmO0G9Wm/yVCluK6g+0EmGmNxheo/yAxSqI2chruFTsd4HqE7GpZqp 7Ciz1JQctWuxLOQgk/TCKkdzOADRvY8KGovhHJHOis6C1IGSsjL5VjKScgGs3+jjRwidUg EgUJpZQ/idbyKD1wnkixMgCro2njFL8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of "SRS0=7baa=VL=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=7baa=VL=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740021081; a=rsa-sha256; cv=none; b=ryS2DbBYKK3NLTYzi7pWefr2HOZfC+ysgNAf82jR1QtjycQQ1uLVTbi1zuXV57lhAJYGO8 +6qN20liOzSenNN5ca6AWQBdmAWI7/1O/bkCHKRcFU+/kiwrKlZa1BqdQ2RKv6Rws7x2tG c4lDs565sg+6horX/6odKmWAfXiTxJY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 45AD55C5D13; Thu, 20 Feb 2025 03:10:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72CEFC4CED1; Thu, 20 Feb 2025 03:11:16 +0000 (UTC) Date: Wed, 19 Feb 2025 22:11:41 -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: <20250219221141.09f9fe48@gandalf.local.home> In-Reply-To: <20250220114036.e22e388402a00f7809a81dee@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> <20250219204153.65ed1f5e@gandalf.local.home> <20250220114036.e22e388402a00f7809a81dee@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-Rspamd-Queue-Id: 57D33140009 X-Stat-Signature: omg4zbf4i7ew1x83np9i5cyz7foytrfy X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1740021081-586497 X-HE-Meta: U2FsdGVkX191L9Q/S/1Ooe2zZQS8raFPW9kOF4Ozn9xQv+87gqJyobIW4eNEU0A6okkPlwYAbmI4xtCxtKMEYNA4eFhUN8FvtgtioABhpPhAWxxr82Y6xDAyUyVTDofvm3cUUdKopuNyORyP4zDOAQIM6vtV7Pz/YIxcI6N9Fkgr1HZfWH+ro/HyYgeK8wm76j1tE7Zqy20/MsnjsHg1/sO5sbfngO67rB2eGNOGx/CINF9yrb5jlsygEg3m4NkIF77g5z90bOdp0EyYfJVRpV/ZVH3yw9HPLJQbvdysTqfHiR2Akz1rZumJ8BFK0cldQJUJNcyUQQGF1mDu8BJMMIl6NnWwxIgCWVl0wviSQkminFAOLWMcK7RFosD7IbtZwLuixUSN9RoOL1bOEFXMl18VS3hTw0V9yDEEm11QaeRs4OUHGC5ejGgRMS4jsAyaKc5CVZLN0KVmdE2aTtV+gJUqjDi+oK36JK+fNvhr+t9Z7CV5oyje4D3yyS2HT9uw41kVL4EuQyaA7PIavN8gpz4XbhlC2GknIebOIztHBkyugCsXNNpWZBUVOiPuc7x03tMbl/0IuUFz7fechKcRLyNNPS52/oTxwzZ5Y8Mezb4AfyGKQH7NCKas+Ljf9nEAmfagPXdbnBhsMmP37yb7oXqCjQaod6zkaVA62ga6HH/k0JFXSzmpbLYKyLJWPtUTndTfD3ev2o+tp3S9Cc31jMxzMIhTAAZVq9CQc8Us7LUeCLEUW2gEqU85L44to+kd3O401r3cgx0kr9DNbM9lyGThKCYLqwFE8tdXb3dacRmv30E4TE0TLLcDSXslcGvWIpxKlr1P1a4bSEBHm/N6Dr6kmeGDpaP1jRq4w03vImBUfbu9O6K+/UHhxKE7VZ4TZBEHwoPgQJko5uBjU0+E60fxlRnV2nywG6nMZ1/vu4ZeLYOgqbbOtyjRYVn1vtV44B391i2TyStJDpN7YPU KDdN9+ld 5nYoRWM6bluUGRdzI8Ei4dqw4K6nIqWbtW8ok5XTSnOFLHUKRTUFu89Z6EsKRQLz4FC7nHshExOkckeH2kn+IvyOjVEOJZ53I4ZC2+1cUv3S8nnE+WoFANyiUldTOd93FF1EawAKyO9rY39H1jG1QpNNoZlKDjTV1sQTaxSw5G2Fkqfk8knPVCSGl1R3x8vreJnt/nE7icLcMFYMcK5wj7K0peniDiMBXJaHY76hlvAckUjgP3/zbhvyfiZLrXeljraUyAQJKyGV6RE85WCPlOlJAuipTj0zKUsQBBJfP4qorQpAhQThW9hgtq0/ZMmPzjBYpvrbTallr9RdeKop1HZbY5ST7nSQSQF54V8cpEDRgZi5kZFwQ0fLyc545EVcI09hRAus9VnpS65s= 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 11:40:36 +0900 Masami Hiramatsu (Google) wrote: > Hmm, right. > Since the blocked_on must be NULL before setting flag, if we can ensure > the writing order so that blocked_flags is always updated before > blocked_on, may it be safe? > > Or, (this may introduce more memory overhead) don't use union but > use different blocked_on_mutex, blocked_on_rwsem, etc. > > Another idea is to make the owner offset same, like introducing > > struct common_lock { > atomic_long_t owner; > }; > > But the problem is that rt_mutex does not use atomic for storing > the owner. (we can make it atomic using wrapper) Either that, or add to the task_struct: struct mutex *blocked_on_mutex; struct rwsem *blocked_on_rwsem; struct rtlock *blocked_on_rtlock; And just have each type assign to its own type. Then you only need to look at each one. But yeah, this adds even more bloat to task_struct. :-/ -- Steve