Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp895315pxa; Wed, 19 Aug 2020 18:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRoSELiQ6QmIwJi/0S774Oi5jHd8OMEeLbB+29iKenweJtl0V17GR4sRfckL0PN1XEUgI2 X-Received: by 2002:aa7:c50b:: with SMTP id o11mr766698edq.59.1597888695041; Wed, 19 Aug 2020 18:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597888695; cv=none; d=google.com; s=arc-20160816; b=xYkR7jrC9VG9kbeiWKa+cGf2CuevgVdwMSPtECVcpBgTOv2xV9lS/5amEQVS2Gskld ww6qmoQz0c8xp6tCpz/f7Jo89AiNxQksbD8lonMwPYfxn64yKKAmV4sJP2otwIfw2Zma L967RrhbWgbVQCk27vDDlKJobA6vLWnIwxLCFxOS6+wcXtIWNG+zW2CgSsxs5RGfbEo+ IWFQeFG2pK9S96KCtMEK6TP2SV74dPGBsG3jsTBXslKoDdGJSsQr7isc8CrGy6bzSatU MwCNLi9koRygdqCIKSV5Vwm2FK4VtztWo3ZwpGao43HhvykFZiGi450dfI+MsAPVTpaH GHGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PByLMpxWPFLFqQqb/V99Yh9kuGI7LiXxtgYwmbfPvoI=; b=haxxA+HXPwAi25meqN0wznXF2UczLQp6NyY2lmM9U6dwb8L63PTy6ZjfbbRh++ljl8 phz5hDDECVPVuKizHfsh2nZi5di/auxlWgpLFVFpNOn070bPcy3V0O5cce0cMKSIyJLs WaCjTP744AZTyyH7/5heBH/h1dMXhsnZdowyRW1MsxXlI0f+bctB1fBviKM/NhIiX//B 4LiZW0UnrCjveQzXWQcHMfDkT0BkqHKPu2kSz79K5n2kH8DkGcuEh5dADey/oZlkTA+s MQdb1RWtmsBvVbQB12YLsvCB8mMKNoCDuv/Dmnxgc9F872qVqG/7KhHMMxAqEhwJ4Siq msxw== 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 y19si351082eje.337.2020.08.19.18.57.51; Wed, 19 Aug 2020 18:58:15 -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 S1726715AbgHTB4f (ORCPT + 99 others); Wed, 19 Aug 2020 21:56:35 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:37660 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726362AbgHTB4e (ORCPT ); Wed, 19 Aug 2020 21:56:34 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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