Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp70814pxa; Mon, 10 Aug 2020 19:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrzcmeZ8cI9sPXsRGNrlK88dV+7pR1iZnGifUVTN3R+p+ZCR74UZWSmTUupr46ahApgqGV X-Received: by 2002:a17:906:b110:: with SMTP id u16mr18926539ejy.483.1597111479809; Mon, 10 Aug 2020 19:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597111479; cv=none; d=google.com; s=arc-20160816; b=BXR8A6GAex91427tg3gl6q+lk9D9guE410h4PSkhomFhp6DLkYKJAA/l2mEbqmhOZ/ disMx6W3fv/XyoiE2EduSrhAVg5zPX3JMHqaEUJaF+GMfX6uv61ia9bksdKAlE3N7F8i z5K9drSajGIiVibHFUHN3EJI6dcLf7Gdg+WtF+a5OCaktcXIg7I6hMdlhcMP1n3SLm1g XH0nO+TZ6ecfco3kExjsxkMNoyHy1N9K/Q+/i4KRwtTVwIIgq2MSKETv4T5vxXCT1q4I 0UOPr32g8I9YDZ/dBD615ocieHZAqnDBeLrf+xz4dK/LPNwr09zORKvl9KxhGMH32/CA iRlg== 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:mime-version :message-id:date:subject:cc:to:from; bh=YE89Vfm7ec9ig7u9oKErk+hcDc4//uDWcejqF3f/SUQ=; b=kvr2gCxYxecXuXN6tU6vfwePxQVrzgPIXrjQi09YXxak8uFhRrV1mHiYzi+hUVwXBe 0fy+PFuA8OPoUPVbIvoRTu96eYo0Oktzfx1G3BIsWgudC0dtpo5r7n8bXzmMlJVwFD+w Q+jCtWbY4YmPKacjRbpLd6piXwQ1x+b8OG/oq9F9AOeiCsodmQIGehbag3XMaGXmu81z C/vMeOFk4xqT8WQ5xul7maS7eQs8yic03kOI6OE+PBiHUm78cb8VVRnomK3VQVXs7p28 cyZIqoWseQI/fv+nEVkt7f4WD6zhrXgkgKZZxA0AaiXTeS2FDlz16uJ7kRN01QtCuWjk nw0A== 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 c15si11193884ejm.289.2020.08.10.19.04.16; Mon, 10 Aug 2020 19:04:39 -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 S1728085AbgHKCDH (ORCPT + 99 others); Mon, 10 Aug 2020 22:03:07 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9361 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728012AbgHKCDH (ORCPT ); Mon, 10 Aug 2020 22:03:07 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 47154FA38E8B707599D2; Tue, 11 Aug 2020 10:03:05 +0800 (CST) Received: from DESKTOP-A9S207P.china.huawei.com (10.174.179.61) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Tue, 11 Aug 2020 10:02:55 +0800 From: To: Christoph Lameter , Pekka Enberg , "David Rientjes" , Joonsoo Kim , "Andrew Morton" CC: , Abel Wu , "open list:SLAB ALLOCATOR" , open list Subject: [PATCH] mm/slub: make add_full() condition more explicit Date: Tue, 11 Aug 2020 10:02:36 +0800 Message-ID: <20200811020240.1231-1-wuyun.wu@huawei.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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) { -- 2.28.0.windows.1