From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DA25C49ED7 for ; Mon, 16 Sep 2019 16:04:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56496214D9 for ; Mon, 16 Sep 2019 16:04:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b="kresAcpH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389547AbfIPQEH (ORCPT ); Mon, 16 Sep 2019 12:04:07 -0400 Received: from a9-112.smtp-out.amazonses.com ([54.240.9.112]:43830 "EHLO a9-112.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728529AbfIPQEH (ORCPT ); Mon, 16 Sep 2019 12:04:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1568649846; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=eu6e49kUrc9XyoN63pOs0ajqekp09fMTRuFXAaK6Yt8=; b=kresAcpHSLScoGKcT1KYc9rXUIcPjNTx1KbEBO4mOi9YyQnX99KK87ScIlmxSwee kQ8clZqhpOaxiSMWEruhau6a6G5zIhv36Ert4OmvjXNgRsJsy2Yn1nlqad4pWCx1VGS XKPOL4GAlX1FoFZAkOssJ6malo9RZglmf4WcZ55Q= Date: Mon, 16 Sep 2019 16:04:06 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Pengfei Li cc: akpm@linux-foundation.org, vbabka@suse.cz, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, guro@fb.com Subject: Re: [PATCH v5 0/7] mm, slab: Make kmalloc_info[] contain all types of names In-Reply-To: <20190916144558.27282-1-lpf.vector@gmail.com> Message-ID: <0100016d3ad11d18-fb812791-af73-43aa-b430-ba1889f1a85c-000000@email.amazonses.com> References: <20190916144558.27282-1-lpf.vector@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.09.16-54.240.9.112 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Sep 2019, Pengfei Li wrote: > 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. > > These changes make sense, and the time spent by new_kmalloc_cache() > has been reduced by approximately 36.3%. This is time spend during boot and does not affect later system performance. > Time spent by new_kmalloc_cache() > (CPU cycles) > 5.3-rc7 66264 > 5.3-rc7+patch_1-3 42188 Ok. 15k cycles during boot saved. So we save 5 microseconds during bootup? The current approach was created with the view on future setups allowing a dynamic configuration of kmalloc caches based on need. I.e. ZONE_DMA may not be needed once the floppy driver no longer makes use of it.