Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6844555rwb; Wed, 18 Jan 2023 10:03:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvVusJpPzRv53cbjjoERFaW3c96flKKBP1n6HWxQO0uW+sBLSYcCJaYS1Ro7BUdRyN81bl X-Received: by 2002:a17:906:489b:b0:850:52f8:5ca9 with SMTP id v27-20020a170906489b00b0085052f85ca9mr8062320ejq.28.1674064990862; Wed, 18 Jan 2023 10:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674064990; cv=none; d=google.com; s=arc-20160816; b=Y7d7KfIhA6bHp5Al2gB1FRqd56T5fxTMOvLKTd9I/CC6O6I47bLCifaKBAgs1yRpro vK12eOoo+VZLOTBTH9uG1j6o31i/cXXkiD6t/PkeUjF1CaQq84m5UhXkHUgbs2bJ7NMt KPmrZg1ZoWJe2OBeQrkt4rKavQ4bWGnEEw4Jh1fdwm6ipQlnL17jY2IZDm+n50Alsn4v XGp0e2eHV7nWJOEYK22+9BqbJbOer18+KXW368l+tSRqGwYi+Ws87Qft9a+IdOsJpIQh +HOZraZMjHgLCs1DJumB93nf1PnM4IWE3F4RVeyKkkdn4H0a5JjrpNRrMEuRSL0os9cA I0/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=UYGzASaMgdQyU1ai4B9HmCaBD8gCFtuFaG8+LyR//88=; b=p+9oQaQp2NLE+RpBEI7YzeWw6O/JTSxqaJNdocqsnAX5xBbvsirozgOdwererdDEBS OxaB+e2yBQFcMxFe5o8qbOCpQuyHMeB0r4k7Wep0EUSzRwEguhr1GMJPl5G5tHsDPdzK xPJdWxtEagGHFzbU1yWUEFV7ZCIEt+GTmifN9tHokLGOgtbpN0Q3makkBbrEitQjpPJn /lkyc2zrzgngFmwUkl3xt7pyrjdn0tOLrWJPT9XFpRMr2gZiXDaN5ScSDyU8thdka20v KGl/wewpi/3xhbZBWoe8Df6M+ysCP76ve6NyJufKjVipeEuw0OiDbO1MEUi418W3YJ0v wU7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lnKfyPJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd8-20020a170907628800b0078e15c30a6csi41456208ejc.559.2023.01.18.10.02.59; Wed, 18 Jan 2023 10:03:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lnKfyPJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbjARRzn (ORCPT + 45 others); Wed, 18 Jan 2023 12:55:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjARRzm (ORCPT ); Wed, 18 Jan 2023 12:55:42 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 673124AA55 for ; Wed, 18 Jan 2023 09:55:41 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id b10so5077282pjo.1 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=aOBuodkBJjikdfUrkmh0H/hEHnFw+NxRhaI4RPi0s0roYwVjqZ4rMsc4P3jy6VJwSE eY+3aXBJUierL2+VkIqCUWXCk4H9J9z1IAtuSzmM7jocZvl1jmohlH6XKcI/bN6mJOef QlkDnWqY2wyMpqNg9Bcrqhv/uFVa4j5hl7rNMxszSeHR28K+lVsSibsS/UHti4pOmDUQ SpHIc12a52kAqMuNDKmnc4e2UjfWOHUFw40s8xzpYXZ6/5cSXO6XBqyDfD4RdOCnz6Hi 1ghLcBqsEgRItKs1ZYsFN9fJ4RAFZolVrQXJeU+v/10dtSbfXyjtRVLQcP5agJ6L4ro3 HuUA== X-Gm-Message-State: AFqh2kqFamCJK85yybf8ZhYEtnIweNKghYvI40N8ZEapgNlfBpWxEhct O/rHljMfM+YH4hfbZo5p9Gg= 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) Sender: Minchan Kim 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-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.