Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2183200ybe; Tue, 3 Sep 2019 09:06:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqypuB9PPkyVjdSShgB/EWaAIBqarcrVglexzt9F3Nw6PwAaqAxZ4LU6INuYFDAo/fSZ4wkW X-Received: by 2002:a65:568d:: with SMTP id v13mr142398pgs.229.1567526813531; Tue, 03 Sep 2019 09:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567526813; cv=none; d=google.com; s=arc-20160816; b=VRcHnCqIsi1dixbhexM3+4/O/Tzry7bQCE+sWnHiubpQRkUQeH+nvftZ1/FOp+oYrc dj7E7L4x8oH0sX3G+Mcv4pzKwnoXeC05L0d0qM7TVSlZHCFS6I/o8SH7TA73nUfQsy4p lsoekiUIkh3P2JeV7rDP79Tmi1PwDjv6h/FlBFSZ7VVGRapaxmPHmgBJ6Pbe62UlkXEx tiyHUyZkjGjqoSOYj4KvlUgw/Deji726UiJNuKPD555fmmr7DM40vDhmRPT4o/M+55Mb LCZo5y/S6rNgPxDB0J30UOTW8W5LZ+WFbJ7V1NI8NDCnpjxCfXc08R+FiD92QDdbX/om ygyg== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tvXTRb5lTb+8B5XFSXnCmcD2ylzHPHyUlLmT6O6bjB8=; b=LbSEYYsCx8LogEUqQi3k5fFXlpN9tsnNZXz6RjOVK4ZpzPp0s7GI8qYWcuovaGNPgx qt2UVR9j22xmOKux7Wni5g4UR3XrNKYIoVNf56iWxClacm2bpvggsaKT94MUtW0ZEAtH okRVCQnoIHejhaioSGz/oNE8yV8voNNcNDQWf5LtHJvnVlLqXOr751QuipF8pyL/drG+ LqjcNDcqMG4nzT6SGQRm9m5kFbdg6Zp9uRl/rV62wzPl9F9NyRISzFesN15MZ82t7b48 vTezP1ojkX1KNDRRtDyPlHRQH70Wt1V79A5GstZvhWQsIwi/rzR+mA05KHchl6To5QJD dGBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=naBgiF0A; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q145si18127837pfc.31.2019.09.03.09.06.37; Tue, 03 Sep 2019 09:06:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=naBgiF0A; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729873AbfICQF1 (ORCPT + 99 others); Tue, 3 Sep 2019 12:05:27 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43324 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728854AbfICQF1 (ORCPT ); Tue, 3 Sep 2019 12:05:27 -0400 Received: by mail-pl1-f193.google.com with SMTP id 4so8075997pld.10 for ; Tue, 03 Sep 2019 09:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tvXTRb5lTb+8B5XFSXnCmcD2ylzHPHyUlLmT6O6bjB8=; b=naBgiF0A8QgRy89rtmqoTZomowJ9uK/5AjCwiOZkdqSavGAgTEtHUEvi3BuU+ZsR1r Hk+/hBPe1mkmKr60NVAHnRmirg+F+2g+Kzua5FSmcqPhYpv/3jdJVV574ad54ITN73Rc cTYQMsE1N2FSJTVX5MTKW99AZnjgQlaS+vTsRl5fu1l4kykTT6PaT8J+1a6TJMHCDLIA JMj0TNF2mZ8XLf5nO/ABWSytNCpSpqefNx9kmcA5L2oAFj5jpP9ieWNMqzJxIxcCHUzE efpooqpVNE6l5QYc5zJMJQfBNTkEIMiuEPVCz9952cFkjaKFBkEJQTdUdPiSugr3iMA/ +jjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tvXTRb5lTb+8B5XFSXnCmcD2ylzHPHyUlLmT6O6bjB8=; b=XZuNuXUeInLwm9Df1dFCAJym0DQ6IA2OjVGKIeOPBPFXxM/+YrpoOUCnQ8oH35dOg2 9tC6SgwjjDSWHMtoPY83sYWSh9rMRsYGxO+JmnRIaWxlUQFas7kvJy7Z/GYMhKxeJPEX t3wv0zDWe/jtJwI3X94bBZc4fTTi/K9w4cChwsoHlI1KIykXqpU4vhyoX+MTuWt6pG92 659XrgZxWPCHFZiDW+6BgA4cIxTMV6K+cf9YQsDH4c8TPXyOyTam9kUvWci4rk352G5n UMPphVOeCKEM6g5/sAehDnHa1yLOF/MtkZh9tOLcT8f0pdEEiYnAbdyDidmC5VfVwvrG T33g== X-Gm-Message-State: APjAAAX4Bwyyz46qq1R+LWM0k9/avC3xm4Njf1EZbrGUIRPnBArhtM0z JO7iDHvCrd54H1YICYh9MQk= X-Received: by 2002:a17:902:7792:: with SMTP id o18mr19221994pll.73.1567526726698; Tue, 03 Sep 2019 09:05:26 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:160:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id t11sm18501567pgb.33.2019.09.03.09.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 09:05:26 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pengfei Li Subject: [PATCH 0/5] mm, slab: Make kmalloc_info[] contain all types of names Date: Wed, 4 Sep 2019 00:04:25 +0800 Message-Id: <20190903160430.1368-1-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are three types of kmalloc, KMALLOC_NORMAL, KMALLOC_RECLAIM and KMALLOC_DMA. The name of KMALLOC_NORMAL is contained in kmalloc_info[].name, but the names of KMALLOC_RECLAIM and KMALLOC_DMA are dynamically generated by kmalloc_cache_name(). Patch1 predefines the names of all types of kmalloc to save the time spent dynamically generating names. The other 4 patches did some cleanup work. These changes make sense, and the time spent by new_kmalloc_cache() has been reduced by approximately 36.3%. Time spent by new_kmalloc_cache() 5.3-rc7 66264 5.3-rc7+patch 42188 Pengfei Li (5): mm, slab: Make kmalloc_info[] contain all types of names mm, slab_common: Remove unused kmalloc_cache_name() mm, slab: Remove unused kmalloc_size() mm, slab_common: Make 'type' is enum kmalloc_cache_type mm, slab_common: Make initializing KMALLOC_DMA start from 1 include/linux/slab.h | 20 --------- mm/slab.c | 7 +-- mm/slab.h | 2 +- mm/slab_common.c | 101 +++++++++++++++++++++++-------------------- 4 files changed, 59 insertions(+), 71 deletions(-) -- 2.21.0