From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933311AbaH1EcU (ORCPT ); Thu, 28 Aug 2014 00:32:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5378 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932388AbaH1EcS (ORCPT ); Thu, 28 Aug 2014 00:32:18 -0400 Date: Thu, 28 Aug 2014 12:32:11 +0800 From: WANG Chao To: Christoph Lameter Cc: Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , "open list:SLAB ALLOCATOR" , open list Subject: Re: [PATCH] mm, slub: do not add duplicate sysfs Message-ID: <20140828043211.GD3971@dhcp-17-37.nay.redhat.com> References: <1409152488-21227-1-git-send-email-chaowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/27/14 at 10:32am, Christoph Lameter wrote: > Maybe something like this may be a proper fix: > > Subject: slub: Disable tracing of mergeable slabs > > Tracing of mergeable slabs is confusing since the objects > of multiple slab caches will be traced. Moreover this creates > a situation where a mergeable slab will become unmergeable. > > If tracing is desired then it may be best to switch merging > off for starters. > > Signed-off-by: Christoph Lameter > > Index: linux/mm/slub.c > =================================================================== > --- linux.orig/mm/slub.c 2014-08-08 11:52:30.039681592 -0500 > +++ linux/mm/slub.c 2014-08-27 10:30:16.508108726 -0500 > @@ -4604,6 +4604,14 @@ static ssize_t trace_show(struct kmem_ca > static ssize_t trace_store(struct kmem_cache *s, const char *buf, > size_t length) > { > + /* > + * Tracing a merged cache is going to give confusing results > + * as well as cause other issues like converting a mergeable > + * cache into an umergeable one. > + */ > + if (s->refcount > 1) > + return -EINVAL; > + > s->flags &= ~SLAB_TRACE; > if (buf[0] == '1') { > s->flags &= ~__CMPXCHG_DOUBLE; What about failslab_store()? SLAB_FAILSLAB is also a nomerge flag.