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 5F8C0C5B549 for ; Thu, 5 Jun 2025 00:48:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ECCE86B04D1; Wed, 4 Jun 2025 20:48:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA5016B04D2; Wed, 4 Jun 2025 20:48:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE1AD6B04D5; Wed, 4 Jun 2025 20:48:18 -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 C0D036B04D1 for ; Wed, 4 Jun 2025 20:48:18 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2E8131A0E2B for ; Thu, 5 Jun 2025 00:48:18 +0000 (UTC) X-FDA: 83519510676.13.894170C Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by imf11.hostedemail.com (Postfix) with ESMTP id 418BD40007 for ; Thu, 5 Jun 2025 00:48:14 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="UodMRz/H"; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf11.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749084496; 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=hoFzIfUZJ4wj8058GkOSPWGehDB1B6IcsKmHwslnUG0=; b=LSlCRJQsBJEHA61Op0XQ9r23GF+8IRgJtjjFdjIL/76Z7nHvrHvQw7RZuID/pV6uYOJqvM VWjG59mWofRBNLvNttdIWIpxilyYZZjIP9MhzBsCo22I87xGEMMELoMXFzm0KrbOG2T2T2 KdtSYYNrhiKi7VMxbHGnrUbzgOd11vk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="UodMRz/H"; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf11.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749084496; a=rsa-sha256; cv=none; b=XpgORRBAeGiRwpzH5Dn0cP4KkMwWt5eOakJAaxgTF87PfWVI/sPhI01Boea38x2aC1TTU1 7mycswtZZhWBIC0AtwY3DJWr9jNI/Hmsz5XZb2/eePoiF49JRGF5XWiKo3kdKR7OjYD5T/ EuxV8FWP5fr+r59yIGvp0TMnGPklNCc= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1749084492; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=hoFzIfUZJ4wj8058GkOSPWGehDB1B6IcsKmHwslnUG0=; b=UodMRz/HOMIBX30RINyRFY2tD1EH1zPFYc2AwHaP0+L3+7NkM1Rj/uMBghFVnuLOHzd6KQGriFSxHvmuw/n366oV51rq4jUHR16hM0W7eaN42++G6GyE9Xf0LmVFtCTEfc8Xqkp2KEquxx/WQP+fdXikxQNUFeWsrldwj8xHa7g= Received: from 192.168.43.81(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Wd5p7oJ_1749084488 cluster:ay36) by smtp.aliyun-inc.com; Thu, 05 Jun 2025 08:48:10 +0800 Message-ID: <985a92d4-e0d4-4164-88eb-dc7931e2c40c@linux.alibaba.com> Date: Thu, 5 Jun 2025 08:48:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: fix the inaccurate memory statistics issue for users To: Shakeel Butt 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 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> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 418BD40007 X-Stat-Signature: 1u7er4w4ce7rkrnnipaubja9zqk67qoh X-Rspam-User: X-HE-Tag: 1749084494-954977 X-HE-Meta: U2FsdGVkX1/tnymYq624rspTcXEw85tIUduMQgM8QTP7fVVUDE4PioGlTiztT6J7Yn5noP9b4XYJ6ZS5vEhx8RLlm/ZqB2yMtKHuWgqZKHJH5HEuU95aG8lOp27KzPyAlzJRtGt8Far/EYbrD8kxULh8QZkLHbzHQF73LCDDthAVprXkujgtYZYWyJCXm59nXPU9mpNX0ohC65BQXMlx/VnfzGyKHiwv2PpyCCaZ8texWoPL2+LEgLM8/uzyOu7JFwjyfthtEh4bGvMMHo0gIzGU62KDX3rSKfVoMnoNi8NQvzKOD+x5C4PruZM7ndkZjOk7musqF6GlN7Delckb71Y2KTut4SkYy+z2Dt5PZ47PlkkleOqLOMa5YR9HJs57mpi1tEw6K0M+zJIDTxvJ/kbDtwQ5X7xopIoumWNYw8WWbsRUxdHz8SSBn1W/XLrglnFli47shg9cBdTzSGZVEUFIF/humx3hnl7NB/uOqgQssqBBOejHtwoZCTn/SGhLj5d7y8AROD9AaTN5YoOpOo56ZWvVGVut4TesASRQiswY7APakVEqvsIAL+/0l6vlvPZq67Xo99+K4LKHdtVRbbUfDUp3kxWx3/7T4/t3lfsgnUt1q60FpeVc7O6oqFYjGbvvwtiBaBajep7xU5n8k7sd59OZFFqJKZMAXzfTlN8GMkapi7+F9dubmo06IcAeYKQQCRxWbaVb0pZPdT/UQKgm1/+uhsbESjXNlveRhHA8G1+tNLZ3O1HbFiEa2caI6nLuC483+33gigecTqAuwVjjPYTg3jeVlMbtyCUA/ddYD7S/iA1wG1hIg63Xqcro8jqTVAEzEkib/wjaCloG5fSffVXmtqLDPUvSHFPW3PwIkJgigSk1MxlVojXv7RSzGHRXkjYG7osmQlEp7S1WPTwYnRLOyLSTJINk/4wAAcp8be8wA+rjlwR65aY2nZj5dzKeOhw3dIWroJ/VOiS KZRFdFU9 gwS11pcVbnPO14IxHFo28QQ3NdjaPdxwK/RGMndgUlG1EznTpnKxylr4jB400/AXpQoeLWAS3jhDJRvE4nJwBr0zSQJgeuH9ZBLsGy59MHft70T79sBRLJo+zZEX78Z04HyV78EsHVkFXbA9LnRW0p4t20QpzKnzUd970DRTQkN2MqwcutdOhQIKrtZt/Rd3DfeS5rMCSsCDRCht0XJgbsTr/mMKfFCDck9p/XFwbEENNXbPqDD+fck6jPPCQR6rSbpk5d9VWSAIcYdUKJLPOicIlWkXxSRWLX7EMm95HOP9jjEI9GiWzHKBJ0+ooy3AHmHRc88ASwKipaGY= 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 2025/6/5 00:54, Shakeel Butt wrote: > 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? Yes.