Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp78002rwb; Wed, 18 Jan 2023 14:25:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXs58PAZC4OwQ034GhtQvmpBXbpYiTw/BgSTDMtI2q1g6CJRomFK/WmnbZUzTuX0NKN2Ac93 X-Received: by 2002:a05:6402:17d9:b0:498:ebb7:d8b9 with SMTP id s25-20020a05640217d900b00498ebb7d8b9mr8640281edy.5.1674080703513; Wed, 18 Jan 2023 14:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674080703; cv=none; d=google.com; s=arc-20160816; b=DlQpjssI0LU67dyzY1m52ZVEVrdHh+9grqAnekQcxzaVaInQdsQb583GWyP8FpH6NK pZPCktaFXlh2fKYd/3DxIv8joD/AvHGyiqXPotgCbUZ+8edKU4WRIBZZs7n4tY5wH6ps UlwPbzu6vkL+p82claus/v8u2t6EzfpvU9v/MV8iYePKltWhpl8FMtBh2dPrgcM/6Hl1 eJj3KvGYuwgs7RabMfWmu5Yo7ElFoJI8CfSGjLZyVhcF5ZnXoja1FHQnhASAAW1BvMXq blnCGEx8pldVtG8P2XTROeg6ghDbH9ifdDTIpAcXAmZW45vKdpfUfM24ihqbHxm+t5Tx SRIg== 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:dkim-signature; bh=89f0PyHMTcU1wP4oLEjhhdUSmrRlYKAe9wYRnXUS3o8=; b=bY+W5tYc9cXNHsOOPiqm49sYMDYpg5SPLy1K8J5pLVv69cm1NF57oX8TGkBSPeXz6+ +wJxzhFc3JKKcxgHEH6a/TzUwWzqmNift/rD+qBrGJwIiS5S8BOPUWyL6XJyEI9iUeWG fIU7gJtZeN7yyZtLwk7sUG+36UUI7bUZenrERc6+sHfJ9RzeD+I5esTQnU0dsC96Svnv BN5w7ZAoKIMxbvF4r87hroxMWsjbaeXhB3ALr+kQRDVwntgGWBae+1lS/6EFJ8jM8i7T 6GM8LW9LLbIwAUxm+iF9k6Ea0EugoMvtOOAoMHyzEa/0NXiPZT9xEQcVAX/mEJT0Xvu7 mDgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XI5WJWm7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr6-20020a1709073f8600b0077bd074d50bsi42218060ejc.105.2023.01.18.14.24.52; Wed, 18 Jan 2023 14:25:03 -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=@suse.com header.s=susede1 header.b=XI5WJWm7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbjARVPD (ORCPT + 45 others); Wed, 18 Jan 2023 16:15:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbjARVOk (ORCPT ); Wed, 18 Jan 2023 16:14:40 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226C453E4B for ; Wed, 18 Jan 2023 13:13:40 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C3EBD5C332; Wed, 18 Jan 2023 21:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674076418; 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=89f0PyHMTcU1wP4oLEjhhdUSmrRlYKAe9wYRnXUS3o8=; b=XI5WJWm7SzfxR1z66yjeCcGNGrLMKHRuO2AR/iADQPTSG42FHZpSIgrQBXanf5uhucK3uD EMJFapFzmsgYIJ6B4FvK3t6HZqb6Dg6bKpC9qxHhieWRETt8hbSEn0+goojAVwIuimog9U 4it1d/VWddMXDsvoZ5zNb1APWwJmmBE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A823D139D2; Wed, 18 Jan 2023 21:13:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jvHDJgJhyGOxMQAAMHmgww (envelope-from ); Wed, 18 Jan 2023 21:13:38 +0000 Date: Wed, 18 Jan 2023 22:13:38 +0100 From: Michal Hocko To: Minchan Kim 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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 18-01-23 09:55:38, Minchan Kim wrote: > 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. No, not really. MADV_COLD is about aging. There is no actual reclaim going on so pgscan/steal metrics do not make any sense. I am asking about potential different concurrent MADV_PAGEOUT happening. From what you've said earlier (how effectively policy works) I have understood you want to find out how a specific MADV_PAGEOUT effective is. But there maybe different callers of this applied to all sorts of different memory mappings and therefore the efficiency might be really different. As there is no clear way to tell one from the other I am really questioning whether this global stat is actually useful. -- Michal Hocko SUSE Labs