Received: by 10.223.176.5 with SMTP id f5csp22542wra; Thu, 1 Feb 2018 14:52:57 -0800 (PST) X-Google-Smtp-Source: AH8x224mX/BerYyNZT8RlFRo/sFZSPwQYDiuBx3MmkBy3svu2+lsOA2x1sjDTdMfCK11D33TVmT2 X-Received: by 2002:a17:902:758b:: with SMTP id j11-v6mr12554644pll.224.1517525577035; Thu, 01 Feb 2018 14:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517525576; cv=none; d=google.com; s=arc-20160816; b=Cq8H6FGPIol2kChEE3+T9xsAt/FWmnC6a5E9FGNmxOu77prxCn87xx3K0NOrnkCQnn dWYrC4oxXMf4MY2PefrBJjLKg7lEFyc5Ue0ZAp3O7E+YpRbP1sTRw5BJARSBrq43Dhbz RZAb8KgyiYxZBdwuDfLLSzQ5Ao4FmyWl82K5Km5awXqirORWlD461Qx8OYMX7Pg+H1tD Ikae2k66HeDsIzBYd6C/KMHnxYVJGK2qbhNYZX2jPFt0irPTdpgIrp593la4QDP3DR+T rBgmf04GgE2VxqUekRH4mvKEtN6OlnOZSwvUSvrA6EIGQg6nO18v1pKooZOJwhI2l+Ga z3/Q== 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:from:references:cc:to:subject:arc-authentication-results; bh=B3alVrEBPZcc+HrrG8YguqbYPZm3hkaVDQOTj7/n4TU=; b=kCwgCymGTTRXZsyPyuOK0ja2zOmVc5BeFGlfw7kikrK/gIvwRQnVDzofjsRQnfpSC1 6o0Aje4Dxsrdqwnv/iO4VIDbUC6f11h+AtvG/8BS3E69J/dhVNYAw91/IN2wQ3yzU+Ur XuZqJvIunKySlHiznWM3dMhOjEDIdlNjIWO13pYEknHU2SLUXZrYDiEmt7Y0jmzxLJ/v meQDRdrEFjQ2ZEGZLRXZkWBEAzz7eMXQqo4Hyf3jqJ96/leOwZc+enyehhc7PO3Y45Tv Y4i+l1sV6pxPQcA0iRjEZvmSmY2ow1fGK8LLk0yMqBO8JlPVytX8Uw2/ZjpyqnHNqlD9 mxRw== 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 b10si357480pge.738.2018.02.01.14.52.42; Thu, 01 Feb 2018 14:52:56 -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 S1752180AbeBAWu0 (ORCPT + 99 others); Thu, 1 Feb 2018 17:50:26 -0500 Received: from mga17.intel.com ([192.55.52.151]:32960 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752161AbeBAWuU (ORCPT ); Thu, 1 Feb 2018 17:50:20 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 14:50:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,444,1511856000"; d="scan'208";a="200675962" Received: from schen9-desk3.jf.intel.com (HELO [10.54.74.42]) ([10.54.74.42]) by fmsmga006.fm.intel.com with ESMTP; 01 Feb 2018 14:50:19 -0800 Subject: Re: [RFC PATCH v1 03/13] mm: add lock array to pgdat and batch fields to struct page To: daniel.m.jordan@oracle.com, 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 References: <20180131230413.27653-1-daniel.m.jordan@oracle.com> <20180131230413.27653-4-daniel.m.jordan@oracle.com> From: Tim Chen Message-ID: <64330116-13ef-af3c-a445-f0c1b5bc1728@linux.intel.com> Date: Thu, 1 Feb 2018 14:50:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20180131230413.27653-4-daniel.m.jordan@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/31/2018 03:04 PM, daniel.m.jordan@oracle.com wrote: > 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; The above declaration adds at least 5 bytes to struct page. It adds a lot of extra memory overhead when multiplied by the number of pages in the system. We can move sentinel bool to page flag, at least for 64 bit system. And 8 bit is probably enough for lru_batch id to give a max lru_batch number of 256 to break the locks into 256 smaller ones. The max used in the patchset is 32 and that is already giving pretty good spread of the locking. It will be better if we can find some unused space in struct page to squeeze it in. Tim