From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 8799B803BB for ; Mon, 16 Nov 2026 13:46:15 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AGDj2hk025949; Mon, 16 Nov 2026 16:45:02 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGDj2hk025949 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1794836704; bh=pIyChkHYqCb0olhjb8fSgF26tInr/JIfViMas3tJgm0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=vRolP54mJDGMWxChPxgL1eq1D3WeXsMhBM/ucw5TQTBBFOeIp4ZHeJBS555NB60pr iXZxc6pso1aDgZCaN1cu2sXRYxDOm6Cu4u1btjNgawpr7iui2i1UG1SHWr2RaHIyYL 6jxiSXq4rz1IJreMYvV6B5OY1nyqHayZ8hMtGVxGqgWs7eZiVTKccuLJsZXJygOT9s Ibub7RqzBBsFNjLZI95exNa2xjUXRJ9mQ0Xou4cTFyNNlzMR7g4oJ/yTkUHBG1tRyr wq/Re+nrXHzY6+7OpEbnT+n3c6t9yeklJjj5HGcdGJmceZsciXXjQ+rXRywuJDLSlW lksDCkxptTvyg== Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AGDiqIs025917 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 16 Nov 2026 16:44:52 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AGDiqIs025917 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="ASNrOQAA" Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4a17741243eso17852865e9.0 for ; Mon, 16 Nov 2026 05:44:52 -0800 (PST) X-Gm-Message-State: APuU4Z+qwzl2K7mQnn4F94s+2YMqqmu0k3G795Bz+DDPBMxJjHsE/19g N4Xd8ekMeTtgWgK4u+kWs6QsNuDhU8YyzOM5/1keJz6JnQuINJo+QT2gdVIp/bQLwBgR2AnWfTi GfWHCflAABy5T0uB8OgXo7q3hdRuJqHiEeg6rgr4aBQZl75GCdmHuzg== X-Gm-Gg: AYBFou3/ig/uxZfXDuNtpMhnNlIV8UXZIZPgsukM/I5m3oLzcnc7UeZFkhsdA1IRK05 7utvtAVtUdecmonIrIcQ7rSDWxPV2kuB8ugYQ/kWwsshg3h2o32fqdC2IqWR3j9JTZe1VpbwfEA qYw7qN77BvPuFZmEkg5VC3Izly8MopX4SuCMwewRQ6EpcIj29F3DpnpUsGf77xkHjA4/ln0nZQB OAx426/J5hkKLpo/dxGVUm+GQUG/NRfKt/lb1LawetmC6x3qhEib31jvhTtrwMpf7zfLzkCMajj m6i9BpplDw== X-Received: by 2002:a05:600c:3b8b:b0:4bb:7007:4a5a with SMTP id 5b1f17b1804b1-4bb70074dedmr92615155e9.23.1794836692379; Mon, 16 Nov 2026 05:44:52 -0800 (PST) X-Received: by 2002:a05:600c:3b8b:b0:4bb:7007:4a5a with SMTP id 5b1f17b1804b1-4bb70074dedmr92613915e9.23.1794836691564; Mon, 16 Nov 2026 05:44:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794836691; cv=none; d=google.com; s=arc-20260327; b=cYSv9mkNXQic7cCWCmZpSQa7tEED5PRVmvd0bsTz44n3p/HyBU1BPRIJlXtVgQzbJQ MiiroABwEvk2j27AogK23PZsNMN7H45vxCzQ8WDzQFg/1nfxSFn0eo7FJkoPv5nDi9W2 e54wUKoeJZGVX8QpgJ/KtG/5dnEypz23A6lKqXeFir/D1vXL0gdFMYv2xof1INITnmqx yqRkaqk8xh9DFU5bjHpaaLLA+VJJzWGSV4MGdriN18wjvOYUzj2c6CPatLwkfjORnXXk DrU7SenCPwqRMIA8+fON/h3JHWCm+s4WAVTeIRmc346m7HYtJpiAg3UbV1SVWi+zeDEH gfNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=n6tDNDvXC73QkmZxKX14FOCy3+KZ0LzdfDPCBiV8DP0=; fh=6uNYPwy9b142UWd0jzfAkq2Z52P/q4JTiX3ERhnHONA=; b=MGLTtTGBWbSGFijA4B2p9P0Xyc4eq5t0IfrImpMs2FSef5TSDroxud0/b+34MsIENe hBvQ8udEzqEa9SBbdyF4ApF0cpJP7R/fQOI6NTsxuojEd7xJTgopM5pHhDfeoIrYZkFK 1BCYUdOQhLtKMdjc67k23ab9k+RJEf7R/YOPWQirG7BYazB+Aa5nZCxAhq+iw/6YoQdY +YrnXQFwarX0f5XFPIEeb+XdFsBvBZvjD+mSP4k+nGhJw9pbztGTgIq685wu3Kr5dXhJ KH4u92jG0dd+KuCFvXdJNcPLdJrM0RT98657kEEvDo2uuGtBiEFzOAcbIts+hdQN6Wyq ubJg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=ASNrOQAA; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:cf0d:642d:d702:3c24 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4bb55ab6305sor15697545e9.2.2026.11.16.05.44.51 for (Google Transport Security); Mon, 16 Nov 2026 05:44:51 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:cf0d:642d:d702:3c24 as permitted sender) client-ip=2a06:5b06:b600:300:cf0d:642d:d702:3c24; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=ASNrOQAA; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:cf0d:642d:d702:3c24 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1794836691; x=1795441491; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=n6tDNDvXC73QkmZxKX14FOCy3+KZ0LzdfDPCBiV8DP0=; b=ASNrOQAAIePhvMcdFpDga82khwLLH3FkkoMJptnpFAetjGE4+J5e6OGyZEpywk6xg8 TtTAjNhygyQjnV+EwNZ7dW+9q4pa//rBsaWIYnAb2SnbVKmlIh3qMQzpaxnV7ZiQnRcj WbfVQ1BVnHs/zcBShvaUyzxCYkKD4L/305E456Rnq/9xPjAAtYbkSxnXUyQdFCGyn1mC hujggQvI2I85YUufDT8tC5YIoL7GbJZqOq4KDtUw0er3k6uj05ebhTpIYp7Nb07IDThy xvS0fAepDzsr1aD/mBc+AlJZgWTYvW5KOE0nxMawFUCGuC0yuiihl9JNA1WwIYzutg5g Z6VA== X-Received: by 2002:a05:600c:154a:b0:4bb:73d5:ab33 with SMTP id 5b1f17b1804b1-4bb73d5b0admr42445435e9.22.1794836691098; Mon, 16 Nov 2026 05:44:51 -0800 (PST) Received: from artemis.sw.ru ([2a06:5b06:b600:300:cf0d:642d:d702:3c24]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb675200e4sm125713015e9.0.2026.11.16.05.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 05:44:50 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Mon, 16 Nov 2026 14:44:45 +0100 Message-ID: <20261116134445.438480-4-den@openvz.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261116134445.438480-1-den@openvz.org> References: <20261116134445.438480-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 3/3] sched: drop task_lock from sched_show_task() X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Denis V. Lunev Commit 35518dbbfd76 ("ve: Switch from task_ve_name() to ve_name()") made sched_show_task() look the ve up with get_task_ve(), which takes task_lock of the task being shown. sched_show_task() is a diagnostic called with interrupts off under raw locks or from an interrupt, while task_lock is taken with interrupts on, by a /proc/PID/fd read for one: - the RCU stall reports show the tasks blocking the grace period under rnp->lock, from the scheduler tick; - dump_cpu_task() shows the current task of a stuck CPU from the RCU stall and CSD lock reports; when that task is stuck holding its own task_lock, the report spins forever instead of printing; - the workqueue watchdog shows a hogging worker under pool->lock; - sysrq-t runs show_state() from the keyboard or serial interrupt. An interrupt or softirq on the CPU holding task_lock that needs rnp->lock or pool->lock closes a lock cycle, and the node locks up hard in the middle of reporting a stall. Print the name under the RCU read lock the function already takes for the parent pid, with task_ve() and no reference. The ve is freed from css_free after a grace period, and so is its name since "ve: free ve_name together with the ve, not at cgroup offline". Fixes: 35518dbbfd76 ("ve: Switch from task_ve_name() to ve_name()") https://virtuozzo.atlassian.net/browse/VSTOR-155341 Feature: ve: ve generic structures Suggested-by: Vasileios Almpanis Signed-off-by: Denis V. Lunev --- kernel/sched/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 77587e9982b7..84d2a5c29c69 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7777,7 +7777,6 @@ EXPORT_SYMBOL(io_schedule); void sched_show_task(struct task_struct *p) { - struct ve_struct *ve __free(put_ve) = get_task_ve(p); unsigned long free; int ppid; @@ -7793,10 +7792,10 @@ void sched_show_task(struct task_struct *p) rcu_read_lock(); if (pid_alive(p)) ppid = task_pid_nr(rcu_dereference(p->real_parent)); - rcu_read_unlock(); pr_cont(" stack:%-5lu pid:%-5d tgid:%-5d ppid:%-6d veid:%-4s task_flags:0x%04x flags:0x%08lx\n", free, task_pid_nr(p), task_tgid_nr(p), - ppid, ve_name(ve), p->flags, read_task_thread_flags(p)); + ppid, ve_name(task_ve(p)), p->flags, read_task_thread_flags(p)); + rcu_read_unlock(); print_worker_info(KERN_INFO, p); print_stop_info(KERN_INFO, p); -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel