[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD7_sbHV=tXrZaBuQuifVznFMUf13hs7t_QcgFVmrCdMHT4Ytg@mail.gmail.com>
Date: Tue, 10 Sep 2019 08:52:40 +0800
From: Pengfei Li <lpf.vector@...il.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Vlastimil Babka <vbabka@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Christopher Lameter <cl@...ux.com>, penberg@...nel.org,
rientjes@...gle.com, iamjoonsoo.kim@....com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] mm, slab: Make kmalloc_info[] contain all types of names
On Tue, Sep 10, 2019 at 2:30 AM Rasmus Villemoes
<linux@...musvillemoes.dk> wrote:
>
> On 09/09/2019 18.53, Pengfei Li wrote:
> > On Mon, Sep 9, 2019 at 10:59 PM Vlastimil Babka <vbabka@...e.cz> 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; }).
>
Thank you for your comment. I will keep it in v3.
I did learn :)
> Rasmus
Powered by blists - more mailing lists