Received: by 10.223.185.116 with SMTP id b49csp8040018wrg; Thu, 1 Mar 2018 16:03:19 -0800 (PST) X-Google-Smtp-Source: AG47ELtxBG3AT9PmUl3z1YjMbeyA7tqRL5ikkov4m5zqvTlTwPPK9U0gZdfLaEommkzZxB2lxVZF X-Received: by 10.101.87.132 with SMTP id b4mr2927353pgr.282.1519948999466; Thu, 01 Mar 2018 16:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519948999; cv=none; d=google.com; s=arc-20160816; b=cpAwCak3trsIAt2DyyokfSNxioHOyI8g4x8l1wMQWqMSNhcchXlGVrnSYSjSjp7/0f 0rds0joIgHUFwo8A4SM+WopFtwkSBSaJadyfUZk8sozdBR696DCagsSntmR6EBMHW7ev 5sNOa3Ti6gAP6fejMVFXQpPqcwXuc5oJeRSrzGUaPk6lctVR1D1VjFTUD2WX0w+pu5zD UFOL+QiPwlD4n69LiyKyuLj34rTrpXP7p3wb/ohIIi+kfmylxnx/NzFuvmGJwX13nOL3 HYDVGonfgfCMaobu6liYf/j9I6sgVoY9glkYrWBlBWhye1pMt3Y2Z9qvZGKIYDgLhYSU xiCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=6rrgzpT5MlNNcXy8DrDbt5nYotRl2V12bZBy7ssH0xA=; b=Vpr4S3+84xmhY5a2ywAMIwGgl4aeztijLGIDZqOxw5R38svX4TCT//TONLAxO8X9kp 1Zzlqr7dnKp6VweY9if3ZXKWTK9zN0nYzKLClVZzLbLXmupxNeGlnf0xvDamvNRMXUdw AN0SXALcraqB68YLyY/k+7Rwm4W/RynI3NWOMxKAn0Tcz53/wdJd0gyWNM0pV11aZhPM cDvFBFen4OtZSQVlSG6kWzlkjyPpu80bLap3SeAEyzLz61cv8XDAM9WqYUbQ6xKoZQY6 acG0zayt9ZpSETbuGJO7swR9TjRJKvBw0FeAFnw8nZ8MGXbGm7UCEGT7IewEZ4M5o5ac 8HnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8-v6si1555216pli.418.2018.03.01.16.03.04; Thu, 01 Mar 2018 16:03:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163667AbeCBABI (ORCPT + 99 others); Thu, 1 Mar 2018 19:01:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42430 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163565AbeCBABH (ORCPT ); Thu, 1 Mar 2018 19:01:07 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.71]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4574E1022; Fri, 2 Mar 2018 00:01:06 +0000 (UTC) Date: Thu, 1 Mar 2018 16:01:05 -0800 From: Andrew Morton To: Aaron Lu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Dave Hansen , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Vlastimil Babka , Mel Gorman , Matthew Wilcox , David Rientjes Subject: Re: [PATCH v4 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free Message-Id: <20180301160105.aca958fac871998d582307d4@linux-foundation.org> In-Reply-To: <20180301062845.26038-3-aaron.lu@intel.com> References: <20180301062845.26038-1-aaron.lu@intel.com> <20180301062845.26038-3-aaron.lu@intel.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Mar 2018 14:28:44 +0800 Aaron Lu wrote: > When freeing a batch of pages from Per-CPU-Pages(PCP) back to buddy, > the zone->lock is held and then pages are chosen from PCP's migratetype > list. While there is actually no need to do this 'choose part' under > lock since it's PCP pages, the only CPU that can touch them is us and > irq is also disabled. > > Moving this part outside could reduce lock held time and improve > performance. Test with will-it-scale/page_fault1 full load: > > kernel Broadwell(2S) Skylake(2S) Broadwell(4S) Skylake(4S) > v4.16-rc2+ 9034215 7971818 13667135 15677465 > this patch 9536374 +5.6% 8314710 +4.3% 14070408 +3.0% 16675866 +6.4% > > What the test does is: starts $nr_cpu processes and each will repeatedly > do the following for 5 minutes: > 1 mmap 128M anonymouse space; > 2 write access to that space; > 3 munmap. > The score is the aggregated iteration. But it's a loss for uniprocessor systems: it adds more code and adds an additional pass across a list.