From patchwork Sun Jun 14 12:39:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 11603283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30CF692A for ; Sun, 14 Jun 2020 12:39:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E219620775 for ; Sun, 14 Jun 2020 12:39:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="HjEBQvjq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E219620775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0484C6B0024; Sun, 14 Jun 2020 08:39:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F3B646B0025; Sun, 14 Jun 2020 08:39:39 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E50736B0026; Sun, 14 Jun 2020 08:39:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id CB0F66B0024 for ; Sun, 14 Jun 2020 08:39:39 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8B396180AD815 for ; Sun, 14 Jun 2020 12:39:39 +0000 (UTC) X-FDA: 76927773678.30.bone21_4a0b35126ded Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 72D2E180B3AA7 for ; Sun, 14 Jun 2020 12:39:39 +0000 (UTC) X-Spam-Summary: 2,0,0,80b649bad2f60bdb,d41d8cd98f00b204,songmuchun@bytedance.com,,RULES_HIT:41:69:355:379:541:988:989:1260:1311:1314:1345:1437:1515:1534:1539:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3351:3865:3866:3871:3873:5007:6261:6653:7903:10004:11026:11473:11658:11914:12043:12048:12291:12296:12297:12517:12519:12683:12895:13069:13161:13229:13311:13357:13894:14095:14384:14394:14721:21080:21444:21627:21966:21987:21990:30012:30054:30070,0,RBL:209.85.214.194:@bytedance.com:.lbl8.mailshell.net-66.100.201.201 62.2.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: bone21_4a0b35126ded X-Filterd-Recvd-Size: 3597 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Sun, 14 Jun 2020 12:39:38 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id k1so5559628pls.2 for ; Sun, 14 Jun 2020 05:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0vV7/CZOj4kPeW+wCZqP9Gsy8CNwb/9mPsDlLoU+DEo=; b=HjEBQvjqCXIpYO6Fe5tmfKnl21F7mDxU0JW9p45BhcepYQo5axuDiM8oeTxXhqGVLz ezPBsDcDzXzs3Iuuh6tiu5sZ0iz6LJg7LowtFEayJbfVrXkTQiW1GNiXOpLicIun188F 0rNBTTzB0jRXSc7NFKzLC0cuTlxaaW9t8bCr5KsWCVLlStrbRHpM9Oi8eQg9epbgpM3Y +UZwGkp46JkdNB/obuPCe62hDrLDFIAbzOIi0gV4ROcb8VheQRpxRCMtzvk3OHvwsXFF G3aofrb2CAkZ03rnFbwcZhBAbEjezfzLkhPJa8Qk+CwHw4sFyp6TH4KZTCih/7Lm7b9n DEJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0vV7/CZOj4kPeW+wCZqP9Gsy8CNwb/9mPsDlLoU+DEo=; b=UEwBoDPpW8A2kGk18pOS3LuLXaYqphvyVOoQa8ea+o+ROqPkPkCIG/GQO+W05Q16fg 9omRePDReDdFejm2+1t2EjScGHAYcu/qQvHPsd43QXYlsvJ7fN5S7quzNaCdgB3zpRbk w71GfQGQ1x/l5Owoim2yFZVGHtjz8fG/hJduuaV+ih6PIcN68uv6q/Q8lPn4Je7+dk5H /JhRPiSivhzanaydgTNygRpq50xmUJxWUgYxOpRDARKzhS3FkYN2oL95tejQmgyrjR2n KgIaR1q3JBej7bKC5VOX0GyuLRWEisLSXI5xT5kN0BD7laFP6IlKcyXy6S+rB+/QA/11 KS8g== X-Gm-Message-State: AOAM531uo1jl3dfbjksN6182EIYrYFemD4rCyfbp8vjZuQ6k2wx7k0CJ sOscIGGdqZSuxaKephahznJtBg== X-Google-Smtp-Source: ABdhPJyjuvjj++xRj9MW/3qcHeLL9ewjJZ1jmZvaI/Z0ep4lQa7sE2fTBXOkRa/NqXW9WO+QthE6nw== X-Received: by 2002:a17:902:b493:: with SMTP id y19mr18014748plr.186.1592138377189; Sun, 14 Jun 2020 05:39:37 -0700 (PDT) Received: from Smcdef-MBP.lan ([103.136.221.68]) by smtp.gmail.com with ESMTPSA id hi19sm9776606pjb.49.2020.06.14.05.39.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jun 2020 05:39:36 -0700 (PDT) From: Muchun Song To: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: [PATCH 0/3] mm/slub: Fix slabs_node return value Date: Sun, 14 Jun 2020 20:39:20 +0800 Message-Id: <20200614123923.99189-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) MIME-Version: 1.0 X-Rspamd-Queue-Id: 72D2E180B3AA7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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(). Muchun Song (3): mm/slub: Fix slabs_node return value when CONFIG_SLUB_DEBUG disabled mm/slub: Use node_nr_slabs() instead of slabs_node() mm/slub: Fix release all resources used by a slab cache mm/slab.h | 2 +- mm/slub.c | 93 +++++++++++++++++++++++++++++++++------------------------------ 2 files changed, 50 insertions(+), 45 deletions(-)