From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A6AF511713 for ; Wed, 29 Jan 2025 04:31:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738125079; cv=none; b=sHkp5qIrmqfK3G0Bt9+vly4CRPM/FJjfS+uDp2DGMOpVnMVJnltxvMp2AUp8O9pklK5yZ82IBGh71bHuAqTe82X5TD213brpFE2YFSu6MVsJtIqg3cAYXjdaF4pwo8X4a70vAXTlODbOCza3vLiNkXPy/2md+zQTgC6u/YRETUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738125079; c=relaxed/simple; bh=D/MRpy1g5UDNeeXeB7vsqO4M2sYlPlx0m7x9jq5EUEs=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=NSSB1oxwEDZ+Nlqcwl5k1qy8BOzuZar5/ekLRbmoMLUX3CXYpPxCFkAT00iSya1yAlCkR6ohGH9yu1vGxX5Pjhd3fWof0rSGodx98xwYyLo2cMS8kvy16mhIg7dbIK4PF0nBbkyPzkaYvA8HTMgJ6/+8a+dz4FLl4/hLgX5sc8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=jlrhFHmf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="jlrhFHmf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3067C4CED3; Wed, 29 Jan 2025 04:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1738125079; bh=D/MRpy1g5UDNeeXeB7vsqO4M2sYlPlx0m7x9jq5EUEs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jlrhFHmfexgXfwaxVf/8lFeDhsspzmWTFKE3db16t5QtwPm8jJiaayyKNlq7vDqPa 7eLpRuiQGHXmeR3dJfIJts7Yp3It0nQbARsyzeKC3NRFZ3eovNTtS9NEc0Mz4vxN5h cJELRqgbSkrIh4bdRR9jyvf2xif+TQbN3A+Mc4cc= Date: Tue, 28 Jan 2025 20:31:18 -0800 From: Andrew Morton To: "Huang, Ying" 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, Message-Id: <20250128203118.578a46182beea6a82dcd0b1d@linux-foundation.org> In-Reply-To: <87sepk72ah.fsf_-_@DESKTOP-5N7EMDA> References: <20250107091724.35287-1-nikhil.dhama@amd.com> <20250107210506.3336da0da4332002847c89a3@linux-foundation.org> <87sepk72ah.fsf_-_@DESKTOP-5N7EMDA> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 15 Jan 2025 19:19:02 +0800 "Huang, Ying" wrote: > 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. > hm, no Mel. Nikhil, please do continue to work on this - it seems that there will be a significant benefit to retuning this.