Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5313350ybe; Tue, 17 Sep 2019 06:14:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqySuBuj/AGnvntbE5dH7k5ahdB4Vdh+xbNijvXmUsRBjglwEDhaDUF9/BeGSDJrqwbcSM6N X-Received: by 2002:a05:6402:120e:: with SMTP id c14mr4569086edw.272.1568726071068; Tue, 17 Sep 2019 06:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568726071; cv=none; d=google.com; s=arc-20160816; b=ysG585xVoNlAm6zgWF3Vt7Qa8blHIXYzWJWAizLlZxlbwFFUV2a1wD+XxM2F4QSvtN rhYOqxlgfl4deGuYQTlSIt6k0vL8JrciNZTtWfiJbjfsMykOVBXacacsRJLZ16/t4XPk Ou45/I/ltmh0nVgkneMAXPPZd3qHhGUvkvuHlXD0h3ZQOnfuGp9EcBuuvEzdVVei+jp5 lw89N3PlFKkLGFLaAxNixWDvZuUyAw8zt9zafyKkA+TG48PoHGwi5OBi1Guo/dHpKcuO JY8DYI9TkS1cHFDrUhO6/YWP9vEAPqo4YxwQZKYLnyudaqyLFFH5yFNjJg/s42wleXKI XUuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CzecQDZ62zroHHw8m7sjMbru2dXenqLbLLNiiVj6NRc=; b=T15Ozy5XzhBFG2qwvs/dnLGFm01aMrcDHCMvGSSERNZ632Ait7XR4DLHJiAwzMzr0e FCI02nXlnabil/41oigrsXIzQ4i7ZzbGzoJ24mShPo4k/iGpdf7An1DAe+lcpyZJm5Bh N9piX3+KOFdNLGleGFvzMDb5hj03QmwMYYH0Xt+udfk/jSfq3glEK5XxtHhVxE8EkxCL 2EbzpaEJRcyF8DUvLnNqHDeeyV7apviO6JlpJdBJJ6kQyA5npVYpzlFm/lGgjhhHEw5p lSwEXre3GmTNnM/cT8LpgjaldFLN5peDa3J5S2RoGW6XFegCAqDFzl0ZWGXtKg9aJmFB mShw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kajB+luL; 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 g22si1348443eda.27.2019.09.17.06.14.06; Tue, 17 Sep 2019 06:14:31 -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=kajB+luL; 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 S1728095AbfIQNL5 (ORCPT + 99 others); Tue, 17 Sep 2019 09:11:57 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:46895 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbfIQNL5 (ORCPT ); Tue, 17 Sep 2019 09:11:57 -0400 Received: by mail-ot1-f67.google.com with SMTP id g19so2934056otg.13 for ; Tue, 17 Sep 2019 06:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CzecQDZ62zroHHw8m7sjMbru2dXenqLbLLNiiVj6NRc=; b=kajB+luLNeZ8dqEybrVdpqSOj6f2QJ0PK904wHnOUqAGqvkNyRcQ5AhL2JjWe0+FLx DJHAaig3vb2yKalhpIVOGgBpscbhtEy+eu2ppNf4MSrQsDOobWtJr72Tkr22cCZQHqfz REoRPq21IZ9hm51MWqVmNPbZ9LFqGpiUcAXtzPQQ0O17x7aBmBDMA5u1KqAJTTuYI7hj VXnyiAbY0WkZFo+TRpev/sfTHPfjzMJv4NGPiZkQ2P1KiMxcOiC9+QIExgYSnpNwMR9X Y0gAKhVGuWwij3onrYg7ZR30N5ThIKwTzhdU9rwnawvEZ4nJBRUhe7Q2gkuAtf/z+B5G uXDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CzecQDZ62zroHHw8m7sjMbru2dXenqLbLLNiiVj6NRc=; b=ByiGlHm0DFJSiXXNpkA3rh/JQzfy8y9qqpZAyUL20rVM5MjRUVxRIS32Ud/dVbX5f0 NX85Ais9iU83KjZV4+KGhSXUSHJxuFOoob4lYu6ZnsOt+kTQp5DzdZad9CWMd3vqbBIk zTcR/gQgOseltRJv0Odlsnl6AE3//9Eb2wbn/f1wrCupxZDsunTcmhI21Usc5cWCofWu prmJdNHf+QX7tud2KzOuRFhVl+KSyCMBsqqJc1+P2Oh1nzm/hGdPVa/bRajxvyFLBh52 TQJ9dklSApNOAGF3yzD8hW3pmkBJpnwpPHTg/517PJh9pqw/2VjzxyP2a5HXKM/4RIIR mReg== X-Gm-Message-State: APjAAAUeKlE2Kj1syYmv2eudRNBgIg1+BiZiPwrwke3WJzmQW6Ink9FW qem2O8IqArAaHQPCV0P0BzUOqP7Gl02aN4Lpu4A= X-Received: by 2002:a9d:73c4:: with SMTP id m4mr2706556otk.369.1568725916216; Tue, 17 Sep 2019 06:11:56 -0700 (PDT) MIME-Version: 1.0 References: <20190916144558.27282-1-lpf.vector@gmail.com> <0100016d3ad11d18-fb812791-af73-43aa-b430-ba1889f1a85c-000000@email.amazonses.com> In-Reply-To: <0100016d3ad11d18-fb812791-af73-43aa-b430-ba1889f1a85c-000000@email.amazonses.com> From: Pengfei Li Date: Tue, 17 Sep 2019 21:11:44 +0800 Message-ID: Subject: Re: [PATCH v5 0/7] mm, slab: Make kmalloc_info[] contain all types of names To: Christopher Lameter Cc: Andrew Morton , Vlastimil Babka , penberg@kernel.org, David Rientjes , iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 17, 2019 at 12:04 AM Christopher Lameter wrote: > > 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. > Yes. > > 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? > Yes, this is a very small benefit. > 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. Yes, With this in mind, I also used #ifdef for INIT_KMALLOC_INFO.