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 87067C32793 for ; Wed, 18 Jan 2023 17:55:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E9936B007B; Wed, 18 Jan 2023 12:55:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 199426B007D; Wed, 18 Jan 2023 12:55:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 039916B0082; Wed, 18 Jan 2023 12:55:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E9C056B007B for ; Wed, 18 Jan 2023 12:55:43 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A9E3812034C for ; Wed, 18 Jan 2023 17:55:43 +0000 (UTC) X-FDA: 80368672566.25.ED8118C Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf14.hostedemail.com (Postfix) with ESMTP id EBBF9100011 for ; Wed, 18 Jan 2023 17:55:41 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lnKfyPJG; spf=pass (imf14.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674064542; h=from:from:sender: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=UYGzASaMgdQyU1ai4B9HmCaBD8gCFtuFaG8+LyR//88=; b=rRPFmooXc+p2DKwmRoD5qkKOWuVVyA9iJv/YwHSTCLgyHPKwlFaqrW2m5LFQ4B2giOYj1Y o2dhVXoBL3hmkWWoGNlMuPUb/CRpj3H/8XCNyIpRh57qdBGysuvF03f0yotct5FppCZqbH chlHmnNU7Se+KN2zd4M8kOvkUIrPq+A= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lnKfyPJG; spf=pass (imf14.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674064542; a=rsa-sha256; cv=none; b=lJRYefKR8q8urGRFIa3t2WSomT6X1KJpsqu167GksjAxNDrqtSV87srhKGZWBoWdZyLx+L +yeF+mfHp45JvqnbcaziOx7gWUdmhtJUNf2vuT7fQ+uU3UHdJykvx0m9nPLcSpNBqzkfCl kRu2kPjD4IWvynQU8MsChGOiBLfGTyg= Received: by mail-pj1-f51.google.com with SMTP id d8so5405834pjc.3 for ; Wed, 18 Jan 2023 09:55:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=UYGzASaMgdQyU1ai4B9HmCaBD8gCFtuFaG8+LyR//88=; b=lnKfyPJGbs8A+mCtmrZjqEM/BcBIseTpfRe2r6p5gq1nxsUqBbpk0jWG+GimPdv/rD jOsHkFfECEUpSfGJEJYTeEXS1L1FbKiHmE0XozSU2mS1f1TduHHJaQknLrZgRv+jQ5+l aVABAzOPPD8cgIrPTJ17FFGRhSbLhwJsWhw/WG70pWcgnVTCdbYJ5V49lRir9xiOutnM SXi54/x+ixBN9lK7fomTV3OQaQ2+lPzKhKMLJGeHb9Ye5lyoqve/qNarwfY13mLRv7Yt zA/e5ZTfysgQKZneOzzrNoidE5toxgeB4dZHeJ/sB6iHoThV9a9QopCoFPCURZrdjrNN HzrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UYGzASaMgdQyU1ai4B9HmCaBD8gCFtuFaG8+LyR//88=; b=F8KudtxwDOKMgj+6tZ3JxudbT/O/GcbTegfDUEBa9Uj+Gt2ExZ9Kzek4VzSTH89WLM fgPX4+KibihfyJduV8i7imbJ7MuGOQSxRj9s2Ds9wcQHwDLkHVto+8KqjokUf9hyrvcF 9Ecil3wAqhTtCQHCga2Y401SeX/85/EGWIu4l94KWfSakPLshNWF8I9wyOyMZ+3sC8xh SPXQ9xLniLGh/SQa+79bgxV8Ve59vmqBmGMkJRJdy+F1bEWKIaNbc4LY0mUmTT43Vfps NIUEcM61FQsORRDDZGaQ0ttY0pVVdGnIlw0b/YJbvc6Zc151jG1Xyce3a6pln8l33Aur 8YCg== X-Gm-Message-State: AFqh2kprgBjAZqxsAsrtZRdJKCoRs9GBp2I2DYtk7ZOSEa8dajtnZydZ +7eas328fWAEMi1CdgFn2zc= X-Google-Smtp-Source: AMrXdXsqg/OuflhDxILeOg/AYcDPGwOirg6fqeC9y4S4JCW4FxxYz6rhoSzTduz7Hkz1P+MrBfsjcw== X-Received: by 2002:a05:6a20:cf62:b0:b8:775b:2caa with SMTP id hz34-20020a056a20cf6200b000b8775b2caamr6943557pzb.42.1674064540858; Wed, 18 Jan 2023 09:55:40 -0800 (PST) Received: from google.com ([2620:15c:211:201:68ba:bd93:858:15d5]) by smtp.gmail.com with ESMTPSA id q145-20020a632a97000000b004a4f24fbce9sm19174361pgq.5.2023.01.18.09.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 09:55:40 -0800 (PST) Date: Wed, 18 Jan 2023 09:55:38 -0800 From: Minchan Kim To: Michal Hocko Cc: Andrew Morton , Suren Baghdasaryan , Matthew Wilcox , linux-mm , LKML , SeongJae Park Subject: Re: [PATCH 3/3] mm: add vmstat statistics for madvise_[cold|pageout] Message-ID: References: <20230117231632.2734737-1-minchan@kernel.org> <20230117231632.2734737-3-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: j11mxjo3kyo6g1b9xf8afuxw1zju5tyo X-Rspam-User: X-Rspamd-Queue-Id: EBBF9100011 X-Rspamd-Server: rspam06 X-HE-Tag: 1674064541-687414 X-HE-Meta: U2FsdGVkX19Kost7fgc5TotGO/ie1rix0LSlpmD8ZKdaFd/MSEWqQfxAKiat+8x1xny7G2U4cp+JzS/A8QERRgozZ9Dv2vkKYjxzXcFhqVdEdNi929Gi84BcPUdhbcVIDwNRSctY6J0y4UN9x2ZNsM4rTErmJrrRGi8iGcdeR1X6NrlY6emsgZfWsyqLtdVe6vDiXUHcBlay/8ifa7BL22R4yD2vMFctia4EsLqUhubAWQWIZ8stkqMxXNCz/zLR2kh14vFSVbHJvPQoQxRHmOaw/CU6WFZgKCYucP/SPRDDN19S0LYtIiHCtacTe4r1f/vbyhAzq/sD78HrrVEIYrsQKZIAgKqiJ5XbWqKngDktprbgnYNf0hT4ms2RdadG+tVDrK5XdgfNhOKBpsyuYNxTcH3/Sf/y9Erjk/fDodZi+Y759p4LBzVCjE/YrnWKbdOdEvn9Sy0H75op9bpNKfZVRIuv4tJAorkBk1igw1iwnxUyoqeLtu2mGiEEtnVefPelOwP15dup/jtaAi9r7kUc6uw+3BlhGSVqhJJ9szveNq+iW1AwEgNT7z0GHpDRhoQm6gtI4/AIneFgJyrdHcluGZeg6J8CkfHUb7Qi3PGK+LADmWwpR8RnUVMQG9LGmTnGAQh+7hZlAJIq1UhhcaSNWLn0KwZV70xZktJKCkydWnFHuyVSwgITt0w/Pr1kMbkr5G0JGY4Axdnkk2tq+nb1hcVdcanbk7PC12wsAlhp6Qz4Bj3c7GeJq52Lh2zkSu7t5ilI9Me2RYcojbXRL6+MuINvluf19Q1sUJPNK1KFSTZDgWLmNmNB/l+L8HH052ZnWx0z0X1FOiGtkYn8AiYjKt3caKRrbjCyr4t8qeqIKu6EzQWpNX46JTjof3lIi3l2WPFc39+JLHz+GlbfMQusi7Tq7Pe/AAjz6h2eGITG6q41jMIyowRhSNCNZCuzTa0zFlU86FPUr4SP2dk GrJcljWi e1dN0VLo6G4RArA7Nzql6b/5vaf3daIPtedBJhjBlhBLc5R3H92UvVnxdSVds98AA1qXTph1u9ISqf4c5TPuWowmvg3rYhyxBiIuUyS4zNF9AIWnwQwMfUDaumKLypfEsDSJkLZBQoAtO2C0GbbQFvFu5acGqBaFHWMh1V8fD7AiFsJBtkBdYNuo6s843rHbSXoyzs11nWNSTAkT8O9ryIaDcbJnQRsdaai53UQ0RHljo78n/mz/8dAG+jko8kJdl917tWRpksKcoUbRnAM3NCuOECtWGPdwSrnDxy23dnpZSqsLnVMhGFfv5YWVSzWyJH4lEUZRF9djqALe3QBXjuBrZOA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jan 18, 2023 at 06:27:02PM +0100, Michal Hocko wrote: > On Wed 18-01-23 09:15:34, Minchan Kim wrote: > > On Wed, Jan 18, 2023 at 10:11:46AM +0100, Michal Hocko wrote: > > > On Tue 17-01-23 15:16:32, Minchan Kim wrote: > > > > madvise LRU manipulation APIs need to scan address ranges to find > > > > present pages at page table and provides advice hints for them. > > > > > > > > Likewise pg[scan/steal] count on vmstat, madvise_pg[scanned/hinted] > > > > shows the proactive reclaim efficiency so this patch addes those > > > > two statistics in vmstat. > > > > > > Please describe the usecase for those new counters. > > > > I wanted to know the proactive reclaim efficieny using MADV_COLD/MDDV_PAGEOUT. > > Userspace has several policy which when/which vmas need to be hinted by the call > > and they are evolving. I needed to know how effectively their policy works since > > the vma ranges are huge(i.e., nr_hinted/nr_scanned). > > I can see how that can be an interesting information but is there > anything actionable about that beyond debugging purposes? In other words > isn't this something that could be done by tracing instead? That's the statictis for telemetry. With those stat, we are collecting various vmstat fields(i.e., pgsteal/pgscan) from real field devices and thought those two stats would be good fit along with other reclaim statistics in vmstat since we can know how much proactive madvise policy could make system healthier(e.g., less kswapd scan, less allocstall and so on). > > Also how are you going to identify specific madvise calls when they can > interleave arbitrarily? I guess you are talking about how we could separate MADV_PAGEOUT and MADV_COLD from vmstat. That's valid question. I thought for the start, adds just umbrella stat like this and if we want to break down, we need to introudce sysfs likewise slab.