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 X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F61CC4708C for ; Fri, 28 May 2021 11:19:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E0830610A5 for ; Fri, 28 May 2021 11:19:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0830610A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CDA626B006C; Fri, 28 May 2021 07:19:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C5E256B006E; Fri, 28 May 2021 07:19:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F6F36B0070; Fri, 28 May 2021 07:19:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 38A976B006C for ; Fri, 28 May 2021 07:19:48 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C21575847 for ; Fri, 28 May 2021 11:19:47 +0000 (UTC) X-FDA: 78190394814.17.904885F Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf29.hostedemail.com (Postfix) with ESMTP id EC38B350 for ; Fri, 28 May 2021 11:19:35 +0000 (UTC) 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 X-Rspamd-Queue-Id: EC38B350 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=N9qH3OC3; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=G+ST+qC4; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam04 X-Stat-Signature: fotk4txyhewzpx978zq6rzgxbnbwoc78 X-HE-Tag: 1622200775-797362 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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