Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5967053ybe; Tue, 10 Sep 2019 11:28:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyphqlJlC6OEkW/zDiKqvbm8+hHESMgg1Vjpmv5VLQ1WVPsOptqaGLOTtsjEEIE/UlOxo+ X-Received: by 2002:aa7:c0da:: with SMTP id j26mr32452136edp.40.1568140091210; Tue, 10 Sep 2019 11:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568140091; cv=none; d=google.com; s=arc-20160816; b=PphBNUuyaUN68nRhDyZTDxCxpxbQtY4dwR0UsFXCnzT47JA3pOLhSwh3YT6/+xPCu7 o2WhsWCvK7A/zSrFTGxFQSpw8HU2G4jmEdp9KhvUDr1aBARrJLbrAP+JPdnoZqPmzoKd +qqWCSujoVYyYRgCYd/tWZWo4i3ycYD/iSoWRIcsg7MynbJy1vN0uBasesC3aXJQ1kGC VLgZTL16UnYAIEQX6ae1uGzQ1G8+wrTRzcGzDGECkPa221a4W4pZj3d4OZQEhaDO6mbz H3ajVyUF5N15xCFShQhvTDQtzs29tsn+Lvs6UxMypuGCzi5+7K4N3Opmj5JusNn5tH6l Uu/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=m2aKAWbFm+lgg+cOej5S5kUL0PUn03tOxzNB285Ucf4=; b=TyPC5HQNlWZXH+C4HgCp+TH4etMuUFqLdDUlFXWlnBg6L60zJicT/d4bauU9G99m+t LyrW2cmNcuXYQaZ+B0o6iCF1xQMP4OW1r/KgJn58+Tob0m3iKHRw/Ly0lvKObagzuQst oxZTg4Vw7dInc9tQP7WvFw3EAUJSIRqbY1akarifcPM3N13Qq7lcDmB4oiKaXr6LcieV kv3Qa+fX+4LvfdHBFqdrqSEmqKHi8FGqYPrQKFzbCBKH6QS0JZ/ZFIOuYinDOSxMcPnT fwVleqK1wh5vZmnMqfhHaJlZh9BKufofUaX2zeFa5BfcvTYLxLlVnXLHrMhmrbYRgzSg v2tw== ARC-Authentication-Results: i=1; mx.google.com; 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 x22si10353985edi.382.2019.09.10.11.27.47; Tue, 10 Sep 2019 11:28:11 -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; 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 S1732770AbfIIO7F (ORCPT + 99 others); Mon, 9 Sep 2019 10:59:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:56328 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726164AbfIIO7F (ORCPT ); Mon, 9 Sep 2019 10:59:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 67546B65C; Mon, 9 Sep 2019 14:59:03 +0000 (UTC) Subject: Re: [PATCH 1/5] mm, slab: Make kmalloc_info[] contain all types of names To: Pengfei Li , akpm@linux-foundation.org Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20190903160430.1368-1-lpf.vector@gmail.com> <20190903160430.1368-2-lpf.vector@gmail.com> From: Vlastimil Babka Message-ID: <4e9a237f-2370-0f55-34d2-1fbb9334bf88@suse.cz> Date: Mon, 9 Sep 2019 16:59:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190903160430.1368-2-lpf.vector@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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?