Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp335454pxj; Fri, 28 May 2021 05:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyobNGzxpVC+aOEfi/UAte2MRQfO6FiR8ZtOOWHCgTTxvv2NLdp05RYz8zs90/uqJ+WW0mT X-Received: by 2002:a5d:9acd:: with SMTP id x13mr6805109ion.134.1622204210464; Fri, 28 May 2021 05:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622204210; cv=none; d=google.com; s=arc-20160816; b=Rx7X1k4J6vmRgY6U9RoT1XfvlaE50Mkkkh0KJsoW02EpTt1AYggHqfxkF644sYFgch okWlcytL+9hAjzVR7RQn1Ns0ktoQYN7Wrk0X4SgQPMg+sfCDXX3MyVBNfzavatbaL8KB mxADcsocmXTgOT2R9EOj6inokhiOZ1GGyc5EUwSARNQWKZ8o8ENLcynGZxISbd9Xd5Ib GI4r9gXZeOMw5HtUEEFL6dIslepa6mrBhfskAdz9hBG/i7IxKdQeND4XhxipwbDa1bfY wYqNTzFZm1QDrIlO5oH+7I1fHqnRLPKiiW2Ayb78OH9ihvX0wWZVKr7yZsRwM5TpsRJy ruuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=qLMJxJYpMmRjq971tcymb5HaqU6rvz49VUg3ot6Bqks=; b=ygV9+XwaXlKGZ7tMTJZDuGiA42GN2TiFcccihxjsTCrFqs/yaudo53mwFIc8y9Ml4b eYQMIykKPhgRZs+iOiAqXKGmC/tsXAYI3JO+FGJovdDv0psKHnvnhL7bHZJ0Lo3Pe2+c /HdXJuQFNFzQEtD/wo6ue69WVsHXXtKMH9TVHzUbdQj6dfkjgOwDElPLsq4DNzjvBzqX LHQ7LqeYmmr6nlfmysY6bgOpvEhJeLHx0H6Q0qN9psWitL+rApGxEGs9+Im67Hqpchxq 52gGrlD8Igr5f7EjNZ5sw5+/F81Mqz/RXZ2yYok68bZ09w0FR8PX66jtoZcKqXGC1wk+ wv8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=N9qH3OC3; dkim=neutral (no key) header.i=@suse.cz header.b=G+ST+qC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si5479337ioj.46.2021.05.28.05.16.35; Fri, 28 May 2021 05:16:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=N9qH3OC3; dkim=neutral (no key) header.i=@suse.cz header.b=G+ST+qC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230261AbhE1LVW (ORCPT + 99 others); Fri, 28 May 2021 07:21:22 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:40890 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbhE1LVV (ORCPT ); Fri, 28 May 2021 07:21:21 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 046451FD2F; Fri, 28 May 2021 11:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622200786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qLMJxJYpMmRjq971tcymb5HaqU6rvz49VUg3ot6Bqks=; b=N9qH3OC3FNKCfO/Nfg6bKxfB6g3bN/E3Ch0wUEvpvVA3oinwZ9fToEuroP11fYBH2GgpfW yQASqxGvy01ww+hiZCvXIqQZiO6uZ0hblxOkIRLZPCp1X7/+kerWyvI/MCRllPJbPXmhRm rPypG9TbF47r9jZoVPuyyDAedxct1H0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622200786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qLMJxJYpMmRjq971tcymb5HaqU6rvz49VUg3ot6Bqks=; b=G+ST+qC4G8Zt6f5Gabr30bKDIgzNz6WM0r3ty/wn+S5See96z+Zxo6s4NaUFpA4UrIWLUI IfqMEI8LhWOUkXDA== Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id E603311A98; Fri, 28 May 2021 11:19:45 +0000 (UTC) Subject: Re: [PATCH 4/6] mm/page_alloc: Scale the number of pages that are batch freed To: Mel Gorman , Andrew Morton Cc: Hillf Danton , Dave Hansen , Michal Hocko , LKML , Linux-MM References: <20210525080119.5455-1-mgorman@techsingularity.net> <20210525080119.5455-5-mgorman@techsingularity.net> From: Vlastimil Babka Message-ID: Date: Fri, 28 May 2021 13:19:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210525080119.5455-5-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/25/21 10:01 AM, Mel Gorman wrote: > When a task is freeing a large number of order-0 pages, it may acquire > the zone->lock multiple times freeing pages in batches. This may > unnecessarily contend on the zone lock when freeing 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 frees. > > As the machines I used were not large enough to test this are not large > enough to illustrate a problem, a debugging patch shows patterns like > the following (slightly editted for clarity) > > Baseline vanilla kernel > time-unmap-14426 [...] free_pcppages_bulk: free 63 count 378 high 378 > time-unmap-14426 [...] free_pcppages_bulk: free 63 count 378 high 378 > time-unmap-14426 [...] free_pcppages_bulk: free 63 count 378 high 378 > time-unmap-14426 [...] free_pcppages_bulk: free 63 count 378 high 378 > time-unmap-14426 [...] free_pcppages_bulk: free 63 count 378 high 378 > > With patches > time-unmap-7724 [...] free_pcppages_bulk: free 126 count 814 high 814 > time-unmap-7724 [...] free_pcppages_bulk: free 252 count 814 high 814 > time-unmap-7724 [...] free_pcppages_bulk: free 504 count 814 high 814 > time-unmap-7724 [...] free_pcppages_bulk: free 751 count 814 high 814 > time-unmap-7724 [...] free_pcppages_bulk: free 751 count 814 high 814 > > Signed-off-by: Mel Gorman > Acked-by: Dave Hansen Acked-by: Vlastimil Babka