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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F249C61DA4 for ; Thu, 23 Feb 2023 22:00:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229522AbjBWWAR (ORCPT ); Thu, 23 Feb 2023 17:00:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjBWWAQ (ORCPT ); Thu, 23 Feb 2023 17:00:16 -0500 Received: from out-36.mta1.migadu.com (out-36.mta1.migadu.com [95.215.58.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D36A521C2 for ; Thu, 23 Feb 2023 14:00:13 -0800 (PST) Date: Thu, 23 Feb 2023 14:00:06 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1677189611; h=from:from:reply-to:subject:subject: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=d26wBxNftgvIEigvlBues+H50f7ZSE9Q9ePe8CXNvAs=; b=hy1GOCctAm2u9Q/WJ7L7i8MHDrWDIM/OZ/LaaCUIlYO4NsaGcXONCLopBdR4rwr7VnKtOG kEU4fg/XS5dDhRvUcB3YGSEgEtiJmdnDYBkH7Kt/hwVXa+rSdfjo4GDKrlOZWuLKOz6aw2 R1thl8eJaTOT74Ik2v5yhyn4k7IbbkY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Matthew Chae Cc: Michal =?iso-8859-1?Q?Koutn=FD?= , Johannes Weiner , Michal Hocko , Shakeel Butt , Andrew Morton , kernel , Christopher Wong , Muchun Song , "cgroups@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mm/memcontrol: add memory.peak in cgroup root Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 23, 2023 at 07:00:57PM +0000, Matthew Chae wrote: > Hi Roman, > > I'd like to get the peak memory usage recorded overall time, rather than at a certain time. > Plus, I expect that the systematical way might have better performance compared to userspace sampling. I'm not necessarily saying to do this in userspace, you can try add a new system-wide counter (new /proc/vmstat entry). Obviously, it might be easier to do this in userspace. My point is to do it on system level rather than cgroup level and record a bottom of free memory rather than the peak of used memory. > If I understand correctly, recording the bottom of available free memory might not be helpful for this. > Am I missing something? Why?