From patchwork Mon Jan 27 05:58:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonsoo Kim X-Patchwork-Id: 314310 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 9BEB32C0350 for ; Mon, 27 Jan 2014 16:58:54 +1100 (EST) Received: from LGEMRELSE6Q.lge.com (LGEMRELSE6Q.lge.com [156.147.1.121]) by ozlabs.org (Postfix) with ESMTP id 9D9B22C0089 for ; Mon, 27 Jan 2014 16:58:20 +1100 (EST) X-AuditID: 9c930179-b7c84ae000000e38-c6-52e5f56d5432 Received: from lge.com ( [10.177.220.200]) by LGEMRELSE6Q.lge.com (Symantec Brightmail Gateway) with SMTP id B4.38.03640.D65F5E25; Mon, 27 Jan 2014 14:58:05 +0900 (KST) Date: Mon, 27 Jan 2014 14:58:05 +0900 From: Joonsoo Kim To: Nishanth Aravamudan Subject: Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory Message-ID: <20140127055805.GA2471@lge.com> References: <52e1d960.2715420a.3569.1013SMTPIN_ADDED_BROKEN@mx.google.com> <52e1da8f.86f7440a.120f.25f3SMTPIN_ADDED_BROKEN@mx.google.com> <20140124232902.GB30361@linux.vnet.ibm.com> <20140125001643.GA25344@linux.vnet.ibm.com> <20140125011041.GB25344@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140125011041.GB25344@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: AAAAAA== Cc: Han Pingtian , mpm@selenic.com, penberg@kernel.org, linux-mm@kvack.org, paulus@samba.org, Anton Blanchard , David Rientjes , Christoph Lameter , linuxppc-dev@lists.ozlabs.org, Wanpeng Li X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Jan 24, 2014 at 05:10:42PM -0800, Nishanth Aravamudan wrote: > On 24.01.2014 [16:25:58 -0800], David Rientjes wrote: > > On Fri, 24 Jan 2014, Nishanth Aravamudan wrote: > > > > > Thank you for clarifying and providing a test patch. I ran with this on > > > the system showing the original problem, configured to have 15GB of > > > memory. > > > > > > With your patch after boot: > > > > > > MemTotal: 15604736 kB > > > MemFree: 8768192 kB > > > Slab: 3882560 kB > > > SReclaimable: 105408 kB > > > SUnreclaim: 3777152 kB > > > > > > With Anton's patch after boot: > > > > > > MemTotal: 15604736 kB > > > MemFree: 11195008 kB > > > Slab: 1427968 kB > > > SReclaimable: 109184 kB > > > SUnreclaim: 1318784 kB > > > > > > > > > I know that's fairly unscientific, but the numbers are reproducible. > > > Hello, I think that there is one mistake on David's patch although I'm not sure that it is the reason for this result. With David's patch, get_partial() in new_slab_objects() doesn't work properly, because we only change node id in !node_match() case. If we meet just !freelist case, we pass node id directly to new_slab_objects(), so we always try to allocate new slab page regardless existence of partial pages. We should solve it. Could you try this one? Thanks. Tested-by: Nishanth Aravamudan Acked-by: Nishanth Aravamudan --- a/mm/slub.c +++ b/mm/slub.c @@ -1698,8 +1698,10 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node, struct kmem_cache_cpu *c) { void *object; - int searchnode = (node == NUMA_NO_NODE) ? numa_node_id() : node; + int searchnode = (node == NUMA_NO_NODE) ? numa_mem_id() : node; + if (node != NUMA_NO_NODE && !node_present_pages(node)) + searchnode = numa_mem_id(); object = get_partial_node(s, get_node(s, searchnode), c, flags); if (object || node != NUMA_NO_NODE) return object; @@ -2278,10 +2280,14 @@ redo: if (unlikely(!node_match(page, node))) { stat(s, ALLOC_NODE_MISMATCH); - deactivate_slab(s, page, c->freelist); - c->page = NULL; - c->freelist = NULL; - goto new_slab; + if (unlikely(!node_present_pages(node))) + node = numa_mem_id(); + if (!node_match(page, node)) { + deactivate_slab(s, page, c->freelist); + c->page = NULL; + c->freelist = NULL; + goto new_slab; + } } /*