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 BA823C4CECD for ; Mon, 16 Sep 2019 16:04:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 807D421881 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" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 807D421881 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 187A06B0003; Mon, 16 Sep 2019 12:04:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 139916B0006; Mon, 16 Sep 2019 12:04:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04E8C6B0007; Mon, 16 Sep 2019 12:04:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id D80F66B0003 for ; Mon, 16 Sep 2019 12:04:07 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 7C1BC181AC9AE for ; Mon, 16 Sep 2019 16:04:07 +0000 (UTC) X-FDA: 75941255334.19.farm54_7b4b5cc8d1b54 X-HE-Tag: farm54_7b4b5cc8d1b54 X-Filterd-Recvd-Size: 2573 Received: from a9-32.smtp-out.amazonses.com (a9-32.smtp-out.amazonses.com [54.240.9.32]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Sep 2019 16:04:07 +0000 (UTC) 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.32 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES X-Bogosity: Ham, tests=bogofilter, spamicity=0.000025, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.