Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4566832ybe; Mon, 16 Sep 2019 14:35:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6BxsdW9Qpvtq+R6ZoElwxd7ytkFnJ+YKAUKRZ9K1v9OvvvDd0mzwJb21hRxZEkz8tJGSG X-Received: by 2002:a50:95a3:: with SMTP id w32mr1398367eda.211.1568669717863; Mon, 16 Sep 2019 14:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568669717; cv=none; d=google.com; s=arc-20160816; b=so1Y8IpQROOp6n/IVsCKEQFVWvbnjAjjB2N04bd/Lkru/nE4LeEBaZxds/GksJBMnk 7YJwtlqLot6KmCRUGjCW8pTnxHcExoVQ/fYPNrJlm8wM49xu+xiYDLcVaoO+k9ob0vuZ dfpMDqvJcPJPFeVPUft6XcNu8K35OyyEH7mDss3DlkmmnR4JpSZIe2dvVfzoHQYTuEbY YHJBe4Nr4HioaB9uetj4YTE1uoNDb2GQSX4xszKlahSi7yoK+x5x3maUSCFO9yupTP5Z TQkMfEBbWnNeVqjOWS3mRCFiu3VtVyNe5ZD45ajaam1IS6iykKssr79hwheK4RsexniZ iKRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=L0ays1/mc3BSCy5WrlxyGgS8s5WDbP/IbHIQf1UAyeo=; b=fSo4WRPfAl+jUU8cdAznLTc4z+PGJrBqHrdDr9I0hjttHZ/TvnGnHGj7zWMgclB5nf fWU505nKrCgypFWgBAkLUBpYYj05/FpN7mZG+JFVxeqwCmvS6HdEN7K6XOsu/i7yKueO LBjbtDNFJ2c2PTEIf76/Te7P6x9L1srW+phh+lIbOCYeF7T1ZpSKnOp8d13ZGGjZUC4m TJb5kFN1xaa1SQVsQxqMVN3h8Y7BJDL4rrlUAyLX5vXtX/09WzSRXmT427/3bDseUovQ fkRAe2yxhres+dc/hczcFSgRjNvguaLNO5BaENQMFrIcSUJ3IrceltHH6lGoyzABV6K0 FhSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=kresAcpH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8si189927edz.299.2019.09.16.14.34.53; Mon, 16 Sep 2019 14:35:17 -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=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=kresAcpH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389540AbfIPQEH (ORCPT + 99 others); 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.