From patchwork Tue Jul 22 22:41:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Rientjes X-Patchwork-Id: 4610201 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E79B2C0514 for ; Wed, 23 Jul 2014 11:56:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F9A0201BC for ; Wed, 23 Jul 2014 11:56:12 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mail.kernel.org (Postfix) with ESMTP id 23F1C2017D for ; Wed, 23 Jul 2014 11:56:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6NBqGMB014229; Wed, 23 Jul 2014 07:52:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s6MMfJbd024483 for ; Tue, 22 Jul 2014 18:41:19 -0400 Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6MMfJsc022366 for ; Tue, 22 Jul 2014 18:41:19 -0400 Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6MMfHax015111 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 22 Jul 2014 18:41:17 -0400 Received: by mail-ie0-f180.google.com with SMTP id at20so294792iec.39 for ; Tue, 22 Jul 2014 15:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version:content-type; bh=zFE44TTZIWoKRVa/m8y2L5KNFHd+dypkDJZbodUhHBQ=; b=KUD0x17lkOU0peOCiMRdVVYUhTU9w5xzI1fRjlxt4JhmaKvC751v0gjud5qoMCrZ35 wtBhQEZpkVBYveghlm+wB7h7PcY5EXgaOUBJoOeZgigBqGtZmM0tfB6jaQWIg0f9bK6/ NyELTtG+LlfSiuOkXR8ip8zLrXY/lNLuSy/egpObmHZ+BF6Hz7FJ9ptIrrJLUBvPw58N 8pPj3lliP//RxQ9okm9TbwpczIUGz/eCzA+U1V7ClIp0t9OKjR9Q3y+4OJh1RVW3zTKp m+UFhZ8xE0AZjwXf6Ri361vT2gJb7AXq5A4kTZ5hEArrRnBuzlPl9JCnU9691Bj1ZkMM SXrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=zFE44TTZIWoKRVa/m8y2L5KNFHd+dypkDJZbodUhHBQ=; b=mEuYsMzRTMqS40MB6S/cL+hAWFAUmuHTOAAA3FVmyTOAYlzbP/kHcAmb+qZPVhgKVQ igFFsGiz6q2n5mFKWKfhSRU9KOjsx7w2QqftHKTSAcnmQdqaXJoGYvqGL5iGEFczM3sn +PUF44D9N/t7HLGR5HuuxDNAGWkdvyYK0qE90+H30pvQL6BGBHPG7M4G8ctkH2KzR4R8 kPKXGuS+LVvmWk5sb3zCF+hmiICG+tmsTFre+06w8cYu7a0jqUJDf99Mwp9PEtI/CDaq yTcuR2NT38xJkkPtgUu5isdE/pvDRIO73xNAcRJQDEAl9RgTotEWGDIXbiB11W6cDQuT xJiA== X-Gm-Message-State: ALoCoQkpzf244ujMX+IdU+1fpmBvlQinaqIwnVL/cZBjixpBAIK3lYWyd5e26srrYcSCpOXYcae5 X-Received: by 10.50.1.37 with SMTP id 5mr20919503igj.47.1406068877079; Tue, 22 Jul 2014 15:41:17 -0700 (PDT) Received: from [2620:0:1008:1101:4192:f069:de2a:dc] ([2620:0:1008:1101:4192:f069:de2a:dc]) by mx.google.com with ESMTPSA id t2sm53164944igs.3.2014.07.22.15.41.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 15:41:16 -0700 (PDT) Date: Tue, 22 Jul 2014 15:41:14 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton , Mike Snitzer In-Reply-To: <20140722221421.GA11318@redhat.com> Message-ID: References: <20140325170324.GC580@redhat.com> <20140523201632.GA16013@redhat.com> <537FBD6F.1070009@iki.fi> <20140722221421.GA11318@redhat.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-RedHat-Spam-Score: -3.102 (BAYES_00, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Wed, 23 Jul 2014 07:52:16 -0400 Cc: linux-kernel@vger.kernel.org, Pekka Enberg , linux-mm@kvack.org, dm-devel@redhat.com, Mikulas Patocka , Zdenek Kabelac , Christoph Lameter , Pekka Enberg , "Alasdair G. Kergon" Subject: [dm-devel] [patch] slab_common: fix the check for duplicate slab names X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mikulas Patocka The patch 3e374919b314f20e2a04f641ebc1093d758f66a4 is supposed to fix the problem where kmem_cache_create incorrectly reports duplicate cache name and fails. The problem is described in the header of that patch. However, the patch doesn't really fix the problem because of these reasons: * the logic to test for debugging is reversed. It was intended to perform the check only if slub debugging is enabled (which implies that caches with the same parameters are not merged). Therefore, there should be #if !defined(CONFIG_SLUB) || defined(CONFIG_SLUB_DEBUG_ON) The current code has the condition reversed and performs the test if debugging is disabled. * slub debugging may be enabled or disabled based on kernel command line, CONFIG_SLUB_DEBUG_ON is just the default settings. Therefore the test based on definition of CONFIG_SLUB_DEBUG_ON is unreliable. This patch fixes the problem by removing the test "!defined(CONFIG_SLUB_DEBUG_ON)". Therefore, duplicate names are never checked if the SLUB allocator is used. Note to stable kernel maintainers: when backporint this patch, please backport also the patch 3e374919b314f20e2a04f641ebc1093d758f66a4. Cc: stable@vger.kernel.org # 3.6+ Acked-by: Christoph Lameter Signed-off-by: Mikulas Patocka Signed-off-by: Pekka Enberg Signed-off-by: David Rientjes --- Andrew, this is in Pekka's tree but has not managed to be pushed for 3.16, mind picking it up? I'll check to see if there's anything else in Pekka's tree that you need. mm/slab_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/mm/slab_common.c b/mm/slab_common.c --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -55,7 +55,7 @@ static int kmem_cache_sanity_check(const char *name, size_t size) continue; } -#if !defined(CONFIG_SLUB) || !defined(CONFIG_SLUB_DEBUG_ON) +#if !defined(CONFIG_SLUB) if (!strcmp(s->name, name)) { pr_err("%s (%s): Cache name already exists.\n", __func__, name);