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 1AAE8C5B543 for ; Wed, 4 Jun 2025 14:16:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F2D16B05C3; Wed, 4 Jun 2025 10:16:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CB2F6B05C4; Wed, 4 Jun 2025 10:16:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 807C76B05C5; Wed, 4 Jun 2025 10:16:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 618A36B05C3 for ; Wed, 4 Jun 2025 10:16:28 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D2E67141709 for ; Wed, 4 Jun 2025 14:16:27 +0000 (UTC) X-FDA: 83517918414.06.48A2BEE Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by imf15.hostedemail.com (Postfix) with ESMTP id C1915A0011 for ; Wed, 4 Jun 2025 14:16:24 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=vutKBtro; spf=pass (imf15.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.119 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749046586; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sl7zkIjY2EtL4gQUaLHHsUyVaTgNOPl8UyCODnHq/ts=; b=V3TxcYZ7SkPWcc1E9F1QgXr85OduR9kmFXFB/SDSTAqvFVNoDoUXkV0pkkNDenb0z+JaNG p2EWlUsqlSC0eS4zE+ueSQHOoXWqOFKfx9vUIl+/kPd+1aEKaPAxVzeEskig6YT0WNiXsU 0Km78wsAa5dlql4yQzp0FCJd8G+qwv0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=vutKBtro; spf=pass (imf15.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.119 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749046586; a=rsa-sha256; cv=none; b=5gtvlT3hLA2p4qIgldhqOOEJjZgWTP0V+A6yc0VGRXaqLIMnNRZkKCMx4fsVeipRWn8OfL rNOX0LS4G1B2y4F2X6UHg07HqHB5f4H4bwSrTbhQHkAI73TniofcJ6XrfvEDrn6xJdA6vY 51ZhpNxX0NNDOlLIq0dhTNaywhc5oxg= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1749046581; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=sl7zkIjY2EtL4gQUaLHHsUyVaTgNOPl8UyCODnHq/ts=; b=vutKBtro0b0lToHaUdzBqdVefNiQji7KMrNS9jtAh+jwlWKeLW29Qn6jN/MjBTugufHK9B8zbWdYn9oUCTBfW/HKgHXtHQnmUdVyn3GIeVBofNtof2xUOGoXq9SKMvH5ehLH9sbFvBblAxpnpoYgAQWTrU934YePJa7oF6j5v6I= Received: from 192.168.0.105(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Wd4ZSft_1749046579 cluster:ay36) by smtp.aliyun-inc.com; Wed, 04 Jun 2025 22:16:19 +0800 Message-ID: Date: Wed, 4 Jun 2025 22:16:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: fix the inaccurate memory statistics issue for users To: Vlastimil Babka , Shakeel Butt , Michal Hocko Cc: Andrew Morton , david@redhat.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, rppt@kernel.org, surenb@google.com, donettom@linux.ibm.com, aboorvad@linux.ibm.com, sj@kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <4f0fd51eb4f48c1a34226456b7a8b4ebff11bf72.1748051851.git.baolin.wang@linux.alibaba.com> <20250529205313.a1285b431bbec2c54d80266d@linux-foundation.org> <72f0dc8c-def3-447c-b54e-c390705f8c26@linux.alibaba.com> <7307bb7a-7c45-43f7-b073-acd9e1389000@linux.alibaba.com> <250ec733-8b2d-4c56-858c-6aada9544a55@linux.alibaba.com> <1aa7c368-c37f-4b00-876c-dcf51a523c42@suse.cz> From: Baolin Wang In-Reply-To: <1aa7c368-c37f-4b00-876c-dcf51a523c42@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C1915A0011 X-Stat-Signature: cem3bfx4sd8o6osycxw65bf8j4snk451 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1749046584-168864 X-HE-Meta: U2FsdGVkX1+VIB0siTvJZgvqVzvz+DfZlCbv424ANNsv7zJnwp0YmY/kJMIw6FIDINUJuIMlJLpV3dsrSJQmE0g06slaCREtqrEC6UNw5lLVGPYxYBgPEIJkfWf5526szyez2F7x6vQf4oliYe/jU7paOxfqRt3WPWes9x3wGL+5xabO8p7YHxRoMXecYzSYv5ngtkUJ4VicaiDwO9ygjqB6eZGN3ezE3nRg9mkA+oa/6IU3qBqq2EnK+eZO2k+E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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: List-Subscribe: List-Unsubscribe: On 2025/6/4 21:46, Vlastimil Babka wrote: > On 6/4/25 14:46, Baolin Wang wrote: >>> Baolin, please run stress-ng command that stresses minor anon page >>> faults in multiple threads and then run multiple bash scripts which cat >>> /proc/pidof(stress-ng)/status. That should be how much the stress-ng >>> process is impacted by the parallel status readers versus without them. >> >> Sure. Thanks Shakeel. I run the stress-ng with the 'stress-ng --fault 32 >> --perf -t 1m' command, while simultaneously running the following >> scripts to read the /proc/pidof(stress-ng)/status for each thread. > > How many of those scripts? 1 script, but will start 32 threads to read each stress-ng thread's status interface. >> From the following data, I did not observe any obvious impact of this >> patch on the stress-ng tests when repeatedly reading the >> /proc/pidof(stress-ng)/status. >> >> w/o patch >> stress-ng: info: [6891] 3,993,235,331,584 CPU Cycles >> 59.767 B/sec >> stress-ng: info: [6891] 1,472,101,565,760 Instructions >> 22.033 B/sec (0.369 instr. per cycle) >> stress-ng: info: [6891] 36,287,456 Page Faults Total >> 0.543 M/sec >> stress-ng: info: [6891] 36,287,456 Page Faults Minor >> 0.543 M/sec >> >> w/ patch >> stress-ng: info: [6872] 4,018,592,975,968 CPU Cycles >> 60.177 B/sec >> stress-ng: info: [6872] 1,484,856,150,976 Instructions >> 22.235 B/sec (0.369 instr. per cycle) >> stress-ng: info: [6872] 36,547,456 Page Faults Total >> 0.547 M/sec >> stress-ng: info: [6872] 36,547,456 Page Faults Minor >> 0.547 M/sec >> >> ========================= >> #!/bin/bash >> >> # Get the PIDs of stress-ng processes >> PIDS=$(pgrep stress-ng) >> >> # Loop through each PID and monitor /proc/[pid]/status >> for PID in $PIDS; do >> while true; do >> cat /proc/$PID/status >> usleep 100000 > > Hm but this limits the reading to 10 per second? If we want to simulate an > adversary process, it should be without the sleeps I think? OK. I drop the usleep, and I still can not see obvious impact. w/o patch: stress-ng: info: [6848] 4,399,219,085,152 CPU Cycles 67.327 B/sec stress-ng: info: [6848] 1,616,524,844,832 Instructions 24.740 B/sec (0.367 instr. per cycle) stress-ng: info: [6848] 39,529,792 Page Faults Total 0.605 M/sec stress-ng: info: [6848] 39,529,792 Page Faults Minor 0.605 M/sec w/patch: stress-ng: info: [2485] 4,462,440,381,856 CPU Cycles 68.382 B/sec stress-ng: info: [2485] 1,615,101,503,296 Instructions 24.750 B/sec (0.362 instr. per cycle) stress-ng: info: [2485] 39,439,232 Page Faults Total 0.604 M/sec stress-ng: info: [2485] 39,439,232 Page Faults Minor 0.604 M/sec