Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2157886pxa; Mon, 17 Aug 2020 02:23:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9fBf1vknZKdjacjY9jQNLWG8c3YHLEa5icWwN2yLznM572K8WkmhuSEJgMzGxqzgq/iUz X-Received: by 2002:a17:906:289a:: with SMTP id o26mr13903563ejd.309.1597656220841; Mon, 17 Aug 2020 02:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597656220; cv=none; d=google.com; s=arc-20160816; b=nO+2Rkt6m9H1Vlqq3btnW2o+Xf83JIe9TrAS6+Naup6Za6TT69tCXnxCbHBAgc+VhQ BWR1FnWcdEUxhheu0vdckhjewjvNLD8OqMc8gm+kU8zfkR2uet11DDlt4OTL65IZ5Akn udVHW8gnr66sMkXlmrQhQwraxHO3w6t0ZB4wkpe53/fZAuQmD/RNYLkPPTzJKlD0Q3Rj xQlbRXKBmijkW6MAf6FwpIJOFFA5H3l06Q5Yci3WslbLnadd/GkxUPZFdmAEWUNLpuzQ 59n9T4E6hzp2K+Warn9w6IwHXb2EdwrNLW0qf2QEc734z9LwlIvYswhCAPrGEL6XdyQ2 Inog== 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=aQ7dtqS817qzmBVDXPGI+EF8/cOVz62rGz/wxfelZUs=; b=reVa6c/KvJrFDmWo2LA3Ah8LsneUg43icHnSG13pH1Gbv1yviHONsc9e3vTlauifpN zb0n4sGrV18z7EguxgtV42WTNVxt7OZvB2jDao3G9PL7zl/nsqV4f5zn+ZhEEWsd5Zmw TN6BdntR6h1MYl6luB7TyJGnikxvceGemdVbYzOsmxCsO18kji7WJ+8JWCAM2n1Plq7E 7qFPOzAxpV6UoSjZs+oUSlZmlV81OifWeahB7S4wIXt9LlUK+0qFQIb+GskqKIMCfRxs Jfy4W/ZO//JI//kEyjStkvBYWxY5Q3rl0WiM+Vhw12RlSIgZOUYBPWBUrR5Ztm3409zy 7dRA== 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 z9si10893864edr.282.2020.08.17.02.23.18; Mon, 17 Aug 2020 02:23:40 -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 S1728358AbgHQJUI (ORCPT + 99 others); Mon, 17 Aug 2020 05:20:08 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9822 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726161AbgHQJUF (ORCPT ); Mon, 17 Aug 2020 05:20:05 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 5FC7371CC3DB3C292129; Mon, 17 Aug 2020 17:19:58 +0800 (CST) Received: from [10.174.179.61] (10.174.179.61) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 17 Aug 2020 17:19:54 +0800 Subject: Re: [PATCH] mm/slub: make add_full() condition more explicit To: Christoph Lameter , Pekka Enberg , "David Rientjes" , Joonsoo Kim , "Andrew Morton" CC: , "open list:SLAB ALLOCATOR" , open list References: <20200811020240.1231-1-wuyun.wu@huawei.com> From: Abel Wu Message-ID: <40c24455-02fd-4b4c-7740-bb7d2af0f5c7@huawei.com> Date: Mon, 17 Aug 2020 17:19:54 +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: <20200811020240.1231-1-wuyun.wu@huawei.com> 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 ping :) On 2020/8/11 10:02, wuyun.wu@huawei.com 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(). > > Signed-off-by: Abel Wu > --- > mm/slub.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/slub.c b/mm/slub.c > index f226d66408ee..df93a5a0e9a4 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2182,7 +2182,8 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, > } > } else { > m = M_FULL; > - if (kmem_cache_debug(s) && !lock) { > +#ifdef CONFIG_SLUB_DEBUG > + if ((s->flags & SLAB_STORE_USER) && !lock) { > lock = 1; > /* > * This also ensures that the scanning of full > @@ -2191,6 +2192,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, > */ > spin_lock(&n->list_lock); > } > +#endif > } > > if (l != m) { >