From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB9F3C433DF for ; Thu, 20 Aug 2020 01:56:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 996EC207DA for ; Thu, 20 Aug 2020 01:56:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 996EC207DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 23EB88D0008; Wed, 19 Aug 2020 21:56:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F15A8D0003; Wed, 19 Aug 2020 21:56:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 105E08D0008; Wed, 19 Aug 2020 21:56:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id EC08D8D0003 for ; Wed, 19 Aug 2020 21:56:39 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A7161181AEF00 for ; Thu, 20 Aug 2020 01:56:39 +0000 (UTC) X-FDA: 77169282918.18.wall31_2311cae2702c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 7C759100EC663 for ; Thu, 20 Aug 2020 01:56:39 +0000 (UTC) X-HE-Tag: wall31_2311cae2702c X-Filterd-Recvd-Size: 2519 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 01:56:38 +0000 (UTC) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 22F38C665B61BDFEEC86; Thu, 20 Aug 2020 09:56:31 +0800 (CST) Received: from [10.174.179.61] (10.174.179.61) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 20 Aug 2020 09:56:23 +0800 Subject: Re: [PATCH] mm/slub: make add_full() condition more explicit To: Andrew Morton CC: Christoph Lameter , Pekka Enberg , "David Rientjes" , Joonsoo Kim , , "open list:SLAB ALLOCATOR" , open list , , References: <20200811020240.1231-1-wuyun.wu@huawei.com> <20200819123713.38a2509a2b7651f14db33e61@linux-foundation.org> From: Abel Wu Message-ID: <85259217-3805-92d8-3be1-8279d8a6a85b@huawei.com> Date: Thu, 20 Aug 2020 09:56:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.1.0 MIME-Version: 1.0 In-Reply-To: <20200819123713.38a2509a2b7651f14db33e61@linux-foundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.61] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 7C759100EC663 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000030, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2020/8/20 3:37, Andrew Morton wrote: > On Tue, 11 Aug 2020 10:02:36 +0800 wrote: > >> From: Abel Wu >> >> The commit below is incomplete, as it didn't handle the add_full() part. >> commit a4d3f8916c65 ("slub: remove useless kmem_cache_debug() before remove_full()") >> >> This patch checks for SLAB_STORE_USER instead of kmem_cache_debug(), >> since that should be the only context in which we need the list_lock for >> add_full(). >> > > Does this contradict what the comment tells us? > > * This also ensures that the scanning of full > * slabs from diagnostic functions will not see > * any frozen slabs. > I don't think so. If the flag SLAB_STORE_USER is not set, the slab won't be added to the full list no matter this patch is applied or not, since the check inside add_full() will guard for that. Am I missing something here? Regards, Abel