Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5975251ybe; Tue, 10 Sep 2019 11:35:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOYR29888jOaKP8gse9B7fzmM/XviJ/bVCDsZyiq58SbvJEzzbsdLYGkw0LAT/DWIQS6u+ X-Received: by 2002:a17:906:3545:: with SMTP id s5mr25446020eja.73.1568140527316; Tue, 10 Sep 2019 11:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568140527; cv=none; d=google.com; s=arc-20160816; b=fHEtD7ESEz5Gqo4MPecqCSYn38RULq9Egyd6ItA3TGXwWMszRNDjbkGZVWbG9ZfULc r3nHvLbjax0eWdERuu2qIpmESXJK/e399p++PQO/ZeCjnODN2Nq7xNN1ZsuQpprbwCnR rcJbnFYcl3K1INTXqcEv1j0br5DptwuJu1798B1M2IDoWjGcbdymvCeQVdk7Gxfyh0mO CtUfi0wbXES9s6pmA/TvU2+mXMq5e+Bv2qsBeFBtzszrqpufQ/4NK6bmPGod6Je2DTFk y+LHZNyT3/6VnrBRsIxD1y2Dl/e084iOU5ouRq0PZ6PFpF6W70VBqjnsc3JiT1vm92Lq xskg== 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=ya4un5YA0owQideI/MnR/HmIg6HIggVszRA4CHgSJSk=; b=FHV/OcRNviU9HgAcmjGD4QXt+P07MrLqaRT13XQj8yn0bc4Kb76lV6Rg4sq4yr2WZ4 OIGeX+GZSrWo74fcdlVeMJpFkG8JEk3Fm1PnY1t+BN7yQMA2SGeg9dTLkFUqovles1Ki 6mjNWNZqX9/ugzbXZdukNfXu5qjAbp7gIZeuJk82a8e+xRxsRJVyIRz+VPdVsdQ3hOmm GRMzWW8OIfDWbvBRe33VkryAXwWlu2g4HEYKvF/RM7JBxa2n+D+XobJ0ELTKFXydSJcf b/rdXoGxYphZtnE+WfI2K+beDojz2LKddn3x8UG9ezXOt3h0rdGmPnSze5pQ7PVii6Ea UllA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bfQesemg; 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 m17si10410897ejn.237.2019.09.10.11.35.03; Tue, 10 Sep 2019 11:35:27 -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=bfQesemg; 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 S2391363AbfIIRHw (ORCPT + 99 others); Mon, 9 Sep 2019 13:07:52 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:47041 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbfIIRHv (ORCPT ); Mon, 9 Sep 2019 13:07:51 -0400 Received: by mail-pg1-f193.google.com with SMTP id m3so8137799pgv.13 for ; Mon, 09 Sep 2019 10:07:51 -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=ya4un5YA0owQideI/MnR/HmIg6HIggVszRA4CHgSJSk=; b=bfQesemgwud5nizYMr1grKMmyrd48AgVHvSmTFX3YLhGq0ftejWHsv0MINm76i5tkP ahjuoLde76YMxLrU1imGriyhbxPRckv3CgiLiKghA4Ow3ZSAKJ/SFNXK1A/Tn6JSxxd8 EL2G4o4aTG8clSIR2eJcmlyL0oTxrRNm+IkBFr4HgVPUEbNRhRqD7ThhU/2cywFytlKz R0FYTZ2ee5UrKVBHhtCWuB8RZlfZK4B6Jzq1RMpiy+nVfVTJ1Z62J9AEpxgzcfcQrA76 ZQGZvEqkfT64cI12flI8eZotZPdJaIuLl9y0HGAf/Xdkg+u82EyIkDTKT2eeHjrcOdtv UH4A== 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=ya4un5YA0owQideI/MnR/HmIg6HIggVszRA4CHgSJSk=; b=D/y2NWS1LzlfZywDXwSRCjeL3S5YqyKo7OkI74WVqP2PNCgmt98l+xDHw2GMOmZo9X peC33ICjpkk6s5Hu3jNetAXsvOPfKGYQgAbAtVtPVb6Bu7TS0vz0eduLOLTDF7UV0DnV aKIHkxpXrnqPuVk3/BmYtNAIkoZYWXkvT0dL5RsBPJTwFKGUD7mopwL4D/5wNnW9pJUo XKFWvaKyhF+GTdxoGgP+qGzx3lCARAOqL3RiN3ZPU8aZD0LAyWMck/FtYceTfYcLhZtX 2FjQ+PCYy6+MpmLzeJG9V9ttNxi6FODVkN+MHwxUM173XWnAKmq5pY/aY/P+25r9Wb7i 1b6g== X-Gm-Message-State: APjAAAW6bY5xicToaP7euk66pEssQ/e1U9QlY/ilddo2+v7ub7ErRRtg F7G1JX6Ea7N3f8peiNXT18g= X-Received: by 2002:a62:1cd2:: with SMTP id c201mr29332690pfc.51.1568048870991; Mon, 09 Sep 2019 10:07:50 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:160:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id b18sm107015pju.16.2019.09.09.10.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2019 10:07:50 -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, Pengfei Li Subject: [PATCH v2 0/4] mm, slab: Make kmalloc_info[] contain all types of names Date: Tue, 10 Sep 2019 01:07:11 +0800 Message-Id: <20190909170715.32545-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 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: 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 | 103 +++++++++++++++++++++++-------------------- 4 files changed, 60 insertions(+), 72 deletions(-) -- 2.21.0