From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753203AbcFJQje (ORCPT ); Fri, 10 Jun 2016 12:39:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:60825 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbcFJQjd (ORCPT ); Fri, 10 Jun 2016 12:39:33 -0400 Subject: Re: [PATCH 02/27] mm, vmscan: Move lru_lock to the node To: Mel Gorman , Andrew Morton , Linux-MM References: <1465495483-11855-1-git-send-email-mgorman@techsingularity.net> <1465495483-11855-3-git-send-email-mgorman@techsingularity.net> Cc: Rik van Riel , Johannes Weiner , LKML , Peter Zijlstra From: Vlastimil Babka Message-ID: <575AED3E.3090705@suse.cz> Date: Fri, 10 Jun 2016 18:39:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1465495483-11855-3-git-send-email-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/2016 08:04 PM, Mel Gorman wrote: > Node-based reclaim requires node-based LRUs and locking. This is a > preparation patch that just moves the lru_lock to the node so later patches > are easier to review. It is a mechanical change but note this patch makes > contention worse because the LRU lock is hotter and direct reclaim and kswapd > can contend on the same lock even when reclaiming from different zones. > > Signed-off-by: Mel Gorman > Acked-by: Johannes Weiner Acked-by: Vlastimil Babka One thing... > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 9d71af25acf9..1e0ad06c33bd 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5944,10 +5944,10 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) > zone->min_slab_pages = (freesize * sysctl_min_slab_ratio) / 100; > #endif > zone->name = zone_names[j]; > + zone->zone_pgdat = pgdat; > spin_lock_init(&zone->lock); > - spin_lock_init(&zone->lru_lock); > + spin_lock_init(zone_lru_lock(zone)); This means the same lock will be inited MAX_NR_ZONES times. Peterz told me it's valid but weird. Probably better to do it just once, in case lockdep/lock debugging gains some checks for that? > zone_seqlock_init(zone); > - zone->zone_pgdat = pgdat; > zone_pcp_init(zone); > > /* For bootup, initialized properly in watermark setup */