From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 220CC1E98F2 for ; Wed, 15 Jan 2025 11:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736939951; cv=none; b=BcKebulm7FEt6weyIDB905us6KnFNV/JKiiW5ZunIRMEQME2ptI4S0DG/tsFGPKGiFpv5jFEbD5BvxSmzo4mtvJHiBdBDXTV2LugkoxFj/IU+2W1xjXygqCOIsyJ5pvzZ4yO/2CMTB1J3jW9p46WvNW3Pkmu6mfWLBYtqTcaeuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736939951; c=relaxed/simple; bh=aitDfSPi4F8F3ENLR2CXraTDPkr3JcaGdPBapue8EeY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=LDq50ddMsm3XzZ5pcUoyFGLMurfwlBBIZxrsuT4LrVVSO1wE6hlMBslHdkSxJhYbVXXjCQiMyNBsM+P/LVgeJ/IjgvlIWCQb5u4lQsCcbD89uOP6BBiYDM9CngJIFE2MOUTq16cMPgixABwEbuQ9qePeO/yybgNeteOdqEibCjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=NSqSN9x1; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="NSqSN9x1" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ascii 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