Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp612589ybt; Wed, 17 Jun 2020 09:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxzNjxPfwQfX7WVqdVMwfOxQzwnArv2MIc+r+ez8q8cvrBtsT2EbcivUY48iov0+NZ1A3z X-Received: by 2002:a17:906:bcfc:: with SMTP id op28mr7963633ejb.237.1592410937093; Wed, 17 Jun 2020 09:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592410937; cv=none; d=google.com; s=arc-20160816; b=M1DUmQAps20LXRll+d0IMtd41RkIl4FXouKITqz3jQt2T3QO2L8J9d+bCLd1eANKw/ ntAXyEQlaYFkOy7Xx+IPc1cpK5wU/I03KIsijglmwHg2qGGqDn1jQkKCsTat2mkgezfz 05zvckCybDRPae40UVhH8D3CEXkjbgdrWs5jXI+MbqVWuidsUwYzpnG01vGUrBXcs75n u+RAUt1MKosU4tbGlsltb+2MVa0wDabeCGORtJOHf+sUOoMRnlxRoQamyjuzgiDo+ZeG fcrtz/o1CmnjGN97HL375/+K9gdDomJgf28GRryDZ+q2xYWgFaoP5RlV9qYKJQT6l8UC 9E0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=H4PLU2SD9yhKCiGyNjd460PJkxzsEPUeTiPgkuA08Mo=; b=Tuz37jLanLd8MJq0H+E02pVcmQ68lAeU7f+nVifUzyAN4vDNI6dh4ANo/O1z6JAl2y cJgebcXdREgWidGmT40hWz69H8vYrWIhq9fX08C/aaqmreLN0gH9zqo/IDNH+De/k4Bj b5gcT5zdI/nXXp4gPKCfCwrenzsR1RgN+W3pAimtqj7pkAuE9iGqTL+VtgMjaNRn+yoG T2LD88nvmQZVmv+xLjLQTuagENQK23PPqdkoI4iSINBJwql6BNp2FDa+yhHiwbH5Z7AK Q/P6D0/wtN2qO+HRVMP7QLk2YYOwkBaNdpLQDV3w5P8i85ZnG/5MpFFqJYMKqPCCdqxe 8VvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si255371edr.417.2020.06.17.09.21.54; Wed, 17 Jun 2020 09:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbgFQQTh (ORCPT + 99 others); Wed, 17 Jun 2020 12:19:37 -0400 Received: from gentwo.org ([3.19.106.255]:38660 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgFQQTf (ORCPT ); Wed, 17 Jun 2020 12:19:35 -0400 Received: by gentwo.org (Postfix, from userid 1002) id 043D13E9DB; Wed, 17 Jun 2020 16:19:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 028753E9D1; Wed, 17 Jun 2020 16:19:35 +0000 (UTC) Date: Wed, 17 Jun 2020 16:19:34 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Muchun Song cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/3] mm/slub: Fix slabs_node return value In-Reply-To: <20200614123923.99189-1-songmuchun@bytedance.com> Message-ID: References: <20200614123923.99189-1-songmuchun@bytedance.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 14 Jun 2020, Muchun Song wrote: > The slabs_node() always return zero when CONFIG_SLUB_DEBUG is disabled. > But some codes determine whether slab is empty by checking the return > value of slabs_node(). As you know, the result is not correct. we move > the nr_slabs of kmem_cache_node out of the CONFIG_SLUB_DEBUG. So we can > get the corrent value returned by the slabs_node(). Not that all distribution kernels have CONFIG_SLUB_DEBUG enabled. This does not enable runtime debugging but only compiles the debug code in that can then be enabled at runtime. Users of !CONFIG_SLUB_DEBUG do not want to have the debug code included because they have extreme requirements on memory use. This patch increases use of memory by enabling fields that were excluded under !CONFIG_SLUB_DEBUG before! There is nothing wrong with slab_node's return value if one wants to sacrifice debugging and consistency checks for a small code build.