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 857EAC5B549 for ; Wed, 4 Jun 2025 16:54:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22B0C6B037A; Wed, 4 Jun 2025 12:54:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 202AB6B037C; Wed, 4 Jun 2025 12:54:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1402D6B037F; Wed, 4 Jun 2025 12:54:41 -0400 (EDT) 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 E906A6B037A for ; Wed, 4 Jun 2025 12:54:40 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B29DF1401C1 for ; Wed, 4 Jun 2025 16:54:40 +0000 (UTC) X-FDA: 83518317120.04.640A450 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) by imf10.hostedemail.com (Postfix) with ESMTP id CDAD8C0010 for ; Wed, 4 Jun 2025 16:54:38 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=X30HERd1; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf10.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.170 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749056079; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RP8vXXqZC1dV9MZzM2sbviKeH5etUynIrbvM5lyh9U4=; b=KeJMIrsVDc+iHnNj4ka8KqruuqrawWOxzuEfMKiwp+4dxB4cYMqRUgbxMzVmNxs+0USUUi eVorGv4oLFYXs+RoLiyCJ+5qmH3k/OQoEu+CQKCRulLPTIgAutQHqxcNsGQTW/qX5yMVns pqmbD/0A+7WEKITfJWobUt6oISY3XQ0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=X30HERd1; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf10.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.170 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749056079; a=rsa-sha256; cv=none; b=Vtj4TjycyACsmgEvdSSTDExOx8SKL2rwv1Oy8Mbbv/6XeIyasNgdVIjjtVStHkdsxrGgyO xN52tJ9qQyeBqFiSFuCU9a/LfZOJMyLhAUHOLKEnYha6uQs+GvJsGr/Plg042fiJoYux99 v7prKzNF9UjJcjCrViit5xhwSELUT74= Date: Wed, 4 Jun 2025 09:54:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1749056075; 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=RP8vXXqZC1dV9MZzM2sbviKeH5etUynIrbvM5lyh9U4=; b=X30HERd1QENPJC6P5RkbkC+iyoz6/q62YbxfyhIYVHzrfpu4OENJdT7gw4sIZmyEynEj0Y ElYtY3ieSk8/+c25AF/yARE8YRQtYc/05JK0i+w48d4ntt7CbqL6zG3YnQCsmYbKLiMNaA A1bGPTJuPCIohQ/KyrnIZ/uwBVJY81s= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Baolin Wang Cc: Vlastimil Babka , Michal Hocko , 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 Subject: Re: [PATCH] mm: fix the inaccurate memory statistics issue for users Message-ID: References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CDAD8C0010 X-Stat-Signature: 5oqgragtek3fehnkmxnbk9wgxdc4i19u X-Rspam-User: X-HE-Tag: 1749056078-56630 X-HE-Meta: U2FsdGVkX1+BwAV2yFLao+s9Qn5uAfKAaKF0L40b3s+T+kn2N9gO+l3J4Pg8yJ0UOxoI2OSHPZQsnMG46Qe40sg9OwJMOuga4W2yeigdKhwLfsvH4/OL+rGfnODzDgPZl5cMUsmd8+Hk02AxHhW8QZtmH0uxc0cclCn3R+eRtemTZsYFenGE7StGbxQYH4Q0HkTnM0RaNQ4DCjkUkLgglAech53s6yJreufuggLOp/3514FpsrA2b4KZuutdfI2VuW+loDC0Eop6TvqMgfYbqJULwJiPAAk8r0OEj6w8q4D8kjXV68k/ssfUQtmjHoYW/T/ATuWbf3MfhVspgxM0g4JDtkjVWV9mT3lYUh/yRIMInHtW4UL8X8egqJhAmkXpYO9BmwGJ4qjNc8PrXNyDE6o6mYTOs42GBz5fyMvu+enHmW/zkqH4lCmw2n4PdJO+b/JCf4YlSC8GFoimc+CO4XKg5bP65PywTsppnuuCS3QrsatqR1WKf8DA4CN2JEuZUDGJxnuRxFFp6WurGWJrQ7YePv8gE33W2nEJ9R1QdcNNjzFxdcltwRbapMB5+hXsHHirALZYYdP0wC3x5B+zAN8u6TUhT/HJSuuVsl3ZFMvWmk6hnMiXnGW6l7dCq7ZFj96VyyuZK8MkyeWY0HJNLR0idoyQIbVgB7S2f+jpkXmuGgPunxxhdlreAb/9UtXqvDhXNMtmwDJbK7U/al3P9aUfINNRhe4QGbkUBpGg3Qo8DjSeC8Mf5AkceBR2z1ZAZYLcsRv2EYGl2VVjyyL+OiI3EBWGBV/O8B+ryjDjQlpgmokkRuDPP7AXukxfdsO1iYDexog236o8zMVHTk28mJKoQtrP9ooALhwd82RRtJBLWwsffZADDsALfl+zCPCQaNuK0KcFJUCv+kJREEUx76fgZUyCQyMqS/XvcwRIs+LIUkZxY7yPotLStkQ3v48IdbPtKL1GU5M7Ni7w7dV 5Q/t9YPV /yaDcAeoCJDRoBGvnsbOQWmruvwBJQWJVC07w5UlVP++NcFe4P+zXcEVnblrm/BdUL7n+ayjjKztzpepq+Wy5XBm2rIErbR1OM+y3/S4Y8BU9USL0kM1WjBq6c+n9b9VHj5/Bw/Q8yM8Wkpx2+NChk84ihabndkgKWwOElpDqXRXA7+lKaDwACMKGt6aaYtDmOlst1bz6/SMg6Iut4y0rbuL3Bw== X-Bogosity: Ham, 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 Wed, Jun 04, 2025 at 10:16:18PM +0800, Baolin Wang wrote: > > > 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 Is the above with 32 non-sleeping parallel reader scripts?