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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB391CD6E64 for ; Wed, 11 Oct 2023 12:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346861AbjJKMyh (ORCPT ); Wed, 11 Oct 2023 08:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbjJKMyf (ORCPT ); Wed, 11 Oct 2023 08:54:35 -0400 Received: from outbound-smtp55.blacknight.com (outbound-smtp55.blacknight.com [46.22.136.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36DEF98 for ; Wed, 11 Oct 2023 05:54:34 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp55.blacknight.com (Postfix) with ESMTPS id B5458FB0DC for ; Wed, 11 Oct 2023 13:54:30 +0100 (IST) Received: (qmail 17085 invoked from network); 11 Oct 2023 12:54:29 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.197.19]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 11 Oct 2023 12:54:29 -0000 Date: Wed, 11 Oct 2023 13:54:27 +0100 From: Mel Gorman To: Huang Ying Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Arjan Van De Ven , Andrew Morton , Vlastimil Babka , David Hildenbrand , Johannes Weiner , Dave Hansen , Michal Hocko , Pavel Tatashin , Matthew Wilcox , Christoph Lameter Subject: Re: [PATCH 05/10] mm, page_alloc: scale the number of pages that are batch allocated Message-ID: <20231011125427.dtwr2jerqzehjjxo@techsingularity.net> References: <20230920061856.257597-1-ying.huang@intel.com> <20230920061856.257597-6-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230920061856.257597-6-ying.huang@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 20, 2023 at 02:18:51PM +0800, Huang Ying wrote: > When a task is allocating a large number of order-0 pages, it may > acquire the zone->lock multiple times allocating pages in batches. > This may unnecessarily contend on the zone lock when allocating very > large number of pages. This patch adapts the size of the batch based > on the recent pattern to scale the batch size for subsequent > allocations. > > On a 2-socket Intel server with 224 logical CPU, we tested kbuild on > one socket with `make -j 112`. With the patch, the cycles% of the > spinlock contention (mostly for zone lock) decreases from 40.5% to > 37.9% (with PCP size == 361). > > Signed-off-by: "Huang, Ying" > Suggested-by: Mel Gorman Acked-by: Mel Gorman -- Mel Gorman SUSE Labs