Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5340014ybe; Tue, 10 Sep 2019 02:05:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/0NvQt6Smny7zozQlJeoaPSgZbeYgUjJhMT6Ihp3Jxh228YP/+ZQoOE9FBHjVgyuNjD1w X-Received: by 2002:a50:fc94:: with SMTP id f20mr28306006edq.175.1568106339191; Tue, 10 Sep 2019 02:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568106339; cv=none; d=google.com; s=arc-20160816; b=SPpd8uZxJMqzpvXL+b7buGfNF2afKfBkJ+MKrR5MTgS+C5WJcubUCNhFN8FEySnWZf m14gypr0MCERVGEg3i652guwLdkiA1oW6fIsRqTRYpP5EbbfOKvWTRRU9U7yJLX+zXW5 fSZJkCbIVWLctTZ42wfIiiLOTLRSZdhN0e1nRvkRLO+jH0jX2gWuePtnQW5sDj96lAwN PgkYSmmakoNl96gXBis6V52T2dR3gaAFI24VEV/GG/Hji1hxj6UBUxcHDJ3V61GTdhpy Rw8Rjt3NoKo7Pl17f6pVKe5y3hweY8XHp0fBVkaoIlcAJP+erNE2RmkB6+bOpojt7r2l uOEQ== 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=ljPPuRHN7pv5RAsMzezY1X1Lrzb1YERDpsuR59TZXOI=; b=XvCcrMlOPQneGuLWkphvw1N5kHfCcCpophqVH2A4mkntDFfsmJEgAGX3cwJkvZ3FV/ fG5pJHt1kmf+MY2XBUddXkv83n7T39KlbEReHV6WNEmzUkv5HdjrtuGmky3wXdxYrsk8 VrcQbgkweS4nZdzQNqN+2YMoKro9sa0bbyaAY5cV+6R9PvtdYrIgI2VtlnxBDjRBvzxe eX7ktafomo6Grtu+YcU+r/CJCyJxkqazM4t/zG2+Fldh5YKpFahQgJjnXjcKzYEEMGzM d8qZn42AvnPV9N+y9pm+pgtA2jzZ7IOL2SqTMSkjVF3XEfAGfBlBtm8BWmBY5iAMp2oS cPMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cc4AP0xR; 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 b56si10705170edb.418.2019.09.10.02.05.15; Tue, 10 Sep 2019 02:05:39 -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=cc4AP0xR; 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 S2390039AbfIIQx6 (ORCPT + 99 others); Mon, 9 Sep 2019 12:53:58 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:43791 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727080AbfIIQx6 (ORCPT ); Mon, 9 Sep 2019 12:53:58 -0400 Received: by mail-oi1-f194.google.com with SMTP id t84so11066262oih.10 for ; Mon, 09 Sep 2019 09:53:57 -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=ljPPuRHN7pv5RAsMzezY1X1Lrzb1YERDpsuR59TZXOI=; b=cc4AP0xRn0rgSFQQoweXYVeDmdpYDPSRo+ablACaZl0ulft5o6ThBhM8seUjI0P/As 2FrOOiCIlbReGxyXmZp79zqy0714NmEYrwosquM4+F8/EVhQTv5G7t+8DHCw02YlvSGE lXv8RN6C8a9rDJ6KXPUD3o8PBc8qBShf0S/Zt4H06TQ9lIBXCuaIjnYRlgE556zpUafJ pJW1sBGoCv57FxGJeiL4qhoLSm0A6r9JOIHri2FMxlnPZfZX+K0V5FG4J7pGNZ4VcetG G3K8Dao7YimLUa59TVick6b/JNeGfMOsbkCaRTymi57XiU3kMmLtOBJb0mmhqL1UwMy+ 1jpA== 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=ljPPuRHN7pv5RAsMzezY1X1Lrzb1YERDpsuR59TZXOI=; b=bcaR+2BmBinTrxeGsOWjz9HW9S2tA67FLdMOAx5CFzIhCaW6Qfd2Ugbz/Fyc6lp60G AbWm46AhQiTVP53eZUxk44sqrRXvB8Izc+tOvaAviaJPqScmr1hJU2s7HVAIKs+wuoCE qxOkdzEspy/JPz6790T50UKL/FomBDMxi/T50KCb/ygu9AKnQABytczCi4mh6MBU++bz 8bWho8/3zT5v2D5wNnx39WudxJtxv5984npIWfH26hOGEdRIo3Y//PjU2XVYqptk28Z2 rbAPOqmRl9b2pTW8ZqHnNPNTUML61lyJUuWa7dTsmFsOGeB4crOlyXPOt1ZuRxuvjVIa NGmw== X-Gm-Message-State: APjAAAUurj/WF5mjo4HRkqdvB81ENhIqEtBgU5Zw3sw+IM7YPtA5PfZF BfBMIgZsXMKN3cMeBt8ka0+I4SDqmuAQgVzZdiw= X-Received: by 2002:aca:4e97:: with SMTP id c145mr92531oib.145.1568048037621; Mon, 09 Sep 2019 09:53:57 -0700 (PDT) MIME-Version: 1.0 References: <20190903160430.1368-1-lpf.vector@gmail.com> <20190903160430.1368-2-lpf.vector@gmail.com> <4e9a237f-2370-0f55-34d2-1fbb9334bf88@suse.cz> In-Reply-To: <4e9a237f-2370-0f55-34d2-1fbb9334bf88@suse.cz> From: Pengfei Li Date: Tue, 10 Sep 2019 00:53:46 +0800 Message-ID: Subject: Re: [PATCH 1/5] mm, slab: Make kmalloc_info[] contain all types of names To: Vlastimil Babka Cc: Andrew Morton , Christopher Lameter , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org 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 Mon, Sep 9, 2019 at 10:59 PM Vlastimil Babka wrote: > > On 9/3/19 6:04 PM, Pengfei Li wrote: > > 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(). > > > > This patch predefines the names of all types of kmalloc to save > > the time spent dynamically generating names. > > As I said, IMHO it's more useful that we don't need to allocate the > names dynamically anymore, and it's simpler overall. > Thank you very much for your review. > > Signed-off-by: Pengfei Li > > Acked-by: Vlastimil Babka > > > /* > > * kmalloc_info[] is to make slub_debug=,kmalloc-xx option work at boot time. > > * kmalloc_index() supports up to 2^26=64MB, so the final entry of the table is > > * kmalloc-67108864. > > */ > > const struct kmalloc_info_struct kmalloc_info[] __initconst = { > > BTW should it really be an __initconst, when references to the names > keep on living in kmem_cache structs? Isn't this for data that's > discarded after init? You are right, I will remove __initconst in v2.