Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1528629ybi; Wed, 19 Jun 2019 22:51:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+caAErd/z/PS7PEP845l1kySHEn3etD2cL1D3ztQZ9QdBy6aBoy30YP0buoAigaZQbXqX X-Received: by 2002:a17:90a:9b8a:: with SMTP id g10mr1236823pjp.66.1561009862326; Wed, 19 Jun 2019 22:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561009862; cv=none; d=google.com; s=arc-20160816; b=w/nkSv45AShHmxTDzvyoAZxjMG4Gs/zhXEuyRzFY43bNBrQ3ANj8NNgMDJBLULJbSD V2PRa3bMku8Mt2N+BVMPD44hbUgvxjmhk61ySBIsAyUVD1XeBKbh2yVQDRqA7VLmAuTs J5FKlqKY9d5URw5da4hLY8Io+WZ/gdDvUyNJ6r278FREOzXRGfxl9AO8znQvCc14oeXy Qdrp8x/NyO/zsS/am/8ZpIRC04+jIVJ8agpnxuVPnZTu3Ft/52f1Rw8YWTLfYlZ//7oP ekJPPjHvbRptqykuSqpunXzQ7AEB5cEonFqYbcR45ekRJN+NUq8rpCvFDBBBZoc+wdNY jejA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3T44utvmtBO3o2QILLRC35Gdr9y9LM81Qc8eYWW3mvg=; b=J6YSv6Pq2y79pSHSElGVqUCYHc7YutgHiOZFaKkwwOveWo2iyVyIMl24QSttzGLGH2 RT9H3t2ZB/56D6infpm8MAzjoL0AccnaYSUavBQ9Ef0V7Sm2CCOj2IVOXaxzLuRxkD8S HcAfG8R+n6RwgcqQ7UwoaXagsKtCeCGLZW5Ace5YVd353Hn/mUgQ0Fv4tXMeNzxtSsxv vjqMmad0BX5l8oSo28A0747Ris/FPL6bGMGfNIybdWpfcGQLulRZTxQxu+ekDhglWS06 PXhPlC2qfi+yiArNELu6pr+YOORpmckwXUe3zvxrhB7JtwTKan8930QuZEEBTuRZkN+p zUCg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si17003036plp.361.2019.06.19.22.50.37; Wed, 19 Jun 2019 22:51: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726370AbfFTFud (ORCPT + 99 others); Thu, 20 Jun 2019 01:50:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:60596 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725857AbfFTFuc (ORCPT ); Thu, 20 Jun 2019 01:50:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4B5A0AC2C; Thu, 20 Jun 2019 05:50:31 +0000 (UTC) Date: Thu, 20 Jun 2019 07:50:28 +0200 From: Michal Hocko To: Shakeel Butt Cc: Johannes Weiner , Christoph Lameter , Andrew Morton , Roman Gushchin , Pekka Enberg , David Rientjes , Joonsoo Kim , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Hansen Subject: Re: [PATCH] slub: Don't panic for memcg kmem cache creation failure Message-ID: <20190620055028.GA12083@dhcp22.suse.cz> References: <20190619232514.58994-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190619232514.58994-1-shakeelb@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 19-06-19 16:25:14, Shakeel Butt wrote: > 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. AFAICS it will handle those by simply not accounting those objects right? > 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. I do agree that panicing is really dubious especially because it opens doors to shut the system down from a restricted environment. So the patch makes sesne to me. I am wondering whether SLAB_PANIC makes sense in general though. Why is it any different from any other essential early allocations? We tend to not care about allocation failures for those on bases that the system must be in a broken state to fail that early already. Do you think it is time to remove SLAB_PANIC altogether? > Reported-by: Dave Hansen > Signed-off-by: Shakeel Butt Acked-by: Michal Hocko > --- > 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 -- Michal Hocko SUSE Labs