Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5987315ybe; Tue, 10 Sep 2019 11:47:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlL6yPE4wHzDgQuZUfpnKx/LRbD7KrMYd0VgblF4aWkKZgb8tGjVAkWkPnoL9R9HQsLx0K X-Received: by 2002:a50:9250:: with SMTP id j16mr32431743eda.160.1568141235278; Tue, 10 Sep 2019 11:47:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141235; cv=none; d=google.com; s=arc-20160816; b=b2nTqZ//dOgVG49jSZVXEs5Ia+0zx/zVwPgmbrDL3k1HVKyVSzVkvSDTtRgylSXL27 cH1qh7/uoZntG+hCAAPbto1eSCDTM1elzq/aoWBPJuRcxaj98iDGoh7q5nTc59R1Qzh9 /NuZFcrjZ+TAyfbDu8GnBIgAK8NuvxVfd1+oKb/fKSAw1o2ar2hltSTlfOrlPWHR30E0 iM5fM5gaRzAj2S2hL2h9/c2xu5Fo6C+SYl4wz3/bk/dtKDqgm1z6CNtN9+REfeDRUue0 k1lmKjFIsqKwEJmAbla7CRXHzEyCl/S3zniOcwHqAAPXYfXZPy8T7b+RKRhdmA/QyoV6 S61g== 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=htVKbWpEm9QB8qGdRGMXDAO+pxBcl0ZnD2WqCc7LzfU=; b=x/RKe0Co1WbTNRh9Zi9ThJ+mwADsPm4prmYaScrjZGUtOZrsrunyaW6faujgiS8Zzv 3lsIae1WRqoNKZGmSJV1nMy6PR9SZj83lcn6METDM1MJPm34vLqvYDWl4BrqbACArJ43 m/RJr1rqOUyuj0JN0GO2Yc9g/sg11vOGPQLoyqVcb1mQH/ac8sLqjFaphemo2ZKEKHmC LssVndbEd85I8qzLiBBht50EgpGcR7rI/1ZKf3PNwb+bQOhwZHxRAK/lu6kRVaICcENk lqhHjp/4VOCFgquRJ4rLjU79je8AD0xemTG5sCvkKjX8O3e9GQq92KcLFktuJRb0gPsV 4kCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dYDodNZN; 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 a5si11475752edd.448.2019.09.10.11.46.51; Tue, 10 Sep 2019 11:47:15 -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=dYDodNZN; 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 S2391057AbfIJB1Q (ORCPT + 99 others); Mon, 9 Sep 2019 21:27:16 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36659 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbfIJB1Q (ORCPT ); Mon, 9 Sep 2019 21:27:16 -0400 Received: by mail-pg1-f194.google.com with SMTP id l21so8897453pgm.3 for ; Mon, 09 Sep 2019 18:27:15 -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=htVKbWpEm9QB8qGdRGMXDAO+pxBcl0ZnD2WqCc7LzfU=; b=dYDodNZNZBL5k3zCSxOWdPRcFUyUB01dhilO31VRCQCWzNTMmGKwgRqx0ezOfDNyAW Xam9LqMjWHWhmXYZ+UyPClwkIDonR2TO65P68AgHwdI+LfXGtXhOV+odbW27EuJiV4SP XTvrH2cyaxDU5S7EOTZIh8ZgmIO9Vta9yYvLfVVzJ6tPL8MOhtJkVxJZPSFFuj67j8ht keJg435MhybFE/gLA3crGRYdZ2lA8uk+6OFVaRys6lrMlTQ3wlHysXZ6BZlWF0dXyJBy 7keLQZaUsd4mzy4NYzg79RUQWhi3PbxSlYR1MYRG7hv9PUI8MXdUUzjCGpUVkyRvCYwr iBag== 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=htVKbWpEm9QB8qGdRGMXDAO+pxBcl0ZnD2WqCc7LzfU=; b=BbG73QIhhUL9H4GYqjTaWuanSRfKy01jYwREZX36S+TdFkX8pp5R306ZZ/wYvy1xGW J5NV5cbUXuvVZvc0QWlVTp7CkNmCnHdrByXwfzz4EslN1dvRrIPKvUExscxTWieApqUl bcMnYGDHk+i1Kk+IoXuMYH2USMUSwaF3d5GdOU50NErVnYyDhLNtC/iFRD/rYJCWJgeH tOTKtt6xkJScRNEyn5PVtBA6Goh4HEDY1z+OfdzRz6oeoBvM7ZCsBiW8aRMI1ehBGeat jEQ0PhlH1mJQ8UGIyj8k6YI+6gM9czqayLoh6bGCGbKuGMFxEPRn3n8DxbYethIMzOjM 0HRg== X-Gm-Message-State: APjAAAVQIXw0S4QyO9Mc8l19rOe3GoazLa/7ec4Ri7JLdShjiSZdBuMv oLqNMZW89slqFB7QVTOay7c= X-Received: by 2002:a62:f246:: with SMTP id y6mr31513531pfl.22.1568078835198; Mon, 09 Sep 2019 18:27:15 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:160:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id b20sm19558629pff.158.2019.09.09.18.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2019 18:27:14 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org Cc: vbabka@suse.cz, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, guro@fb.com, Pengfei Li Subject: [PATCH v3 0/4] mm, slab: Make kmalloc_info[] contain all types of names Date: Tue, 10 Sep 2019 09:26:48 +0800 Message-Id: <20190910012652.3723-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 Changes in v3 -- 1. restore __initconst (patch 1/4) 2. rename patch 3/4 3. add more clarification for patch 4/4 Changes in v2 -- 1. remove __initconst (patch 1/5) 2. squash patch 2/5 3. add ack tag from Vlastimil Babka 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 (4): mm, slab: Make kmalloc_info[] contain all types of names mm, slab: Remove unused kmalloc_size() mm, slab_common: use enum kmalloc_cache_type to iterate over kmalloc caches mm, slab_common: Make the loop for 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