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 D06DAC61DA4 for ; Fri, 24 Feb 2023 14:19:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C33D6B0074; Fri, 24 Feb 2023 09:19:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5735F6B007B; Fri, 24 Feb 2023 09:19:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C5F16B007D; Fri, 24 Feb 2023 09:19:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 285CE6B0074 for ; Fri, 24 Feb 2023 09:19:50 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D4AA7AB577 for ; Fri, 24 Feb 2023 14:19:49 +0000 (UTC) X-FDA: 80502394098.15.2ECD680 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by imf26.hostedemail.com (Postfix) with ESMTP id 1ED60140024 for ; Fri, 24 Feb 2023 14:19:45 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=axis.com header.s=axis-central1 header.b=dDlAboT4; dkim=pass header.d=axis365.onmicrosoft.com header.s=selector2-axis365-onmicrosoft-com header.b=b610v9zO; spf=pass (imf26.hostedemail.com: domain of Matthew.Chae@axis.com designates 195.60.68.18 as permitted sender) smtp.mailfrom=Matthew.Chae@axis.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=axis.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677248386; 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=33ysjcAdOTufvPgAsGWpbotc8tWlOUv9gv7F+pxLW1w=; b=Up7XYrnZkA/mZbRnlGZjHUEcYaKdLxJDvxwmsU+CegCgwtpHim0Uv4ZqZcoRE7qC3T5z6L 9PVm/WTIXV1qmSF352Jx/1YBirQRj+arcG/7+GSCHI2YFfsOIl16/yx+hwLjtF7VnfpGbs 8Z6k/frk3ONzQtXpOsSeaYwnA295cps= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=axis.com header.s=axis-central1 header.b=dDlAboT4; dkim=pass header.d=axis365.onmicrosoft.com header.s=selector2-axis365-onmicrosoft-com header.b=b610v9zO; spf=pass (imf26.hostedemail.com: domain of Matthew.Chae@axis.com designates 195.60.68.18 as permitted sender) smtp.mailfrom=Matthew.Chae@axis.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=axis.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1677248386; a=rsa-sha256; cv=pass; b=evm9POuSYMbEjx5frKKqeOa78FJu2nIp0m/9SnLC/zdFrPtVP5/DViunKV7NkbNxGLCE9H Cm2pSh8UjECKg2d6kHWfKCKpdk+b73BOOLK5pQfMR1Bs3Gj+UrH4ZdxcKO71/7NlfHK+P5 ITu+nHMfQQk+umUHQddEG435nuUe4NY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1677248387; x=1708784387; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=33ysjcAdOTufvPgAsGWpbotc8tWlOUv9gv7F+pxLW1w=; b=dDlAboT4S+mUCiq7s3FvwlNKdazYt+rjPLlE6GZYJsI+se7rHfaa+0uz dfgFuiDgWkBp1pIlLLyIVVrZb8cgHGbI8VOLyzm+wZi2zJ7Dtj7/ag5eE 4e+prg7CN6GaoJEVr+/R5NY3i2izI6JEipsKNXqEM5qkR06hN8WF4+I3U tzfOVKjCtDeTdzPkp8BYadyBunvJmzhqjBdUAmHHVWUbmPirUJ35hWArR WS5QuhjdzJLbDeuxt93ftTMWNcHixS+rcGm+Q0OyjLa9owIMuQdcL7gNk 0s2YVzlHS5gHclhBeYzLxDrSr+JNvggKH/pu+AwxnqUtpGw3bkToH/W6T w==; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OgOYR/8EMPBZ53kufzT2J6jDkbnann2bIyQSx9m0gg/81oPMQH7QdQLQzE+izKJj12au5JbhP/rlaxcKUsDbCEWp2z3OQnfbkOyKOVhwnMmMZJDowzisjNW56hsCQx1WNYgxlzBRFesKHygF9dFPc+QPd83ukOkH3TsINvkMH1nOwob8Xxjp1c2w+qVs+F7cIalEDp5+s3rHZMf57m8LvYwMyP3bEE18LWqw4AORXIvoYUVUFQ13+1U48R7f+YsQFNPfQVI/CUNLHxqTnGwJxd9CYdW0lahAae65nqouvLKXCP0f9dQfERimXGHNew8HllXT9qX2za8NEbjt20ZUBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=33ysjcAdOTufvPgAsGWpbotc8tWlOUv9gv7F+pxLW1w=; b=C8OMLy5XPSVW6maTGucY9T4OLGEo+gc6Oy4Qtn1Ezoh7E86vpSdX6fu7zqQRPe6rSwp41vk93tDLlNN0tMfIodnUkj+KOHxYs9TcBxr7ZzZJYlE1SVKXsxIqsHNQbkEFkZpYmj2pdhodpvVIz05N0ZwmYaM1k0UoRvbT1rgX73WQUYWizFR14X35gw5W9jIq9MWmzwQ3q5C+PXTrx42bvmwAfS2X6uxlbM3HEvwVEj/bNrIHf8iAuzfXvOoFM4hbcduuEjLEdVwhEoNuraChWMDx261T9lfebIJx2lyAVkIGKbQ0bF/LeK4XFxXp+cqNXFriThQ6Ro7a2If6ufluww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=axis.com; dmarc=pass action=none header.from=axis.com; dkim=pass header.d=axis.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis365.onmicrosoft.com; s=selector2-axis365-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=33ysjcAdOTufvPgAsGWpbotc8tWlOUv9gv7F+pxLW1w=; b=b610v9zO9WvlN1JNCJyk+JadZmYRWx5JneyMOwZdM2/eM4gmQfWF5nI0k8bXyWVXZgA+8jgpMX66vPy+aQYu3gkY/zaXnnCLW+Rxofwyf/Cyh31LFCQeaYKIycK1qGQx2SpEbfvNO0F9/I7vagt3aei4T+Ynj0C5PC4K+7MGFtk= Content-Type: multipart/alternative; boundary="------------dPaFeZkgeH3Qr76UPpTxscRl" Message-ID: Date: Fri, 24 Feb 2023 15:18:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] mm/memcontrol: add memory.peak in cgroup root Content-Language: en-US To: Michal Hocko , Matthew Chae CC: Roman Gushchin , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Johannes Weiner , Shakeel Butt , Andrew Morton , kernel , Christopher Wong , Muchun Song , "cgroups@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" References: From: Matthew Chae In-Reply-To: X-ClientProxiedBy: MM0P280CA0117.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:9::32) To AM5PR0202MB2516.eurprd02.prod.outlook.com (2603:10a6:203:6f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5PR0202MB2516:EE_|DB3PR0202MB9179:EE_ X-MS-Office365-Filtering-Correlation-Id: 684bfab0-fff1-4bf4-cdcb-08db16722b30 X-LD-Processed: 78703d3c-b907-432f-b066-88f7af9ca3af,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PQtM8ZBGWVAfXk9PZ+rrmNVVli0I+YsSwPN7tVTc16d88sHErvjYtA4+XlHghDTMJsqsvcLb9mkKtBbz0BKV4QaXa/rS3RjKjDZsCSgDeO9tiwHjLwUWpah8PCBpw/aont/9ldiUJdub8N7uS+cFv5xwGAFTR2wBby5gvR08T10fINe0cLsn57cFjh1UGzx7trM8ylbpfGKdruamfNQdwhdvJLVgWm3FEq7DSt2YUkPgjih0KT+zpGpgL9v/qAQCOLBJOjT4lUz+FPrVgYmZkMtJiEKHg8WJerkqTmkdD1VvwPgzlbQPaS5OgE/2KdUUqIRqHaWxYfEYp2NIRPa1igh+3N17uutcNVvDEGHKYpI2q79CBspwn32HUErRRWK0CHN3lAUJ0PKjsIdwKV7ajbzDi+nYlkwZVMy4i993dh92uaXSKzbI43pSSqRHJy+Ir5X9SGRNPDupr7LFkyss5dMPyor5DGRmBUnWDMTmUe4ybJITNXOvdIldgQmUw9dkwrpeucvMikMYuyPcAooxm2Z115l+PlAJUZVLWXlKuwcBO7xEEkQ/Go1m+9trZIcrxnhWyAFvHI4g9K77MFWl1JUgb9LUNhIbJQ9KVa/FDpucgSrN3LMvpfhYjwKkdjmz1Lei9+spIQacp0V3ppdc8A9xbseDJ2dgwD2IbjaQ2/j3iP1lAVszCowDUJgLzEZcwMOvgWPoA7rzP+pV58JneYuH45p+ecALZEo0Vffm8NM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM5PR0202MB2516.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(136003)(396003)(376002)(39850400004)(451199018)(478600001)(66946007)(83380400001)(66556008)(6636002)(54906003)(41300700001)(110136005)(8936002)(316002)(5660300002)(66476007)(4326008)(6512007)(6506007)(8676002)(2616005)(186003)(53546011)(33964004)(26005)(6486002)(36756003)(31696002)(7416002)(2906002)(38100700002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SXJrUE9RZzNqUWc2RWNqQnhTcEE4WUJsK0hLazVvVmQxWUxabXNQS3JSeXhB?= =?utf-8?B?WGJQdEswaWFlOXNyRjcwVndZZTFUQ3psdU01QTRLbmZCc0owTklpTkNXTTFC?= =?utf-8?B?eGFDZ1pMVFladElRemxTeTN6UCtuV2lHRklNTkpPbFdBTERrMlF2MTIyWGQw?= =?utf-8?B?QWtPRythQ0FZbTVsZ3BWT1JrV2hxRTRkTlFXa3gwVjBvRDBpc3JIR212UFBi?= =?utf-8?B?MFMram03eFEzZEFWYnFhWlBOam1MR2VKemp3MjM3cWJqbjE3Znh6U1l0amhl?= =?utf-8?B?S0JkdTdhWVh2MXNCSFlrSkpheFFuWU81cWREUGl6c1hNRVlYb0xoVnpmQVhu?= =?utf-8?B?Uno3UG9jbTZiSTJkWmY0cnNFZVg0bGYyZFNuNnZ2MWhOeE1ibXJTeFMrazJs?= =?utf-8?B?OHZkdVQ4L1lsTlZIKzJkZ1VSTlJrUStNV2Nwem5LdWdHUFlqQ2Q0OTRybDNV?= =?utf-8?B?THpMdzFMaTFOdGRENjJMQTJOUnR4cThYWUYwMDVvTmczR3Vjb2hYZGgzZm0y?= =?utf-8?B?SS9wY0lqd1FTQ2J0OHNVYkQxR3IwNlZYVmtuaXlXcCtydE0yMU9QdVFMbjV3?= =?utf-8?B?NzhOaEQxU0M3ei9JblJqczVzZ3pEOXlyOGVPeWtRUGoyMGpKd2xpaUZvRURW?= =?utf-8?B?cThZcVZ5dytlL3JiOVlVaGJzc3c0REVTMVpTa25URTZNMUZEbGJCTVgwT1g5?= =?utf-8?B?Tk1XbnRST2RrNWF2L1JIbm5ZOGpFYjZsYXF3V3kyOE01M1o2QkFjU0Q1VTRn?= =?utf-8?B?TVZ1cHZJeFJsL3dPV1ZDOEM5SkVZWjZmYmJQR1Vidk1FSUJid09ONnFTM2sw?= =?utf-8?B?SGo0WElRTWtPR3ZocEJpVnRjdGpBMDVaVURmT1RFa1I0eHZ4VEJjVlBmb3Z3?= =?utf-8?B?Y3VPeTZXODdrRkg2K2tEeFB4SVJIbmV1d3VUcnA2YXZZWkp0dVJhRWt1bXdm?= =?utf-8?B?dzkvaXRzbEJua052cytPSEZXaEpuODdCejVyY3I5N2p2SEJ4ejk5ckpXdU1z?= =?utf-8?B?NDdkelg1czUzSmxySnNVQ0tLdDR1QVhFc1dQallOWm1EVnptTTZ0ZWpPN2RM?= =?utf-8?B?M0JpMzgwMzJjUDZjQnQveCtNT1EwaHo3Z0I1K1hMckpUREg0RDNLT3JvakN0?= =?utf-8?B?NGVpcHNxRjFBVDNpdFUrbG56QXl0WmJRRlpuOG5wamN0SGJqMVRjUkpCQmN3?= =?utf-8?B?OHZmTnJvdTZ5TmtjbE4vSkdIU3BDMnZreXlVWEhwUGZER0lpMW5USHpvVDc3?= =?utf-8?B?NUdURHZyZnN6Zm1sdU9VeWhpUExtNVZHYnIrU0w2eFVXdGsxSWdFQUsrN1ly?= =?utf-8?B?blNHUzU5Z3pnKzJRUGN0RVZDajZvT00ybm1CRHNpL1JpRUxQV0FTUXM1cDd1?= =?utf-8?B?Wm8vYlpSZCtEZ0dyS2pPRXVlSmx3VTFxRk9CazErNUEwRmlQVCtHeFhidCtt?= =?utf-8?B?cEY0TWJ5Q0wrZ3BrSGNhSURkN3Y1OEF4cHlrbGo0ai9sUVk1N2xGZ1NJL2Rv?= =?utf-8?B?dU9Fb1BRVjloNmZadGp5Q1c1dVZKdi9yQ1JtUkFEQlZCZEYyM2Nna0tnSTJq?= =?utf-8?B?Y01jcUQwbk8rMC9Rb3Joc2FXR3Y3MFRaQUJDdjIwTG5lYXpaeFBRY2o0RE01?= =?utf-8?B?VDlYVnNFRWxUTVZtY0FWVUNFRXZPUXBVNmRFNWgydVNjZ0NraXl1TXAwdzJB?= =?utf-8?B?YTRXTEx5VTVaeWdkU0o2b0k0RGNBQnVyN1g5UkV3YWZWN2hrN0k5T3EvVkx5?= =?utf-8?B?NHpTVzErMDg2a00xUktQVU84cm5mS0VRcVBNY1ZweUxpK2lJYyt4c3B0ZVYw?= =?utf-8?B?NHVVamJHZGl2SUpoWUM1YmZMUmlQdVRhOUtyQUZhSlU1aWdGbTBTanI1T21C?= =?utf-8?B?Yms1dGFxNit4MlVVWTNNZzNORDg4TldXVGJPUzNpbG5GeWM0Wmw1Z1RDeHlN?= =?utf-8?B?Z09leTBqbHpENXF3UWd4aUxObkRENEtBMUJCa1VJTjU3VUF3ZEM2QkxvdjlF?= =?utf-8?B?ckw1Z051TEZPTVhFc0VuTG1ybjZieTBTakU2ZHFSTlBGczF1aWt1Yzc1cWVN?= =?utf-8?B?YWlMSTVNc2dJeVRkMFRMREVjdW1oWjBYSVhCbVlxblg2eUhWa0lMV1Mrbzhy?= =?utf-8?Q?kupS55PjT4Hvu4oVzojIgIaww?= X-MS-Exchange-CrossTenant-Network-Message-Id: 684bfab0-fff1-4bf4-cdcb-08db16722b30 X-MS-Exchange-CrossTenant-AuthSource: AM5PR0202MB2516.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2023 14:19:41.3352 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U3MXH6NaChkx6saw21kSWzxWsgcCcNeWjAUXo8MtQKEKt2C+yXhkWASFCCXnLxFpmG8qinCeHEM9e+J/A+AgYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0202MB9179 X-Rspamd-Queue-Id: 1ED60140024 X-Stat-Signature: nrjmt8xd5b5wcc4khrhw7jgp67hnjz7b X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1677248385-764039 X-HE-Meta: U2FsdGVkX1+x61v6JJO9nO2Zutfh0+aavgNSA1no4hSaOMB1M4slccBzrTgploU2EJw8Fmkhp2rdsg3BEI3aXQuQPme9x4708skRHoLRoXHH0Tpej153OCtr7dPhnPxUUjxtA5AgXOYKHyD+JXzfQrwejhtm3OMs5G+ZZz+2pD0MZQWc4jlzPrbEF68TW7XvSfsaskggs5fHpVx+TzUgFYLBz04EgvChScW0TPpssyc8kj7howsk/DGHxcQ44ip8ZGT1Z5PJohSsH1tq8ajIzKQHEb028hfCgM3ioW50Kk4Kl4IDqvP7x0w7O2pSDx8B42a+1ShmN8PwO6E2iN6V/9rRHX1Soqv2ItFwAL862jOeZScrxleheSzdTtRNAqIMvLVXJkcgHE5ZjDmX4L4w2/dPgbOvm5LeB5Z7Fmmiy3q8ZkLkUQZTmWimJ0oKPbAlBaqXj95QPgVzpIHt1GLwGxDYMqHM+BgbzIu7bbz6x9ePKMys0Ka5uyaIBULvQghNTNPqozKMO6k4zv7iXmjeFIKwuL3lJugALTr2gr7YwBt/RjtTdVXZDmY7uxH7lP7MeGnv827BE56ZdBAK7wRDkQnkCyIOR0w1hOii7lpFNZl6+nXAlCnkp0pnGXtXGJX6ntDSAPy6LbMEubQyzBHuSUKv4nlvU6nlgsCxFx2M8Qz5yDXjrhedZMpWagQitmoBojVFeKt+pZEaTjd4nk0M0pr31gGGwsbYVUJn8+nwtl6YEb4m68BFVjcX6QounzEdwnLMGHlM50FdYXSdDoOHYwu/xnzu/M15lJVJTPjhyeWBpe9CSOn5x7iYB3hcLGAzVtA3rU8ZbJjoQwWPObFEFQFam2UONRe1TpQenJaq0RNxkPEJW5bTs9OoSGrFD6A+jyvc6owUx5gEl2BZCz8Ruv0Ct8gvojsogIXq1Jtr/wCalFYJR2UiGE08obi9DZ6fqMhjWWCbGMIcsttgrY6 EGmrsyLF nwG3l0caJsj8NWl9oSnHv5uXyxKnAsyC2O8G5lT93CpkDjeol/3jYp57/T+Pt8T0tHpSxZAM0vh8bRq+b8EdStDOZuxnwgYZiEEM4/dSNxAj8sefvLWCsDLR2JV4cM77s4AJ2CpEEYUzrMO0B8f/mWsXnkunbH1ko2Qaj6CgroY/yyhy2PgPaUAJDDeYM4rdGDu9WNp4EYN1ckIjkJwkT9Y4q7PMC+iVJyIhieqQ8i53aWy59aTHRfNkEZY/Y2gHAfccw9M8q0rqTxuUqco5qopenLzKhkOUT3+hjLy8kTKFepqR2bOFb1h+YwYSO7duwbp1Yhjiy2FcMcnfnLIlKdXaFOxLe9OfmH3uqrxkxhA/vY8JtivKDIaLDqkmnmnhMEL0VYazs9iAgm95hXsxNZtqtgBRQPHbxLgxdY4eajogI/mcVA52eUGZVk8Dnu4Nt1lipH0P+9s9sxDBoCAxu9d+aCma5mBiW8KeXDmOlDb3p0eTqMZ+j14/iEc5CFcKbBYQmXKQC6OnUwxVbK6n2zy9bTYP1QjHFP4Ay+Ms2jgPML5g= 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: --------------dPaFeZkgeH3Qr76UPpTxscRl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Michal Thank you for helping me gain full insight. It looks like there is no proper way to get the peak memory usage recorded without adding any overhead to the system and for all users. But I fully understand what you kindly explained. Basically, having low memory left doesn't mean a bad situation for the system, So checking the peak memory doesn't mean a lot and is not necessary. Let me check again whether we have any special usecase. otherwise, we might need to reconsider this requirement. Thanks, Matthew On 2/24/23 09:23, Michal Hocko wrote: > On Thu 23-02-23 19:00:57, Matthew Chae wrote: >> Hi Roman, >> >> I'd like to get the peak memory usage recorded overall time, rather than at a certain time. > Sampling /proc/vmstat should have a minimal overhead and you will get > not only a single value but also a break down to broad cathegory users > (LRU, slab, page tables etc.). Unfortunatelly this doesn't cover all the > users (e.g. direct users of the page allocator are not accounted to any > specific counter) but it should give you a reasonable idea how is memory > utilized. Specific metrics really depend on what you are interested in. > > Another approach that might give you a different angle to the memory > consumption is to watch PSI metrics. This will not tell you the peak > memory usage but it will give you an useful cost model for the memory > usage. Being low on free memory itself is not a bad thing, i.e. you are > paying for the amount of memory so it would be rather sub-optimal to not > use it whole, right? If the memory can be reclaimed easily (e.g. by > reclaiming idle caches) then the overhead of a high memory utilization > should be reasonably low so the overal price of the reclaim is worth it. > On the other hand an over utilized system with a working set size larger > than the available memory would spend a lot of time reclaiming so the > performance would drop down. > > All that being said the primary question is what is your usecase. --------------dPaFeZkgeH3Qr76UPpTxscRl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi Michal

Thank you for helping me gain full insight.
It looks like there is no proper way to get the peak memory usage recorded without adding any overhead to the system and for all users. But I fully understand what you kindly explained. Basically, having low memory left doesn't mean a bad situation for the system, So checking the peak memory doesn't mean a lot and is not necessary.

Let me check again whether we have any special usecase. otherwise, we might need to reconsider this requirement.

Thanks,

Matthew

On 2/24/23 09:23, Michal Hocko wrote:
On Thu 23-02-23 19:00:57, Matthew Chae wrote:
Hi Roman,

I'd like to get the peak memory usage recorded overall time, rather than at a certain time.
Sampling /proc/vmstat should have a minimal overhead and you will get
not only a single value but also a break down to broad cathegory users
(LRU, slab, page tables etc.). Unfortunatelly this doesn't cover all the
users (e.g. direct users of the page allocator are not accounted to any
specific counter) but it should give you a reasonable idea how is memory
utilized. Specific metrics really depend on what you are interested in.

Another approach that might give you a different angle to the memory
consumption is to watch PSI metrics. This will not tell you the peak
memory usage but it will give you an useful cost model for the memory
usage. Being low on free memory itself is not a bad thing, i.e. you are
paying for the amount of memory so it would be rather sub-optimal to not
use it whole, right? If the memory can be reclaimed easily (e.g. by
reclaiming idle caches) then the overhead of a high memory utilization
should be reasonably low so the overal price of the reclaim is worth it.
On the other hand an over utilized system with a working set size larger
than the available memory would spend a lot of time reclaiming so the
performance would drop down.

All that being said the primary question is what is your usecase.
--------------dPaFeZkgeH3Qr76UPpTxscRl--