Received: by 10.213.65.68 with SMTP id h4csp476973imn; Fri, 23 Mar 2018 08:36:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELtpQiwZXkWu8m4wErK1vBVXV8oHlpD6pcYl5j5jfQE5wwUWCwK0aotCa+Fzc1Ud12WdWS/E X-Received: by 10.98.229.21 with SMTP id n21mr24352230pff.158.1521819371568; Fri, 23 Mar 2018 08:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521819371; cv=none; d=google.com; s=arc-20160816; b=B2PnXpCbESsBxuNIXK0ySIx7x921EmLC+rcyd+yJHPGLcHffSCqPsNLX7EM7rh0T2O OLbaX9qBKbFJsIVS5Qj2ipMZ9lt5t9zy2oC7pIdZ0fV7iNebUsdi7d4mPWG8I3/XUFlo o5x6YrY+HpIJAbNhP64KmLvm1QNOe/JgdTojeT+ST6PPsXgmqrQ87Eoz7mKLNA8QyK18 hyk7ITkoLdM4JSOaf2FSo1ti9k2BvJQ7T51uSJh7PrgZuJhHb1rS5vSokGNVh1mFAacL 1KlA64b8aPYLmQ6IzeO2er/VVl6+A4PhdxHDu3fEDIw0Dq4KFxlrSiE8aAyb+QWZwOXW ipYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:arc-authentication-results; bh=3v86Jw6E4CBkzHZ6FHPgV7CM5ze+MtX/aa5u05P8yPo=; b=I2NcRF4foHL1wNsij5Q7n2fgp2GLofK1EN98o9FOEk7y7Va/gE8LAqLnOGBhdGz6d3 mY9fG5QApVwD+owOlqUdTAcC2h4WS+F+ZOT/EQP2ukkbKmHkXpkbOo9S2HxA0dJ8aT4x CkEn6rX7yi1NPx2PjLMevPfyBBJ/EhGuajSz/DrGLZ68NR3sQatD5DA+pCp4KRB7zEOe ileZLs+3uQMyGLFZqCKqMuBF1wReoKn+eFFNzn73ie4ywDmPYXI71gJBHIdSTFsSGlvF Fsl+dEeczW9mG5bBoIIudS7LBPnnUPaJf8m1R8S6zvD+QhNU/dWak7nGk91hl5Lqs/wE K+HQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4-v6si8923148pls.685.2018.03.23.08.35.55; Fri, 23 Mar 2018 08:36:11 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbeCWPe7 (ORCPT + 99 others); Fri, 23 Mar 2018 11:34:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39356 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750789AbeCWPe6 (ORCPT ); Fri, 23 Mar 2018 11:34:58 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FB48BD87; Fri, 23 Mar 2018 15:34:58 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 059E2215CDA7; Fri, 23 Mar 2018 15:34:58 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w2NFYvsJ026243; Fri, 23 Mar 2018 11:34:57 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w2NFYvXL026239; Fri, 23 Mar 2018 11:34:57 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 23 Mar 2018 11:34:57 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] slab_common: remove test if cache name is accessible Message-ID: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 23 Mar 2018 15:34:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 23 Mar 2018 15:34:58 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the commit db265eca7700 ("mm/sl[aou]b: Move duping of slab name to slab_common.c"), the kernel always duplicates the slab cache name when creating a slab cache, so the test if the slab name is accessible is useless. Signed-off-by: Mikulas Patocka --- mm/slab_common.c | 19 ------------------- 1 file changed, 19 deletions(-) Index: linux-2.6/mm/slab_common.c =================================================================== --- linux-2.6.orig/mm/slab_common.c 2018-03-21 12:43:19.418416000 +0100 +++ linux-2.6/mm/slab_common.c 2018-03-21 12:51:32.619999000 +0100 @@ -83,31 +83,12 @@ EXPORT_SYMBOL(kmem_cache_size); #ifdef CONFIG_DEBUG_VM static int kmem_cache_sanity_check(const char *name, size_t size) { - struct kmem_cache *s = NULL; - if (!name || in_interrupt() || size < sizeof(void *) || size > KMALLOC_MAX_SIZE) { pr_err("kmem_cache_create(%s) integrity check failed\n", name); return -EINVAL; } - list_for_each_entry(s, &slab_caches, list) { - char tmp; - int res; - - /* - * This happens when the module gets unloaded and doesn't - * destroy its slab cache and no-one else reuses the vmalloc - * area of the module. Print a warning. - */ - res = probe_kernel_address(s->name, tmp); - if (res) { - pr_err("Slab cache with size %d has lost its name\n", - s->object_size); - continue; - } - } - WARN_ON(strchr(name, ' ')); /* It confuses parsers */ return 0; }