Received: by 10.223.176.5 with SMTP id f5csp2045590wra; Wed, 31 Jan 2018 15:53:13 -0800 (PST) X-Google-Smtp-Source: AH8x225YqWVy1ZRAD0kW67en6Ex0LMa/dRPfvWEjlSl7PkQ3m/wg77Qnqix+Oz7y4H5coNJ3PmNz X-Received: by 10.99.120.134 with SMTP id t128mr12011749pgc.313.1517442792930; Wed, 31 Jan 2018 15:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517442792; cv=none; d=google.com; s=arc-20160816; b=oFQBqVWbpJZCtBTNQXA1bXNAWDO/21sW4ZKe7V8m1bc2OtSL82/RIpC8w1ECNNq4kS zLx18VNILJo4NPXWxvr8KwDitoJ7rPW7TQ6kSTU7q2Ci0UrSKCLRU9HY0OwDWToMGL4g 01RfsDpiNdlD0CqsYckPtjqBSO7vCRL/ccA6x/N3xkvXTMOkB0mrDaD5KDF7fMKpcHbQ 8/Dc19shDFNWqdTgkXmhYf3tQ/n77WxOJ081HR5mv3/E533u2nsICopUNZ0j6e+74UzO zrUiL6hntmQLwOVH/E37EkVLOj6XsU8E3CLPcCpRE1GO/GKCeAoJl58SY7sdmcL27FXm aWaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wXFZiDcJ0yH/cMG1SyMR/EF6EVq2NiBD3AvESY8C1XM=; b=Rt9qp6DdfifdPx7LPQZzxtSM1ZKgSuW0NN+ViSbdKOrC2YaFcyM3EIQUIzjdz6wAk+ d4Qts+tn/nkGoprt95NX9Up6hXvsP/LcdTSpZxtutXo9kp7Lw167agyWaZBuR2nwErL0 gkcgwFdVT3RLKWDNp6eosl132e/+xKcMquTTzopJoyYewYXEnOViAbw6UHDrn62iSgIi zTbO3jxJ94Kqp8ymWC94jN6k5x+FOeclZ9ot1hAgg3i/fB12AGChzKvEjQZ8sQHNJWKh 9jeij4WD40Krnktbn25HPVq72XTMU3tuonAj4KrhKplcRpIuLQgolP0FwXT+3LRAEFpv xksg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=K0b4R9S8; 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 u7si4468765pfl.198.2018.01.31.15.52.58; Wed, 31 Jan 2018 15:53:12 -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=K0b4R9S8; 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 S932147AbeAaXOf (ORCPT + 99 others); Wed, 31 Jan 2018 18:14:35 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:51008 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754063AbeAaXEj (ORCPT ); Wed, 31 Jan 2018 18:04:39 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0VMpfP7120706; Wed, 31 Jan 2018 23:04:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=wXFZiDcJ0yH/cMG1SyMR/EF6EVq2NiBD3AvESY8C1XM=; b=K0b4R9S81KshwTG6WMiqyunGI7Ms/QD92eyiGoM4Wo73qS+nudP4ttZ17d4ONiQXm4d3 N/++VN0G+IkojfDPF/B/GahPK4EJLO03qFpEqORR1kyEPkoKDGwCM+W3pmzaZrASB2x4 3aSrrToLldyZlqZkXYadq4R+VGAbdvXbuxuwM6KenAVT1FFjTwSbJnd7BxZV5Ge7+Gfx zRRDl/7meZa5+RttaZxV1CmDwcpiuy7EjgRb858lqLFzrN5lqWIvyDZwvs1yNdHNiLDF n3Fli1Zz4S8qiU0zwOv3eZ12xx+dd+kTMz4okNqJfjN3uu6TnWDxiqt35c4karw/65OL mA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2fucd9ke1s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jan 2018 23:04:27 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0VN4Pg3011659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jan 2018 23:04:26 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0VN4PJH022291; Wed, 31 Jan 2018 23:04:25 GMT Received: from parnassus.us.oracle.com (/10.39.213.30) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Jan 2018 15:04:24 -0800 From: daniel.m.jordan@oracle.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: aaron.lu@intel.com, 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 Subject: [RFC PATCH v1 03/13] mm: add lock array to pgdat and batch fields to struct page Date: Wed, 31 Jan 2018 18:04:03 -0500 Message-Id: <20180131230413.27653-4-daniel.m.jordan@oracle.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180131230413.27653-1-daniel.m.jordan@oracle.com> References: <20180131230413.27653-1-daniel.m.jordan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8791 signatures=668659 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=904 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801310283 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch simply adds the array of locks and struct page fields. Ignore for now where the struct page fields are: we need to find a place to put them that doesn't enlarge the struct. Signed-off-by: Daniel Jordan --- include/linux/mm_types.h | 5 +++++ include/linux/mmzone.h | 7 +++++++ mm/page_alloc.c | 3 +++ 3 files changed, 15 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index cfd0ac4e5e0e..6e9d26f0cecf 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -190,6 +190,11 @@ struct page { struct kmem_cache *slab_cache; /* SL[AU]B: Pointer to slab */ }; + struct { + unsigned lru_batch; + bool lru_sentinel; + }; + #ifdef CONFIG_MEMCG struct mem_cgroup *mem_cgroup; #endif diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index c05529473b80..5ffb36b3f665 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -249,6 +249,11 @@ struct lruvec { #define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) #define LRU_ALL ((1 << NR_LRU_LISTS) - 1) +#define NUM_LRU_BATCH_LOCKS 32 +struct lru_batch_lock { + spinlock_t lock; +} ____cacheline_aligned_in_smp; + /* Isolate unmapped file */ #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2) /* Isolate for asynchronous migration */ @@ -715,6 +720,8 @@ typedef struct pglist_data { unsigned long flags; + struct lru_batch_lock lru_batch_locks[NUM_LRU_BATCH_LOCKS]; + ZONE_PADDING(_pad2_) /* Per-node vmstats */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d7078ed68b01..3248b48e11ca 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6070,6 +6070,7 @@ static unsigned long __paginginit calc_memmap_size(unsigned long spanned_pages, */ static void __paginginit free_area_init_core(struct pglist_data *pgdat) { + size_t i; enum zone_type j; int nid = pgdat->node_id; @@ -6092,6 +6093,8 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) pgdat_page_ext_init(pgdat); spin_lock_init(&pgdat->lru_lock); lruvec_init(node_lruvec(pgdat)); + for (i = 0; i < NUM_LRU_BATCH_LOCKS; ++i) + spin_lock_init(&pgdat->lru_batch_locks[i].lock); pgdat->per_cpu_nodestats = &boot_nodestats; -- 2.16.1