Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1279008rdb; Mon, 19 Feb 2024 09:41:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW3/4sPY7+sws0faJel1blviKPqaaeas3QYcMU5+WNlCbRMyg/pSWPrpWKu0+csBktfup18Tgrq2nl3NHWb7NlIrqkDtpUIzh/TIh5uPg== X-Google-Smtp-Source: AGHT+IF7pM2NpDiB5NLdafW+hpZ6N2PNdCtGCliqpTCqvZVo+karasrwlccPAaSpiRcszkv/o0Di X-Received: by 2002:a17:90a:2d8b:b0:299:147f:e915 with SMTP id p11-20020a17090a2d8b00b00299147fe915mr10165028pjd.9.1708364463892; Mon, 19 Feb 2024 09:41:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708364463; cv=pass; d=google.com; s=arc-20160816; b=ZSWlp155mnetC+BBfzvXR7VgAXMYrMUBHwi6Wk3L2464E5+r54jLC1hD9VBzxdPgOV e+qpkZWcU4ZRXVW1Dr85f6kwKdJTAXbBi3wshILaPKl+hXX5RJOLponAVC+HvsCn+yl7 ZL+TUCND/ODYcnEhMu0XyPtg2f7T/jSJrLy2ztCr1H964JZlpEc2AZPZjJHhIaP8y/1e QyydKKa/IGgorCtldhpZMIBwkGPLF1QeXio2GxXwIcAKFMvjvtjuKaj2vvxoxomuoe2d +V6pYVEUivW+viEnWxIpJjmsTRDx3Xy4sb0ougjSzHo2yUliMcaVqeUIF12uh6UJhoO0 cfXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=7i66wvgPU4reDGH2k3LNzIA/59noJy6xURwGy2N9YzM=; fh=z5B6a1RQkut23Ort27Mh6NbePcmHsREN2sTEv1EHbrY=; b=aDuEGs5bLP96jwPcSvGozycuQvbLHEY7vDI86wk86z+dC+3i6cvnXArhC1gnuo6ZH2 Y/D4X2rj87ks8K+S+ShjX3SZGyjLGO1VKogLdfkPErYOOboQpd1kDSNtgHH7avb6CM0x XtcLGeEtldkv5ja09IUVwEefI4B/rVGH6qTarwnuQZKD1WUlysk8A8kJR02wDt6kwnrM 9G4SGLhUZIMMWIaZnQVCr/SRk5a5iV3RtOg2McdRlP7FqkE39QVtQag43bd45I02oa9Z zWSJMWsCJFOkVuIz9vApazQ2G7fmTUvzaZGHTha6LFsPzwMn88UOvZvbd5Y5PkLnUpN7 rzgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-71755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71755-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 4-20020a17090a08c400b002993c2454d6si4880664pjn.136.2024.02.19.09.41.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 09:41:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71755-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-71755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71755-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E1892B25C13 for ; Mon, 19 Feb 2024 17:28:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE7FF4879D; Mon, 19 Feb 2024 17:26:44 +0000 (UTC) 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 58032481C4 for ; Mon, 19 Feb 2024 17:26:43 +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=1708363604; cv=none; b=Qp3JLNigf1CQqGZ9y2Oarthbm694JDj1kErC71jP/qRnCuaI2h+5OgjdHUjk/JEHEkfsf8HSDmDcBrOKCYHzd41vIjha5pN7dAraMwDbP4e+gkMyQ3erm1GwL7b77nVdoxTL6Xy1xOLSuMlrwDjfTT7A4riuL5WtjT50cbiMuaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708363604; c=relaxed/simple; bh=Q25xU1PMIcagmUfGS0YVSM4O2LLHesbt2AkQg2Pad6I=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CHJZDA03pWmtkZ1xxiTcQPmiK/5QkIXEtjuA7kKGXIbzvD7ta/MlD6wxb6k52R8rNLzSoGnk1rrrynhDdBaQhzftYr1CUNjM1itm/xFAkpWS2L/4U8QIbK2a4B60cM1tmzrqKceQsWKer7j+iZAwF8vTD47e9/tlZsbTWaEqnUQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7DD3C43390; Mon, 19 Feb 2024 17:26:42 +0000 (UTC) Date: Mon, 19 Feb 2024 12:28:25 -0500 From: Steven Rostedt To: Oleg Nesterov Cc: wenyang.linux@foxmail.com, Masami Hiramatsu , Ingo Molnar , Mathieu Desnoyers , Mel Gorman , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH] coredump debugging: add a tracepoint to report the coredumping Message-ID: <20240219122825.31579a1e@gandalf.local.home> In-Reply-To: <20240219170038.GA710@redhat.com> References: <20240217104924.GB10393@redhat.com> <20240219112926.77ac16f8@gandalf.local.home> <20240219170038.GA710@redhat.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 19 Feb 2024 18:00:38 +0100 Oleg Nesterov wrote: > > 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. True. There really isn't a meaningful location here is there? I actually use this tracepoint in my pid tracing. The set_ftrace_pid and set_event_pid from /sys/kernel/tracing will add and remove PIDs if the options function-fork or event-fork are set respectively. I hook to the sched_process_fork tracepoint to add new PIDs if the parent pid is already in one of the files, and remove a PID via the sched_process_exit function. Honestly, if anything, it should probably be moved down right next to perf_event_exit_task() (I never understood why perf needed its own hooks and not just use tracepoints). > > To me the current placement of trace_sched_process_exit() looks absolutely > random. Agreed. > > > 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 ;) I still would like to have your input too ;-) -- Steve