Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5987088ybe; Tue, 10 Sep 2019 11:47:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDPOHZBwZSS8pC4Dt9H9bO/l3lISOTP7VhkABuQxktS8ucZXEdd67rLvgrAAHVAT7nENZU X-Received: by 2002:aa7:d2c1:: with SMTP id k1mr32395339edr.245.1568141222066; Tue, 10 Sep 2019 11:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141222; cv=none; d=google.com; s=arc-20160816; b=mH7ZADxqCeDA8LmUFGvaTM7YQe0CeW6aU+6GiXLktjYsN62yuGpy3yQdkCwX6D64pI 3Hv880ioepfI5w9XkoLGEluMmuj0XPZ10LE24MuRfvY24oTqeazEguYKER5yviJesWcE 61x7nAcnwFSZIITKJyy7Rtsa9Vtc1KNvJRRgPAq48of9g5LRIqG4jjw3r0jGaCE2OPPJ C7CuIyHjikw8vk85iGXs6rPS3Sx5Kc4XBZATjEwXifTJ2CwVrSRNXkYzI2BGPoTCyk2T OZV95R6Hy4roaM+ic5EJloGF1DmFp2ncX4itSP/8CVGh+yGke/a0oGNDGwMcj0WMVICG REAA== 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=nGIIao9PdFSLqjKhUlXcUfbYL/hFNuXa3CP5/F54v8M=; b=lxZ+boeoR4arhDPG4MObI0xriyRkrW3rMAIJWc74xbLcGUrUOu9N+F+8NYK6W1nCud S2ALopiVG3LuxixzvOaP/O1baG2kBKcGy166nhLWICOLMxfAUdNsQTdKC/C6ecJ5h2E5 GCjkJHzrrtVOFWI/LLhgpPYfJXVo05Nu44NjugVkz2uQKpD3PLD8aI+n6ZAsF2p6dotA +YUL+RG/gTiXdaqmFG+4Yh/ljEjseStiD418/U5S+f4MbsxTaoKP8ABteUZd55ClYBsA 93Kz9RSqZWVvohnPFd0e5ssXwtNK9iuDtX6wteXOCGqMvx5iQMaM+/nuIMPjMv5oziHC idZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=htQl4RsZ; 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 s7si11496983edm.74.2019.09.10.11.46.38; Tue, 10 Sep 2019 11:47:02 -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=htQl4RsZ; 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 S2390804AbfIJAwx (ORCPT + 99 others); Mon, 9 Sep 2019 20:52:53 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:33181 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390745AbfIJAww (ORCPT ); Mon, 9 Sep 2019 20:52:52 -0400 Received: by mail-ot1-f66.google.com with SMTP id g25so14321884otl.0 for ; Mon, 09 Sep 2019 17:52:52 -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=nGIIao9PdFSLqjKhUlXcUfbYL/hFNuXa3CP5/F54v8M=; b=htQl4RsZD/SoZ/vc52gD8t3b50B7xySrWXQ7BLNx7V0jbJLA5b9RhJn2wyqnyWLSv4 ApKclrkm7kzU9kr0b2RpyLy2x2YU2Eq+b7BV+QtnEPvFfBnZO+ZyUbI13yj+BHU6xPKx 1xJ+4apj8ckZWJtLPpVkQECrxSxK7IA9IEeEzEXHOFDAosZ0gFT4UhOuPywHXDgykGwO 7Y9fy0jC1Rpx3o/nmO4hrTf7Jyv7XrsFnYiaIR/eSOJ6mT7WnD+dkowkZAJQxtUmK5Yj owIO8eanjx7Fi2sViZkk8H6w3RyLAWzBe7zsV6BNOfd3RsgH5yv0Ma1mDrFnEa3Na/Rm UrGw== 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=nGIIao9PdFSLqjKhUlXcUfbYL/hFNuXa3CP5/F54v8M=; b=d1QC/sdyq+wx1/TjHarZutTup183AQ0UlIVwvHxI2dLnrYCCnQ2X6bzzkrL28w0tQG iCGhUGQCcc/8rTN5/bU5uLDC2oUNyKnG25NZecub4avlFAl4kZE9b49bZmKj1SEXn8Gk jeKbByVFKJSNx1eUye3I9hHk/9fJ/rQs7Ch9+At0EzsMD8SdlTXJT8j5R1hCpBzjz4U9 iYh7Zk1hCRfzFnJCLOee/tvF/4jpWf0htSCCwBrsOiOc2XuTYUrVDHPy0SHyio7oGJG0 9ElOsNVDZgA+QnWv90dRy242XeD9rTSifCUg1RMeCvlxGPxOBxNKgy+A8H8r5Oihwu9B hT2g== X-Gm-Message-State: APjAAAXMGiCTaqtMFdKkzveyahPfCGVRTnqGrpL6zhhNDnS7tqrioUju c05ziVNOw0N83ddR5sQCRst9zZU3VmXv1eMKdDM= X-Received: by 2002:a9d:12e4:: with SMTP id g91mr21315054otg.368.1568076771758; Mon, 09 Sep 2019 17:52:51 -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> <3a95d20d-ccf9-bd45-2db3-380cc3e0cd17@rasmusvillemoes.dk> In-Reply-To: <3a95d20d-ccf9-bd45-2db3-380cc3e0cd17@rasmusvillemoes.dk> From: Pengfei Li Date: Tue, 10 Sep 2019 08:52:40 +0800 Message-ID: Subject: Re: [PATCH 1/5] mm, slab: Make kmalloc_info[] contain all types of names To: Rasmus Villemoes Cc: Vlastimil Babka , 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 Tue, Sep 10, 2019 at 2:30 AM Rasmus Villemoes wrote: > > 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; }). > Thank you for your comment. I will keep it in v3. I did learn :) > Rasmus