Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2445250rdb; Wed, 21 Feb 2024 07:56:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXF88ky6GNtxHblS5tG6utsQG+j8ROpcrUPWVJWeyrL8Z/sQ05aNjXkWvhQQCy3OXaPZpHcT1amw+ueRsmHZtGZkbRJ9z/wUby4mLkQLg== X-Google-Smtp-Source: AGHT+IE/x7nEoQ6oWNTtsbYtUCvmoFOS2257eVdNPcNahiowtUt8+bJjSM8N4Yw17iGK3HPoI610 X-Received: by 2002:a17:903:1ca:b0:1db:aab5:1db5 with SMTP id e10-20020a17090301ca00b001dbaab51db5mr19191691plh.42.1708530990562; Wed, 21 Feb 2024 07:56:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708530990; cv=pass; d=google.com; s=arc-20160816; b=fPwPxznnb/vDBv2lmnCMH8j08NScZc6WZQRNFzjSXmF7px8vJ2kcRHmgGobPWUQRCx 3RAZYReIlGzcOTLvtsvLAlf5VeIKjhf1ZbbdkWQTI/6SUC44ZbfRXTmIry4hucvrSKsr USS+zdO4wjVHpAzbprpzG2G5RUUTYKvYIBiHIzwa+Umoe16oWsttKEljyRBjdx9QY0K/ BBNx21nHBywp8fZqhg0EzdHymXmk7WpCk8m0ysVBuCnLOCv0qcvQleXMKOIYtR39v/LC eynVn9iGIvzmqD4TxuH/GYrdW5pacWmQU8+I5kTsg1eGSoFbY148qw1wZNVYZ5KUKs7S eB8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=sKtJeLMhCOAL5wfw/Z58CF7RfJkhujGF5xFaWZx4CKY=; fh=Oks/Ft1ebgJVu5EAqrp2Dq2cNyF9qZfcN5S08cACO0Q=; b=K8lPVVvt4R3QrMXYzkn8g5bUZlJ2O270w5fJED17PiSxZCQRfRgksodANNntEmQVpq kG3XxuNo4mtVkKCuj97OGEqPMYUpkxKLUwJP/DM0el+EpdYVpgGh7jbtkJKTEVzOwGDG 5nsmp+kw3JQCT2vLK/bPE29/hsD6aVkBjfWj+3Ng0RBe0Loyb8M7ewPYV9+kinsamZPH Gq5/FzZ6a7IF/9n2iVU2FQtOqAg5jjKBM06973TxiU0AhcgCYynym7e1XK/PaKOhTsX/ doL7dwjovOVHzhCxagwFRgVhn8LozZiMFw4L7z09nA1fkijNZcUEE+aW0CWXvmLFhbcG xLUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=cs78EL+o; arc=pass (i=1 spf=pass spfdomain=foxmail.com dkim=pass dkdomain=foxmail.com dmarc=pass fromdomain=foxmail.com); spf=pass (google.com: domain of linux-kernel+bounces-75027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75027-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y11-20020a17090322cb00b001db47573c39si8495868plg.78.2024.02.21.07.56.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 07:56:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=cs78EL+o; arc=pass (i=1 spf=pass spfdomain=foxmail.com dkim=pass dkdomain=foxmail.com dmarc=pass fromdomain=foxmail.com); spf=pass (google.com: domain of linux-kernel+bounces-75027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75027-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3F911B21693 for ; Wed, 21 Feb 2024 15:51:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32DC080BFF; Wed, 21 Feb 2024 15:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="cs78EL+o" Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) (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 0B36C8002D for ; Wed, 21 Feb 2024 15:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.252 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708530671; cv=none; b=do9CsasExLYKxwliqMxfZvk35JQnvadsAGqGdRjQiWmpWBtNK5Mp55eaY7VN5ZQhuOwku3H1SPQ73v80oQGHIUsz+acKy/MNTKMl3pbLIrobIIThn0zZL04MgO4ehLxNY0gg7ySLg5Tvskz6S2bjAwmWG95JI8a08wf3PIsR6ZQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708530671; c=relaxed/simple; bh=vEoM1UN5fw8alEuNhj3NG53aylvxNxq2uZ8DS3N6ANs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DpX+9mRm1Wq9gs9S99JzaG44rWiWhVQRc6Tw1u3ax1Q8rIJQ5QkxDZDoT5qmo+O12ikKOT8x5XqSbTMRrJJ8e98JpeLo7motHou1ndv7uD1X9ipd3c5kf8I/b4ueuG8Wie39hbt3eJz1MXmwFXum2u+LuKUNa5ESQc2IhPE0Tsg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=cs78EL+o; arc=none smtp.client-ip=162.62.57.252 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1708530361; bh=sKtJeLMhCOAL5wfw/Z58CF7RfJkhujGF5xFaWZx4CKY=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=cs78EL+omCfN77vdA7iQ0DmgMkqzk+ng8QqI/XfrB+sGosDYvZpZQzphlMiR0/+Qx vZylD/RJkwdn5hBbNymT/eckZsA2pkoBnjsezqk2ljlRm3gWt6gu9pDVu6Pic0VI8l CXT79mLmnYw66qkZE1I7C8O/h6TlTvOeE7ynv+A8= Received: from [IPV6:2409:8a60:2a61:ef40:1517:f202:3311:4bf] ([2409:8a60:2a61:ef40:1517:f202:3311:4bf]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id B7AAB49D; Wed, 21 Feb 2024 23:45:58 +0800 X-QQ-mid: xmsmtpt1708530358t3pny71lz Message-ID: X-QQ-XMAILINFO: OVFdYp27KdlJoGk7u5nYniAJ4Up/dNZVH2qBLkC6pDqrKaGd1/G1th+DGipfTH e9oOUXIULI29mRd7NpqutYBOpRckNLhxdLJfKvaRIBjslO/xHp7VT8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 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] coredump debugging: add a tracepoint to report the coredumping Content-Language: en-US To: Oleg Nesterov , Steven Rostedt Cc: Masami Hiramatsu , Ingo Molnar , Mathieu Desnoyers , Mel Gorman , Peter Zijlstra , linux-kernel@vger.kernel.org References: <20240217104924.GB10393@redhat.com> <20240219112926.77ac16f8@gandalf.local.home> <20240219170038.GA710@redhat.com> From: Wen Yang In-Reply-To: <20240219170038.GA710@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/2/20 01:00, Oleg Nesterov wrote: > On 02/19, Steven Rostedt wrote: >> >> On Sat, 17 Feb 2024 11:49:24 +0100 >> Oleg Nesterov wrote: >> >>> On 02/17, wenyang.linux@foxmail.com wrote: >>>> >>>> From: Wen Yang >>>> >>>> Currently coredump_task_exit() takes some time to wait for the generation >>>> of the dump file. But if the user-space wants to receive a notification >>>> as soon as possible it maybe inconvenient. >>>> >>>> Add the new trace_sched_process_coredump() into coredump_task_exit(), >>>> this way a user-space monitor could easily wait for the exits and >>>> potentially make some preparations in advance. >>> >>> Can't comment, I never know when the new tracepoint will make sense. >>> >>> Stupid question. Can we simply shift trace_sched_process_exit() up >>> before coredump_task_exit() ? >> >> Reading the rest of the thread and looking at the code, we do have this: >> >> void __noreturn do_exit(long code) >> { >> struct task_struct *tsk = current; >> int group_dead; >> >> [...] >> acct_collect(code, group_dead); >> if (group_dead) >> tty_audit_exit(); >> audit_free(tsk); >> >> tsk->exit_code = code; >> taskstats_exit(tsk, group_dead); >> >> exit_mm(); >> >> if (group_dead) >> acct_process(); >> trace_sched_process_exit(tsk); >> >> There's a lot that happens before we trigger the above event. > > and a lot after. > > To me the current placement of looks absolutely > random. > >> I could >> imagine that there are users expecting those actions to have taken place by >> the time the event triggered. Like the "exit_mm()" call, as well as many >> others. >> >> I would be leery of moving that tracepoint. > > And I agree. I am always scared of every user-visible change, simply > because it is user-visbible. > > If it was not clear, I didn't try to nack this patch. I simply do not know > how people use the tracepoints and for what. Apart from debugging. > > But if we add the new one into coredump_task_exit(), then we probably want > another one in ptrace_event(PTRACE_EVENT_EXIT) ? It too can "take some time" > before the exiting task actually exits. > > So I think this needs some discussion, and the changelog should probably say > more. > > In short: I am glad you are here, I leave this to you and Wen ;) > Thank you Oleg, thank you Steven, We could first put trace_sched_process_exit() aside and take a look at these three patches: 2d4bcf886e42f0f4846a3d9bdc3a90d278903a2e ("exit: Remove profile_task_exit & profile_munmap") 586b58cac8b4683eb58a1446fbc399de18974e40 (“exit: Move preemption fixup up, move blocking operations down”) And the original: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Could we add a new TP similar to profile_task_exit()? -- Best wishes, Wen