Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5307051ybi; Tue, 11 Jun 2019 23:54:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqykSzMJBNIxHyr+A7pPl09L+++Q4ml1mVWsRVAj6Em8IxnF2aM96yNoCrTsuzbZ3CHAUtgc X-Received: by 2002:a17:902:ba88:: with SMTP id k8mr72751749pls.196.1560322490913; Tue, 11 Jun 2019 23:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560322490; cv=none; d=google.com; s=arc-20160816; b=rgOO95xjuFu5gF/tlgMrSRpGb+9eHZTuUrNiyrgAsl2b0H5+zvmu6c7l+i+InkTrao 8PMqHhi3lF0s6cUpE7lZkfiuxaeIdJbYINRj6O6KIbXG8z1RCh+jCEV3F//hmH991B92 kSkbBZS0kvHa1t8CWv0ex5TqqIKJwaht31cAnND5m4FvVZ8i9wcJTlPRqlP8WzFcJ3H+ FvMfZ/5XpPkD+2oqzHv/qnQG8B3ZcMSC2hraFtR3IgFayKn9Agrfnlax1YJZqJrw1LsJ xEIII1kcr2Oa6lnsfewH2Zv8mX4BX8CZfFgJCynT5abVl/P7uhuqfk5n07NnpeW+XCCp o1nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:smtp-origin-cluster:cc:to :smtp-origin-hostname:from:smtp-origin-hostprefix:dkim-signature; bh=nplAGvztvw22AKN56QTMhELHdT1v5h5cxoHCBLrrDqI=; b=oi4ZPoSc7iCQqVt4/KGrL9yYlYC2hCRrx1WV724NdlWSjDh8Vw61ySzIQfq5Uk70N7 UIybaolgPVwBYRCafOFAdFRAHgW962RpLlJwu2Fztgk0ctA6DLJq5LuRwYHHZ7onyYUZ FH2qNTNQ5mpZAMJR+Q5VHZy50XqmhLzk65+QiyvCuUXQeeXfz19FXfG3uRoH9m6ZGa+U st/KL/ezHAM5EMEwTEhrIbMgWT7KzmAFj2FXhEQ3MZW2RCN1NoKoIOIu0DbNlc8uTYWZ DnlPyN5UWw6UAEiVNsEKt7Vs7EpY/0tkSZN6S1yKKtqMKzInQR0BS03jfS1QbyunMYDR Fkew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=nGjePryA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si4249597pll.417.2019.06.11.23.54.35; Tue, 11 Jun 2019 23:54:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=nGjePryA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408089AbfFKXS7 (ORCPT + 99 others); Tue, 11 Jun 2019 19:18:59 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:50214 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2407991AbfFKXS0 (ORCPT ); Tue, 11 Jun 2019 19:18:26 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5BNBnD3008431 for ; Tue, 11 Jun 2019 16:18:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=nplAGvztvw22AKN56QTMhELHdT1v5h5cxoHCBLrrDqI=; b=nGjePryAVos7TNaTWm7Id2mKsFVe++WTr9Nx9tvWflQTJRXzdEZ7izOhgXCWOrU/hMd0 6nQ0ltd9AFZiFoYBID3dSUrtudltOGCtZ5QcdFLz1SG3Fb3izAuKX7H2AHxa0jysu9Yi M8M71Rx5vvpj7yVk3ONEglGL1MVrxKcR5iE= Received: from mail.thefacebook.com (mailout.thefacebook.com [199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 2t2dkmsy3b-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 11 Jun 2019 16:18:25 -0700 Received: from mx-out.facebook.com (2620:10d:c081:10::13) by mail.thefacebook.com (2620:10d:c081:35::126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5; Tue, 11 Jun 2019 16:18:21 -0700 Received: by devvm2643.prn2.facebook.com (Postfix, from userid 111017) id 3ED11130CBF71; Tue, 11 Jun 2019 16:18:20 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm2643.prn2.facebook.com To: Andrew Morton , Vladimir Davydov CC: , , , Johannes Weiner , Shakeel Butt , Waiman Long , Roman Gushchin Smtp-Origin-Cluster: prn2c23 Subject: [PATCH v7 06/10] mm: don't check the dying flag on kmem_cache creation Date: Tue, 11 Jun 2019 16:18:09 -0700 Message-ID: <20190611231813.3148843-7-guro@fb.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190611231813.3148843-1-guro@fb.com> References: <20190611231813.3148843-1-guro@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-11_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=780 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906110151 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no point in checking the root_cache->memcg_params.dying flag on kmem_cache creation path. New allocations shouldn't be performed using a dead root kmem_cache, so no new memcg kmem_cache creation can be scheduled after the flag is set. And if it was scheduled before, flush_memcg_workqueue() will wait for it anyway. So let's drop this check to simplify the code. Signed-off-by: Roman Gushchin --- mm/slab_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 5e7638f495d1..9383104651cd 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -640,7 +640,7 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg, * The memory cgroup could have been offlined while the cache * creation work was pending. */ - if (memcg->kmem_state != KMEM_ONLINE || root_cache->memcg_params.dying) + if (memcg->kmem_state != KMEM_ONLINE) goto out_unlock; idx = memcg_cache_id(memcg); -- 2.21.0