Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5979252ybe; Tue, 10 Sep 2019 11:39:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRM2V21h4pFtESsVNCbGEwdYeX+04pXQ5qE3lycqeRoip3Q9uGEnDRC27tEVoDvSf+5Zv8 X-Received: by 2002:a50:c908:: with SMTP id o8mr32552974edh.187.1568140764807; Tue, 10 Sep 2019 11:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568140764; cv=none; d=google.com; s=arc-20160816; b=pQABmZqjsbW0+/8z1y/5fuKRfoNz1f8b3ce+ZMoN8kgUWJyfeRwiHfGBlsvYViuka8 Zk8GJOaxKIDz0gEqWO3yGIq6Me+uQ+VmVkENzEgCgky3sif1LmtKHlXQu8/tIEk2veTg wvwt4/6zrMZ6p8caa9+ivTsdiGQiGLiABf90q+htF0H4mr5uz9nfk6gHGwH/rGSPZRn3 WmiyUgk5ceX+nMi7ixbMwTj3H1kG4lHwdQo42w9Ket8NCGzR5t/bwblShvhanf0nwV5O E9+m0BGYH06JCRZLRkuKn9gGefQvp3bedu93FQ+D3UvTunNRNKG8R/OtJylRwZ+h9FPH JgXw== 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:dkim-signature; bh=8M5+TPDS2IjP0aWDzyGkaBopFbLj6s+vVoGtuuyUqNo=; b=WAFccJEmvSkBS7eo80wvV1nzs/ymq/uqQqKXgqQF6S1S+4rRnxbW4oeUkGYRDAz+Qd w7PUXyyVQADF7CXO72iBAPIzVqMNpEgvDoZeLnxWZIiK3Ej+HEXLC0XVGyfx+82Kc8mY VgSPDomAA4aO/+DtghQNcDGz45j5p0IIHxXizRA0qci3o1wjrArGjjb6Wpl7d3RWk/+Q 0qV6b6jyRKj3kT3DoFy9qmPeEHVeyipuVCopDSGK9DfHUbfND5tQ+gFrrvwkEQfN4ts3 qiktWwzs+bDUGqSPPbHlGZ9+YtD3v5aY9JVIf5XaSkzCrEb9O6GrHOypBqeXP1K9uDDP CZ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="T/zoUw8t"; 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 g5si9686168ejw.309.2019.09.10.11.39.00; Tue, 10 Sep 2019 11:39:24 -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=@rasmusvillemoes.dk header.s=google header.b="T/zoUw8t"; 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 S1731693AbfIISaK (ORCPT + 99 others); Mon, 9 Sep 2019 14:30:10 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39863 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbfIISaK (ORCPT ); Mon, 9 Sep 2019 14:30:10 -0400 Received: by mail-ed1-f66.google.com with SMTP id u6so13855290edq.6 for ; Mon, 09 Sep 2019 11:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8M5+TPDS2IjP0aWDzyGkaBopFbLj6s+vVoGtuuyUqNo=; b=T/zoUw8tKc5M592mbqf3dI8cKV6ZOgavo+bW0sf82wiwxeahnejH1Es2N3YHzwsLY5 dRjX3VlE7qiQHjwM1RVgwqjkbBRSjznlm2/6IBrVp1xlPxIYGTD1jq4bIQO2KVFBvuHb +ez3hiQngmBc6xO9JynEjvOo0o8cGsYmfrES4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8M5+TPDS2IjP0aWDzyGkaBopFbLj6s+vVoGtuuyUqNo=; b=SzJs5ML6YwTrKwdQeR6GUaC+aEROnIt4jUAHQiPdWaLE/N4nfDf8rwrMZ+X6+dDrQd LAsa5jx0I6AfMP8Ou9uuB68JzCUhzciW9q6zrAP0GPrq9jJbCCVC4tybVfoxV5BNxEvm eBn5xpFVVAOfi5mXddl4ENdTS926uh4J1cS7uaECQHKlObuSn8az1SCmt/7+UQZovPM0 bycaMxI17CC+m5+f7b4E6qimBvHL6aS2E8VbW7vpzcPpmYCeSNqKtPivs6a+vv+n2lei TAUb2+cwTMyM5vJnnOXXd9IszHlMrTYCLlGrv45PgxqWmS4K042rPFroSHSKjv3H7+mq ZK7Q== X-Gm-Message-State: APjAAAWNURku6BcvPVbYWGsg6f7hImDV4fruT2XRyOw8NSnp6ceuPxOU Jq8WsLgijyQg6SJOVpA3Pnu/UcK5e+mx/4yl X-Received: by 2002:a17:906:bcc9:: with SMTP id lw9mr20786884ejb.161.1568053807693; Mon, 09 Sep 2019 11:30:07 -0700 (PDT) Received: from [192.168.1.149] (ip-5-186-115-35.cgn.fibianet.dk. [5.186.115.35]) by smtp.gmail.com with ESMTPSA id g20sm520589ejs.15.2019.09.09.11.30.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 11:30:07 -0700 (PDT) Subject: Re: [PATCH 1/5] mm, slab: Make kmalloc_info[] contain all types of names To: Pengfei Li , 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 References: <20190903160430.1368-1-lpf.vector@gmail.com> <20190903160430.1368-2-lpf.vector@gmail.com> <4e9a237f-2370-0f55-34d2-1fbb9334bf88@suse.cz> From: Rasmus Villemoes Message-ID: <3a95d20d-ccf9-bd45-2db3-380cc3e0cd17@rasmusvillemoes.dk> Date: Mon, 9 Sep 2019 20:30:06 +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: Content-Type: text/plain; charset=utf-8 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 09/09/2019 18.53, Pengfei Li wrote: > On Mon, Sep 9, 2019 at 10:59 PM Vlastimil Babka wrote: >>> /* >>> * 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. No, __initconst is correct, and should be kept. The string literals which the .name pointers point to live in .rodata, and we're copying the values of these .name pointers. Nothing refers to something inside kmalloc_info[] after init. (It would be a whole different matter if struct kmalloc_info_struct consisted of { char name[NN]; unsigned int size; }). Rasmus