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 50646C71130 for ; Tue, 8 Jul 2025 02:47:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5B7D6B03B2; Mon, 7 Jul 2025 22:47:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E331F6B03B3; Mon, 7 Jul 2025 22:47:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D70FF6B03B4; Mon, 7 Jul 2025 22:47:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C96376B03B2 for ; Mon, 7 Jul 2025 22:47:52 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4487D1A0464 for ; Tue, 8 Jul 2025 02:47:52 +0000 (UTC) X-FDA: 83639562384.17.1CE9985 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by imf02.hostedemail.com (Postfix) with ESMTP id 5BE3B80006 for ; Tue, 8 Jul 2025 02:47:49 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=TtUObttV; spf=pass (imf02.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.110 as permitted sender) smtp.mailfrom=ying.huang@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=1751942870; 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=DQr0YCrQUB39u7/5W9qapxDHiBmCU/Fl1/td/w4vO4o=; b=j8I9X7XeC6x+mWrTVKzCETltRNUx3CbSP5JrclOMQyKmcVWlPQAcHOP0hMGVcyQUFvT+ty 9m8mWnamSyWahJWHeUNjHb47g63FC2a8w2r18SWnFA1WQlqLr05upWua1+SQsxafUpimf6 uXg0i3U8BpFO+ials9AQgA/vXne5cjs= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=TtUObttV; spf=pass (imf02.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.110 as permitted sender) smtp.mailfrom=ying.huang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751942870; a=rsa-sha256; cv=none; b=DEonmdEowUVgS5evwCiYemWmDAdzayq4jHv4PAxScuwNMZ3GWIR4li13wGUyfeU4MtV10M xHr0M26Ab7xPrV1WN/xOrvzptzXNOmhs+NSTzT2kUaNcjrTYhEut1j6200ahOwBgoBDQnz XxMYkrMtmN8RElfLy08rTBjnzVFMdsc= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1751942866; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=DQr0YCrQUB39u7/5W9qapxDHiBmCU/Fl1/td/w4vO4o=; b=TtUObttVk1b4AZmasZ+RS2v4EQc4AVJb7S2sXqm378+n/JzpuGg3oqdReaGkhwKsrT5kfYSr1hL7duIcwn2bkxQ7BGL4OVQt0Jinrqdxo1k3yxe77LU+lagylUarWRJjGH1TAdsntj9QkxGiCk7FtXXUrkModuieoipM6UgXoxo= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0WiJ5bee_1751942863 cluster:ay36) by smtp.aliyun-inc.com; Tue, 08 Jul 2025 10:47:44 +0800 From: "Huang, Ying" To: "Zhijian Li (Fujitsu)" Cc: "linux-mm@kvack.org" , "Huang, Ying" , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "Yasunori Gotou (Fujitsu)" , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "lkp@intel.com" Subject: Re: [PATCH RFC v2] mm: memory-tiering: Fix PGPROMOTE_CANDIDATE accounting In-Reply-To: (Zhijian Li's message of "Tue, 8 Jul 2025 02:26:54 +0000") References: <20250625021352.2291544-1-lizhijian@fujitsu.com> <87tt3nxz4x.fsf@DESKTOP-5N7EMDA> Date: Tue, 08 Jul 2025 10:47:42 +0800 Message-ID: <87zfdfwg8h.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Queue-Id: 5BE3B80006 X-Stat-Signature: nixxtynog7yxxq5dosjgzimgi4dkr48g X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1751942869-69383 X-HE-Meta: U2FsdGVkX1978MM76jmh9u70psey65PSgBj20WQ3hm+DawDx+p4bLn7rfk9alMJNn78ho56RDt/psaAL1UooPmEqmah4YVBjSbkTKfcWUd1DvTQhNnW0yuCZi4ayBX9M5lR6AgKbK1TsS75X0dnx/xQrwQ2jISxOFiqnOR4M8zVbeIj9SgH/wQZXVj3uWrkVmLPME+rtjqYqjH1MT8VFuRlzeL0zl3SurN7U9tkVcvlGPRlCej1ubPZZXyHdg1Ja1/3CMjhpxwIPO4/NeK/RbdiDc57pkxq25Y7h/WH3CmTc97W2Bk+wxgMB/IM37ap4n18h5BgunS/RKhY2vVrSHpiqKwt43mJfjEwHm3ws/G5ztTEMXZqV/WMslYCyigrFaBhtZLsdVFP8cy0/Z84bIGCbcVlrS2wQnrhV3w/Q7EuGty7u6+BlxM4lNjD7jIjFbDR1OeLg8Lkm/rH7i1jRum4Ei0TboC+N0sLcPUldGCKsehyH+3sXLa+v4EV+iKL6y2/x84+LFA3OpdGVX/n3HWmQEBqT2P+3YDFvzIWn1H/xBtzphLHaOoOtXT5NcDCt0TCqzFZ1YV1A/NfSP35mBBKGMgTSoXb27xYEJ7yihSoNtii+Hbg3/S+ioyD9K3uTp9bybFg9ZyP2Iuvn0wupqe2Oa2Cc2Ln7CmZUn4GJ7R/8YgdWILjWNxuluK6j3Nk6k1M73s5ki9VIKLBDFYFd70awHn0dAswxJMnCWLb92m+54q1sRtimb8xfPYi68H0BpJIHfFoCh1A4B13OoEqsW8nZjUhG6YCzp+g+/mqDtZSmO7mtlckXYtpHkUObGLELiNzpLfc9fJotYSTNvuC/zMIJ9A7ksZ/EQGz/DSzSCmitpfeOeyQ0GW8Q1valGXOw0/7iaQ1EWvgBGUoxmHp5mJ91G1Y6gxwA+9YTKGDpGqNyY9d4RF+lomIy7hZHR6KZNCiSuvDV15Lzh88R9dg VdI1PcRI xLLb823+PsL/mXulYcfvI8hqe46NUWdph7xj5Q/s55lSq87+bimwe1awb3ty0v2x1rze4KNLD6F4pSpQ56cbPr+jSfGnuwj2EJ98C1LhEoZZUa8zL3lY48mXK6LRytzXDX7ptEii7STCfUWiLNvXd99ABKNLY6vtyFN/yqoGOZa8KYsEtLJLRaLuftuiWvWcWGzJGi3WaUaap78sio77L/moApUXkGgOcWpR0LbVV8FATPgkaLEAKN2ld4HxCJsnvlG2VIc8IJd9CJs87mclk8W2dCj5VT3ZhAXayIZ9h/zb2P48xAlpad0AcTtsvEGzmULnxNSl4u4HvkY7Nlm1wlReOI5Ec+AiGJ63p/aT3KNYC3KKNGgXxb2dwEkvR4WZkfsBq 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: "Zhijian Li (Fujitsu)" writes: > On 08/07/2025 09:14, Huang, Ying wrote: >> "Zhijian Li (Fujitsu)" writes: >> >>> Hi, >>> >>> >>> On 25/06/2025 10:13, Li Zhijian wrote: >>>> V2: >>>> Fix compiling error # Reported by LKP >>>> >>>> As Ying suggested, we need to assess whether this change causes regression. >>>> However, considering the stringent conditions this patch involves, >>>> properly evaluating it may be challenging, as the outcomes depend on your >>>> perspective. Much like in a zero-sum game, if someone benefits, another >>>> might lose. >>>> >>>> If there are subsequent results, I will update them here. >>> >>> I ran memhog + pmbench to evaluate the impact of the patch(3 runs [1] for each kernel). >>> >>> The results show an approximate 4% performance increase in pmbench after applying this patch. >>> >>> Average pmbench-access max-promotion-rate >>> Before: 7956805 pages/sec 168301 pages/sec >>> After: 8313666 pages/sec (+4.4%) 207149 pages/sec >> >> It's hard for me to understand why performance increases because of >> higher promotion rate, while the expected behavior is more promotion >> rate limiting. > > Good question. > > Above max-promotion-rate means the maximum rate during the WHOLE pmbench period which > can not indicate the total promoted pages. > > Allow me to present each sample [0] recorded per second during the pmbench duration, as exemplified below: > > > | AFTER |VS | BEFORE | > ------------+-------------------------+++++------------------------| > | Timestamp | pgprom/s | pgdem/s | | pgprom/s | pgdem/s | > |-----------|-------------|-----------|---|------------|-----------| > | 1 | 122977 | 0 | | 123051 | 0 | > | 2 | 50171 | 0 | | 50159 | 0 | > | 3 | 18 | 0 | | 28 | 0 | > | 4 | 16647 | 0 | | 0 | 0 | > | 5 | 207149.5 | 0 | | 78895 | 0 | > | 6 | 193411 | 161521 | | 168301 | 8702 | > | 7 | 52464 | 53989 | | 42294 | 39108 | > | 8 | 5133 | 2627 | | 0 | 0 | > | 9 | 24 | 8 | | 3875 | 6213 | > | 10 | 0 | 0 | | 45513 | 43260 | > | 11 | 0 | 0 | | 36600 | 44982 | > | 12 | 0 | 0 | | 21091 | 11631 | > | 13 | 0 | 0 | | 12276 | 10719 | > | 14 | 0 | 0 | | 149699 | 149400 | > | 15 | 0 | 0 | | 4026 | 4933 | > | 16 | 0 | 0 | | 3780 | 0 | > | 17 | 0 | 0 | | 2 | 0 | > | 18 | 0 | 0 | | 0 | 0 | > | 19 | 0 | 0 | | 0 | 0 | > | 20 | 0 | 0 | | 0 | 0 | > | 21 | 0 | 0 | | 62 | 0 | > | 22 | 0 | 0 | | 2016 | 0 | > | 23 | 0 | 0 | | 0 | 0 | > | 24 | 0 | 0 | | 62 | 0 | > | 25 | 8308 | 0 | | 1 | 0 | > | 26 | 220 | 0 | | 0 | 0 | > | 27 | 0 | 0 | | 1995.05 | 0 | > | 28 | 0 | 0 | | 1 | 0 | > | 29 | 5791 | 0 | | 0 | 0 | > | 30 | 0 | 0 | | 62 | 0 | > ------------+-------------------------+++++------------------------| > | total | 662313.5 | 218145 | | 743789.05 | 318948 | > | max | 207149.5 | 161521 | | 168301 | 149400 | > ------------+-------------------------+++++------------------------| > | pmbench | 8416250 |VS | 8079500 | > > > As far as I can tell, the higher pmbench scores applied-patch may be attributed to > a reduction in the total number of promoted pages in the entire pmbench execution period. > (Similar circumstances were observed in the results of other tests conducted) > > > > [0] > before: > https://github.com/zhijianli88/misc/blob/main/20250627/promotion-evaluation/without-patch/pmbench-1750988862.log > https://github.com/zhijianli88/misc/blob/main/20250627/promotion-evaluation/without-patch/sar-1750988862.log > after: > https://github.com/zhijianli88/misc/blob/main/20250627/promotion-evaluation/with-patch/pmbench-1750988291.log > https://github.com/zhijianli88/misc/blob/main/20250627/promotion-evaluation/with-patch/sar-1750988291.log > Check the usage of PGPROMOTE_CANDIDATE again. It is used not only by rate limiting, but also promotion threshold adjustment, please take a look at numa_promotion_adjust_threshold(). Which may have larger influence on performance. After checking the threshold adjustment code, I think the changes in this patch may confuse threshold adjustment. [snip] --- Best Regards, Huang, Ying