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 872D8C48BF6 for ; Wed, 21 Feb 2024 07:55:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 111DE6B0078; Wed, 21 Feb 2024 02:55:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BF956B007E; Wed, 21 Feb 2024 02:55:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA2596B0081; Wed, 21 Feb 2024 02:55:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D68D66B0078 for ; Wed, 21 Feb 2024 02:55:55 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A544A14096F for ; Wed, 21 Feb 2024 07:55:55 +0000 (UTC) X-FDA: 81815052270.20.2F54CD0 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf29.hostedemail.com (Postfix) with ESMTP id 59718120008 for ; Wed, 21 Feb 2024 07:55:53 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=WaACTNG2; dkim=pass header.d=suse.com header.s=susede1 header.b=WaACTNG2; spf=pass (imf29.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.130 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708502153; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PtbBQesguJw5L/5dujKSNhT2R4ZTGtPZub9PPAkUNuw=; b=ew/owIE3EiDwgF1FS9qhS5QadtCySZPQw4JRFTqOe1LYb6SEmbcOEPJ/q53r6thZqmtZie zV57ubm5z8+yc2SSOlvOuubpNey+Sr1d4V/qxBzQE4XjKQdnOClhpAQLFViEcnxnHNoQHE iAQzzgSTtoK8MQZyTI35a/sjK96xxS0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708502153; a=rsa-sha256; cv=none; b=qxPPfl1F58aXRD++rEPX8SwFWpnL40a4vgl9t0xxtSXaKakefFdLbHeQkuR7cVCYImorZu x5Z9f8lE/1yrvEq+2b7nahUG1HCQdknWkc/iVwjzuVdTF7Ik+fPtLkQT0bEIo0wRWfE3M3 KtgWy2aXvqlvwaq9xR8y2dHwW+iioBk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=WaACTNG2; dkim=pass header.d=suse.com header.s=susede1 header.b=WaACTNG2; spf=pass (imf29.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.130 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id ADCC522224; Wed, 21 Feb 2024 07:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708502151; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PtbBQesguJw5L/5dujKSNhT2R4ZTGtPZub9PPAkUNuw=; b=WaACTNG2/y8guzY3WY0wfs9CdWpKiwbXdw2pZfRoXwkCDPRrwEb12F0V/creKp7RrW8/do ETwi0zyfpAZqWZQx/RyErjUL0gPr4D55+d2BxzBtUcanO905Nf0Nd9L0NDbAomPUnukkt8 Bkz2ZiPfhs6visJ1+k8WipKmXOYAFV0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708502151; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PtbBQesguJw5L/5dujKSNhT2R4ZTGtPZub9PPAkUNuw=; b=WaACTNG2/y8guzY3WY0wfs9CdWpKiwbXdw2pZfRoXwkCDPRrwEb12F0V/creKp7RrW8/do ETwi0zyfpAZqWZQx/RyErjUL0gPr4D55+d2BxzBtUcanO905Nf0Nd9L0NDbAomPUnukkt8 Bkz2ZiPfhs6visJ1+k8WipKmXOYAFV0= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9562E13A69; Wed, 21 Feb 2024 07:55:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id G4NzIYes1WUaHwAAD6G6ig (envelope-from ); Wed, 21 Feb 2024 07:55:51 +0000 Date: Wed, 21 Feb 2024 08:55:49 +0100 From: Michal Hocko To: Carlos Galo Cc: rostedt@goodmis.org, akpm@linux-foundation.org, surenb@google.com, android-mm@google.com, kernel-team@android.com, Masami Hiramatsu , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: Update mark_victim tracepoints fields Message-ID: References: <20240111210539.636607-1-carlosgalo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240111210539.636607-1-carlosgalo@google.com> X-Spamd-Bar: ++++ X-Rspamd-Queue-Id: 59718120008 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 98u8defe87h9g3sd18wnhiyxiww8e8ay X-HE-Tag: 1708502153-197478 X-HE-Meta: U2FsdGVkX18Y6lYV7kC6g0TBf91/0YB2gnuQKSRh6d0T06GE72ebwv/TB32Lc737nULsPmT3dL5gcwcsGQ0dmZVoGEszWEzUil3M4TTMzgsdk8gLcjt7yXMuh7i0IRZ1YDrzDf1NbORUHv0RgxzJxqNznXGGiAwIhkCTA0GuTp+rL1J/e/sAXnCl+A01iYDkAfP9iZekBE+9qYobzLPKOHg9lfIyvIKzKUsXA2pUlOb27KGwFZDsmgoj1iddPN09AETUDfD7XMP/O+yIxZz8DyWJP08OW55nizx8uc89YqnZ+FR/x7/7om17vd2BznhXDwUw8oYChD27od9+zOMbFj/DqtvSJu11bL5C7lSXjAG///BnF/GWHCteBd+vkoHKZcIc4Xvl2xNCHPU8+xRVWBwr3gN0VAAyP5T9Kkf9CaTMWVGY8lMkD2c4CFx56dFf+6SM7/QvP0dihB8eIQVKOU4Gyq3IY7uylPCQV3pMMDqMkJPfnqfhqV43o8jyNEGKqqHufHc61Am5aXXhDkIyLI9d1aUHTSfU7O+Cn+ApfLP1c37WGa0aFuvNIAsQFn67Xvok+chmSD8bPZ/k3xnUd1ia4dbaKjwsZJZIf1hKFAzrJTZz6PhiWDfHWB64MkUO3f0oLRBHo7flyQdD1Pqvtszuw7q/DDTGPEof5QtAmrEUmXYAsc54xOdRrCVLBTN4++UKtlsQye0u/6IJi4c3cy39VTTodTK2kWnwUDK73wPG071BL8vwdYOLP0bksfsQx35TIr9tBY+WASMR7WKg5kCBVQCtWZks5IHtCIByRmgEE6YF49k5Rb89ucatqqax+ki2msATNKQU3tpuXYuw0YP1REqAiCxXfdQou6DgR3G+BCXyze8yn6/G7LxUByEW6uOMZ0qcXgK1poeOwoC+6PRoSU7HHwtKL/5sCxoI4KDRZk+zU7Ertrygx9m2jx45eRYjd9RrLJhAVKKzMCm qoR92qG4 5uBLU/SGsHkbd/DXBaLfIUDGlF+wsXjZUuUNnBasiBBiviqf8HX3jLUsqi0vtJC3nHY79Sw3LwsTKwAeHFeZYFVDDLBX1GySfd/wHGRwmrT5z0CQw/CaQRLrCbigmDY8ZTif3rIw5N0dOsEM+UlzHYX7YTzSKcOgw7sPFJ+Wsm+ayS5fdH67pUAyNhMPG8jPLbLtTh6T5TU9Zi5+Dg9aCerlG49bCMyNU73XxqtU+5tWRsnMMb4CjICZ2YgpkqerlWIxsuaTL031SaVE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.016651, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi, sorry I have missed this before. On Thu 11-01-24 21:05:30, Carlos Galo wrote: > The current implementation of the mark_victim tracepoint provides only > the process ID (pid) of the victim process. This limitation poses > challenges for userspace tools that need additional information > about the OOM victim. The association between pid and the additional > data may be lost after the kill, making it difficult for userspace to > correlate the OOM event with the specific process. You are correct that post OOM all per-process information is lost. On the other hand we do dump all this information to the kernel log. Could you explain why that is not suitable for your purpose? > In order to mitigate this limitation, add the following fields: > > - UID > In Android each installed application has a unique UID. Including > the `uid` assists in correlating OOM events with specific apps. > > - Process Name (comm) > Enables identification of the affected process. > > - OOM Score > Allows userspace to get additional insights of the relative kill > priority of the OOM victim. What is the oom score useful for? Is there any reason to provide a different information from the one reported to the kernel log? __oom_kill_process: pr_err("%s: Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB, UID:%u pgtables:%lukB oom_score_adj:%hd\n", message, task_pid_nr(victim), victim->comm, K(mm->total_vm), K(get_mm_counter(mm, MM_ANONPAGES)), K(get_mm_counter(mm, MM_FILEPAGES)), K(get_mm_counter(mm, MM_SHMEMPAGES)), from_kuid(&init_user_ns, task_uid(victim)), mm_pgtables_bytes(mm) >> 10, victim->signal->oom_score_adj); -- Michal Hocko SUSE Labs