Received: by 10.223.176.5 with SMTP id f5csp932008wra; Tue, 6 Feb 2018 09:40:55 -0800 (PST) X-Google-Smtp-Source: AH8x225y0S611ICNmasP6zhozCrz3dp8jMPoX6nMqrKqj128db5C7VPjB9AajJ8Oo8NgaQ7koXHt X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr3117641pli.145.1517938855597; Tue, 06 Feb 2018 09:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517938855; cv=none; d=google.com; s=arc-20160816; b=TzPKsG0Mh9s9hCccIPy4CDGtqAANQh1vYag2bBTw6gxxoKzAZGp5GO0zgUuCOZF0s5 mKvULkroMYbtrR5XHbLo3mGeWpFBTsZuEkIBDi0i7spLa/UfMT8apGW+aJKkehj7/Gw3 leL4mfUZGPXqJQfzx4frLWfzNRELXaR8fRmjoL8ru8rzA+3FS43DomUqsxBjthSfnsUE d42lMrHEyWy4Vm8koaH9aw11lYTNHTL5ZenlCVHbzNE2nH0YmAf7gNlSWGs1iXkCJitR vWZm370hquUcrpiEfWJn+fB0orcwWMZERnAHYuUoyT7bd4RH6GrL4wulhplJFLxBSy1I x7DA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=AmR3VtL0+ZANu+Pw51249/CdE5l5BEaGTfg47/O80M8=; b=0KHABugIUYMoEJ9Cgpbmq/KcIP8J/VFnsFjG0+i4fH13YP1Q0Tk/dL8LlvprkP3Gfg OWZTzONoKgxsrWyu6enEP9D2tCs6ShrdyWilu1pQhniyVBNdHofn8gzOGNCNNXRHOlYJ oc3i5kQX1XLtdA19SiJN22Bgizt/pItNptvGcXETdp6Wdo+kfkkVq37ZbiLrwLqZs38E bEulIxGyuhiNABG246+kf4kg5HeYZWpNr2oofpQiS2nuPvG0VMThmQfVhmXAs9ZreZNu 6jvKBJh0XM9pUY4QIT7u5OR3oYJ3V4jkmfRSaXlE8nDFc8j9y/xPqJX0MaUM9+RPB98S 8dPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=iQ0TRLfr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16si1466768pgn.732.2018.02.06.09.40.41; Tue, 06 Feb 2018 09:40:55 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=iQ0TRLfr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540AbeBFRjD (ORCPT + 99 others); Tue, 6 Feb 2018 12:39:03 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:60096 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752236AbeBFRi5 (ORCPT ); Tue, 6 Feb 2018 12:38:57 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w16HbLfG083534; Tue, 6 Feb 2018 17:38:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=AmR3VtL0+ZANu+Pw51249/CdE5l5BEaGTfg47/O80M8=; b=iQ0TRLfrGrcRvsbFpcY1W7v7yMn0FapHYzcajnMtfehzWQX4H7c6SlcLtA0bZ844cxRM N6hp+sS85aUXU46CDBsWqZgXW4Z7NXzNJ2oxuUCvSPw7sWlnHFJ17b+m7KFOxkJZ9MVP fMg0vZW7234TKpIv5O2P0xJk5Nkeb2S1vyDECB2PqLz99JH4DcoUFyZKdvWeloWwDZiY b2P1N/f9GH4mSFxU+v2BVu6yO0Iflw8PnMsxZh9fpdskacVlBk5rSm6nBNz2OZJVEXmc 38HAsisRL9foHxgcInmcVT8GQHWEdmmbjbQVYS5OSEat0JwLqdbq9P0/rQ7F5hHeOl6J EA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2fyg0fge4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2018 17:38:10 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w16Hc9rQ032374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Feb 2018 17:38:09 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w16Hc94O005784; Tue, 6 Feb 2018 17:38:09 GMT Received: from [10.159.143.50] (/10.159.143.50) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Feb 2018 09:38:09 -0800 Subject: Re: [RFC PATCH v1 13/13] mm: splice local lists onto the front of the LRU To: Aaron Lu , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: ak@linux.intel.com, akpm@linux-foundation.org, Dave.Dice@oracle.com, dave@stgolabs.net, khandual@linux.vnet.ibm.com, ldufour@linux.vnet.ibm.com, mgorman@suse.de, mhocko@kernel.org, pasha.tatashin@oracle.com, steven.sistare@oracle.com, yossi.lev@oracle.com, Dave Hansen , Tim Chen References: <20180131230413.27653-1-daniel.m.jordan@oracle.com> <20180131230413.27653-14-daniel.m.jordan@oracle.com> <20180202052120.GA16272@intel.com> From: Daniel Jordan Organization: Oracle Corporation Message-ID: <7b9c0aab-354d-c88b-3598-7bf91dd1ef74@oracle.com> Date: Tue, 6 Feb 2018 12:38:31 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180202052120.GA16272@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8796 signatures=668662 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802060223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2018 12:21 AM, Aaron Lu wrote: > On Wed, Jan 31, 2018 at 06:04:13PM -0500, daniel.m.jordan@oracle.com wrote: >> Now that release_pages is scaling better with concurrent removals from >> the LRU, the performance results (included below) showed increased >> contention on lru_lock in the add-to-LRU path. >> >> To alleviate some of this contention, do more work outside the LRU lock. >> Prepare a local list of pages to be spliced onto the front of the LRU, >> including setting PageLRU in each page, before taking lru_lock. Since >> other threads use this page flag in certain checks outside lru_lock, >> ensure each page's LRU links have been properly initialized before >> setting the flag, and use memory barriers accordingly. >> >> Performance Results >> >> This is a will-it-scale run of page_fault1 using 4 different kernels. >> >> kernel kern # >> >> 4.15-rc2 1 >> large-zone-batch 2 >> lru-lock-base 3 >> lru-lock-splice 4 >> >> Each kernel builds on the last. The first is a baseline, the second >> makes zone->lock more scalable by increasing an order-0 per-cpu >> pagelist's 'batch' and 'high' values to 310 and 1860 respectively > > Since the purpose of the patchset is to optimize lru_lock, you may > consider adjusting pcp->high to be >= 32768(page_fault1's test size is > 128M = 32768 pages). That should eliminate zone->lock contention > entirely. Interesting, hadn't thought about taking zone->lock completely out of the equation. Will try this next time I test this series. While we're on this topic, it does seem from the performance of kernel #2, and the numbers Aaron posted in a previous thread[*], that the default 'batch' and 'high' values should be bigger on large systems. The code to control these two values last changed in 2005[**], so we hit the largest values with just a 512M zone: zone 4k_pages batch high high/4k_pages 64M 16,384 3 18 0.10986% 128M 32,768 7 42 0.12817% 256M 65,536 15 90 0.13733% 512M 131,072 31 186 0.14191% 1G 262,144 31 186 0.07095% 2G 524,288 31 186 0.03548% 4G 1,048,576 31 186 0.01774% 8G 2,097,152 31 186 0.00887% 16G 4,194,304 31 186 0.00443% 32G 8,388,608 31 186 0.00222% 64G 16,777,216 31 186 0.00111% 128G 33,554,432 31 186 0.00055% 256G 67,108,864 31 186 0.00028% 512G 134,217,728 31 186 0.00014% 1024G 268,435,456 31 186 0.00007% [*] https://marc.info/?l=linux-netdev&m=150572010919327 [**] ba56e91c9401 ("[PATCH] mm: page_alloc: increase size of per-cpu-pages") > >> (courtesy of Aaron Lu's patch), the third scales lru_lock without >> splicing pages (the previous patch in this series), and the fourth adds >> page splicing (this patch). >> >> N tasks mmap, fault, and munmap anonymous pages in a loop until the test >> time has elapsed.