Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1236415ybi; Wed, 19 Jun 2019 16:27:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpomndNteNIfm5yU0qjsmqPby9+lDw2Lrp/hnndEEvWrEFsgXemk0WgI9lxL4GlKAvMxaf X-Received: by 2002:a17:90a:3548:: with SMTP id q66mr7542836pjb.17.1560986822100; Wed, 19 Jun 2019 16:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560986822; cv=none; d=google.com; s=arc-20160816; b=Rnnv2yhhPtlRcdFifBLtMiefEqVqbIxjWH86fZhGq8M2uVsis2A9EnCVyuSdMwatkv 9helWDew9MkEuF0fzmZGNi9bWcMVrbFXlgD1hkE/oUy34RDMcgB41HHfiY+HAnsRhM/f WkSEiPOLyr2JY/WCnv8VWUYgG77sbskL3C6synIb2R963wNiP6HXTpNIh3DH0a9yeq48 kQffb6lqfdi+cOxoxZtwcIQOoljL+0Vzpmi77yK3C/wHnth+FnYP0iNKOtWc8kRDq7UM WCHw6/pLgFmO/mgHbbtzJTdD7G2iuFQdAOfZFd89RiClR9+rRqtyVytMdktVNETCYZJZ +k7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=2Xe5CNu50mksX/zEQQqGlLiWQgOuxvE/hS5GIpxigKA=; b=GHHDgAblY/UU8Rrz9IFYuKuyw7OIJEpObZJ80f5g+TxBfkcO378z+aYpInv3zfz8B9 fwmowyw3Cut3J8Avq3+0tNk5s+Cx38qJOfvGBrsFCSQIo8vP0oa08UsRZ9RTKCPu1weL r+ppLngKGiI+ooMJmlCWCM9r7fs7GV21mJjRk3aQBLW7WU/x1bdY9MiWlSpi/1t8z/Zc Frd3pdnZ6gD5jQ6zbJSnYSKe6lmxtbNljPlJRauYMGHALFtx3hFn1DxOAWTlCZ/rn5C+ azLTwzZZF5MVmklXfeXqNcP1/X3YDE1XvRko5P3Z4lPsGG+DXxX03WtW+qMxbnJC188S TpRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=g1it1Ete; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si2615921pjl.60.2019.06.19.16.26.46; Wed, 19 Jun 2019 16:27:02 -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=@google.com header.s=20161025 header.b=g1it1Ete; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730785AbfFSXZZ (ORCPT + 99 others); Wed, 19 Jun 2019 19:25:25 -0400 Received: from mail-yb1-f202.google.com ([209.85.219.202]:42647 "EHLO mail-yb1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfFSXZZ (ORCPT ); Wed, 19 Jun 2019 19:25:25 -0400 Received: by mail-yb1-f202.google.com with SMTP id c3so1075485ybo.9 for ; Wed, 19 Jun 2019 16:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=2Xe5CNu50mksX/zEQQqGlLiWQgOuxvE/hS5GIpxigKA=; b=g1it1EteZ/NGeK69zsjfHOTg9qZMabcBis5hFjOrlB2l+EFid2XH43a/H1Q98WQaN4 EuaSsBaTPlqXmMYUHUth9G/bMVvlH6pFOoOKmzO5ypBeVy38P7a0Es8xFNAKHTRaabbw 8raai+S+rVgHmvNm9WwaNFbh3CDbHzBDR0yc8D2i20C+AGY93ETkj7ecEaSTfenjJLSd fcu2WQVp0NMDR3iKV/rnrn6v8WivwS78j6PGG20RxN0RiXWs5GoTqxJGDi9W1+QRi9g4 d0z67gIh/nncaGZD0tfYFyUqwU/UD9ePElOit5dKhGB4YOjiUpRTPlAbsW+SCWdDRbSB Q3KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=2Xe5CNu50mksX/zEQQqGlLiWQgOuxvE/hS5GIpxigKA=; b=GHIjonJGXzCeASrOjdVNl9Db7O5wUH5+1esSTd06K7Y/o4szikWYdd7WaaTiehguV4 O+RqkA3GGs7Aq1X8Djo6mAaGpAMWKGoHutoF40wY+TuT4vcCgLbblTCfZBm4MlkMWbSy TJZPnt6QjkHz+dBY4NwW/JZcb5TtjWxrH+sCE418MSpjrybQVlGds4yYrElIIEd1XB8T 4StsfGbZEKlwBJkaRp5iao8R2fuIINBApgxCj0+8nn1yyGNcNoab1SVq0z0O9TJcAsN7 GsC1xBCTK2al35KZpQqrSzSyGyIfxFogG8F1Hznedu+5UDEY8/g9QGp3B9huiS2Oi9ze 7hvQ== X-Gm-Message-State: APjAAAXq6twPQyx9wMOrQjQ4odeVPTk3OHIEZH0xp2xTcJBZ9XBhyEWl 7Adf6BoMnIy4CqYVJZScbmrq7Qlwvo3Prw== X-Received: by 2002:a0d:c485:: with SMTP id g127mr43382535ywd.405.1560986723899; Wed, 19 Jun 2019 16:25:23 -0700 (PDT) Date: Wed, 19 Jun 2019 16:25:14 -0700 Message-Id: <20190619232514.58994-1-shakeelb@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH] slub: Don't panic for memcg kmem cache creation failure From: Shakeel Butt To: Johannes Weiner , Christoph Lameter , Michal Hocko , Andrew Morton , Roman Gushchin , Pekka Enberg , David Rientjes , Joonsoo Kim Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shakeel Butt , Dave Hansen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently for CONFIG_SLUB, if a memcg kmem cache creation is failed and the corresponding root kmem cache has SLAB_PANIC flag, the kernel will be crashed. This is unnecessary as the kernel can handle the creation failures of memcg kmem caches. Additionally CONFIG_SLAB does not implement this behavior. So, to keep the behavior consistent between SLAB and SLUB, removing the panic for memcg kmem cache creation failures. The root kmem cache creation failure for SLAB_PANIC correctly panics for both SLAB and SLUB. Reported-by: Dave Hansen Signed-off-by: Shakeel Butt --- mm/slub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 6a5174b51cd6..84c6508e360d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3640,10 +3640,6 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags) free_kmem_cache_nodes(s); error: - if (flags & SLAB_PANIC) - panic("Cannot create slab %s size=%u realsize=%u order=%u offset=%u flags=%lx\n", - s->name, s->size, s->size, - oo_order(s->oo), s->offset, (unsigned long)flags); return -EINVAL; } -- 2.22.0.410.gd8fdbe21b5-goog