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 44D30C02180 for ; Wed, 15 Jan 2025 11:19:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C09F6280002; Wed, 15 Jan 2025 06:19:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BBA1F280001; Wed, 15 Jan 2025 06:19:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA8FE280002; Wed, 15 Jan 2025 06:19:12 -0500 (EST) 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 8BDC8280001 for ; Wed, 15 Jan 2025 06:19:12 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 52545457BC for ; Wed, 15 Jan 2025 11:19:12 +0000 (UTC) X-FDA: 83009439744.17.3371AC0 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) by imf02.hostedemail.com (Postfix) with ESMTP id 7212680009 for ; Wed, 15 Jan 2025 11:19:09 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=NSqSN9x1; spf=pass (imf02.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.101 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=1736939950; 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=kW7z1n+9TJv2HJgXLQL0LGMniJNL7aDn3Y73AUVJid8=; b=HdphcNIc0w4Frc9/URclGx3fhfYuXjfOKH8eMZfZGw7xlkQ+qzj4Qv9eX1ganOP6a69P7/ LXOpd3zeVSyVYwC0Bvj5WkaIJtPmGnj4k8W+UQi5m1VRC85yd+GoEFxRe3C7JP3jFtx0VQ RjMSFqPLwqQh0M6if+Thrww27KwgxTk= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=NSqSN9x1; spf=pass (imf02.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.101 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=1736939950; a=rsa-sha256; cv=none; b=4td1IVEMa8KGzqQCvbkr126a91wFd5PH2kZg/Oo6gDebNPWSm+JRqVw6arHMRTg2Vl+YaA 5mmsZxFAJBSys7n7rpugiop/3I4ni+fiQvVG0JXeZ9SmmdZgkWU0bVlHFy85gHL3m6cT/D 5O5Luxohc7g3b/9ankO7pfzawe0e/Sk= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1736939945; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=kW7z1n+9TJv2HJgXLQL0LGMniJNL7aDn3Y73AUVJid8=; b=NSqSN9x1Oxu5X/Cj9J18rr69YiOc0Qxp9f0tgzrKyIiN/rTGzI5j5U6fScCNhqe4HotOt5Wm2kPHvt9P7UPy3daSIfhfHkFQloHFg1IQyGBGSaAXY4cUORxfjRv5wrFmZjWaZd7G1FIGt1ZW1SIHJWtFntVQ/PKjWLOX/jbzU0c= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0WNiNFph_1736939944 cluster:ay36) by smtp.aliyun-inc.com; Wed, 15 Jan 2025 19:19:04 +0800 From: "Huang, Ying" To: Andrew Morton Cc: Nikhil Dhama , Ying Huang , , , Bharata B Rao , Raghavendra , Mel Gorman Subject: Re: [FIX PATCH] mm: pcp: fix pcp->free_count reduction on page allocation, In-Reply-To: <20250107210506.3336da0da4332002847c89a3@linux-foundation.org> (Andrew Morton's message of "Tue, 7 Jan 2025 21:05:06 -0800") References: <20250107091724.35287-1-nikhil.dhama@amd.com> <20250107210506.3336da0da4332002847c89a3@linux-foundation.org> Date: Wed, 15 Jan 2025 19:19:02 +0800 Message-ID: <87sepk72ah.fsf_-_@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7212680009 X-Rspam-User: X-Stat-Signature: bd9kbnepnygeijs4qh3ooh5es7ix949k X-HE-Tag: 1736939949-9444 X-HE-Meta: U2FsdGVkX1/PkY1xibDm53DYSD51xAM5VkxKSKwUiTE/n3sqgLuIFAdY1NXZoa19EGNE/lNIJUEyy7of7XvEYuzAg2+Ke2FFguO+IH4rQtVeywzQNrvrJixdy+i7Bldfw6amskO972wJI5jxHIm6STPX0VyrKGvoX1Xu5637xL/8IAbHqQt8MhYWgAimL+UIaZ+ntzugMGsCPC633DHtgTZLGXk7MumKvv1qlI9OAdYiKBqYQd1NGUAml+BJdCLzVwaXQI1hrlKIyAoF1joJPIlQlP0sP40TZLnkofzQB2I7df7uzcvy/u5zi51EvEnrY93VoHCYj95uBSeCK4HWf1TfH4Mac6+7DoH9p21WCd7P6L6NFVsIyZEjBy49K8WcsF5DGoL1b68wdxyZojOv3xbaOPb4WxrIYBMrKkYxrmTmFA3bLqHga5I1Ymh5gC0zoi5xhKvzIAOx/tV5S2UaRg1D0xut0eJSIclyDYUiE5aoDFuCKGKH4+0ovLLG1Nk/jVlfnNDTZFzqjN6x9ECIa4ccYGJhjG4rGu8gKYn4A6RpMBcw7pUlSKSSuNMrIG3DhGYjO5idWPiNG6MWiSCTVLqCdYZL7MRdWncq7bINrzXiLDzRK3r+oiNKSKQ78yNXxY1o5x8CPx9hwAL0zZMjmCW4FRJt90sL3HMZ1orM/scdfs5JwKb5JOC0aeAd+CcQDNQGQgzd3J8F92dhY/uBXVAEysJL5m0lytjJFx/Ib/t+d21ezVVW4V0RUxc6UX5dID+IYsW1sryPLvSGxQ7NeN4jvxwZUYDw4c0rJqWTSmMuOXtm8VWyHMvyf4akqg8J6D/GgAWd+GVr28jIlIyJTdT8dTsV2LWMHvHL+7aCdIWKyvYYZhJBbKppHvdB0/UC2rlntpqG6IOYkwMDfdzloH3lA/sUOVpkRDFnbjLvY1+gxwNIBJRNdVA9cVZs/xdCT2Egi81q8NTv6ceHUo7 7jJwXcaM DK2OjqbBYY7RSGl15fmJVMqFHBVKc/5Ezewbd1+3wmiUyM8p5ReTmdbUlH0ybXamcZU4raqhbbJo8hscrvGmbV3sNO6liCrrZdoNvWEEruDbRCtEe8voKlduHbbrb3VcQ6iqEJv61MW0E4dlwI4leff9rOBoNJpn35VaHwynP6sXVW1tfiujaqdNtKkvCfEQVjNVJ59RsuKh5tcl5j7rdchZJDL7x9Fi1YeT+YMEbgohN359YiuJFH2PZ2TK77hEOGsI6Lt1/zT9cMYrdZzsdj0RSyMQIn0P2AmlSAVsrmIfN4iLBjiFMCB5LcnIp7mOht/NcAsu2rYnqKjpUCXW79iq/qGks9NhAsZPi5oUWC+z3F9f+2Gx6K3KZ4NI7mxjDIskW+0goch997Ai2AZDR7s+sarh6GUsThuFIZwmIxCW96Txy06QxruYTfol2K2lgph0M5fWK9iZu0LU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.003854, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Andrew Morton writes: > On Tue, 7 Jan 2025 14:47:24 +0530 Nikhil Dhama wrote: > >> In current PCP auto-tuning desgin, free_count was introduced to track >> the consecutive page freeing with a counter, This counter is incremented >> by the exact amount of pages that are freed, but reduced by half on >> allocation. This is causing a 2-node iperf3 client to server's network >> bandwidth to drop by 30% if we scale number of client-server pairs from 32 >> (where we achieved peak network bandwidth) to 64. >> >> To fix this issue, on allocation, reduce free_count by the exact number >> of pages that are allocated instead of halving it. > > The present division by two appears to be somewhat randomly chosen. > And as far as I can tell, this patch proposes replacing that with > another somewhat random adjustment. > > What's the actual design here? What are we attempting to do and why, > and why is the proposed design superior to the present one? Cc Mel for the original design. IIUC, pcp->free_count is used to identify the consecutive, pure, large number of page freeing pattern. For that pattern, larger batch will be used to free pages from PCP to buddy to improve the performance. Mixed free/allocation pattern should not make pcp->free_count large, even if the number of the pages freed is much larger than that of the pages allocated in the long run. So, pcp->free_count decreases rapidly for the page allocation. Hi, Mel, please correct me if my understanding isn't correct. >> On a 2-node AMD server, one running iperf3 clients and other iperf3 >> sever, This patch restores the performance drop. > > Nice, but might other workloads on other machines get slower? --- Best Regards, Huang, Ying