Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2013583ybi; Thu, 20 Jun 2019 07:45:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLFkplRkDOqMTQcMZv5b9xh2jqZ0c6tqG+IOl9RpfLcBbI+f+yvSPLaeXtC86j0T6j3Bvj X-Received: by 2002:a62:e403:: with SMTP id r3mr96986046pfh.37.1561041911825; Thu, 20 Jun 2019 07:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561041911; cv=none; d=google.com; s=arc-20160816; b=uSMSbG2gfiayoCHCsoePIM3InLseI44Z/spJpoYZzIVhRJu/tzFk9tfL2vGJKCsl09 g7linZWmwgkOqaRIQCmZIdnj17dlT1PfCc1Qv342pyHeXZ/LcRzrTqHQeVU6woisGV1J fwPsi3UcvaVB4Mwi9jq2AtxshQQvnEyLOST4McG6IqL1xjNuYCX+/FKd39e+GAvyQSnm cVBR+s2cQF34AHctJ5T7eVqBIn28bOYwXowreaE4+Za6DsAsv9LuJ4MPlG2RfiPJzVcJ aqMBbYNmxpOGpOCTY4+gMbup4H41zFdpjUUevbh0ksD93j9Yf50o7yQApGbLj0mhvyQd UmkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hkFAHTitPkfoSMrSNRMsrnAtfZq9o+iv5woQgM2GCxU=; b=NqPNvmcdf+GNov9KdVszlFb10uYAvhUFCGgeOcpB5vbVft+Eedu7Op8dSaKYjsm3kL VOGGCKy0l28S+rG5j4rFi76BA5cfRGywLzFiUaWV7HrSWsfRUlPZcz1lY+HlEH4uU4dl n4kZ72N50w4QqQFk0RY3i4MHdEzI39IQtui4KzN+g0LKGn4zXixGYnBuvL5eXMR7aIpJ tmdza0VuXy2tIyrP1mLep0IXQibTaAcLZQ4Yy47mKHUDeK9vSRn+Ib8f+Q/CPKqtDvt+ PuDDKc20GGPop7FOYQuzoSSDTNH4yEBJySvtYeIe1OLgNSGJUZlot+FnpdyZ7oSfcjmE 2wsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=thXTMTeT; 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 c21si17660833plo.308.2019.06.20.07.44.55; Thu, 20 Jun 2019 07:45:11 -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=thXTMTeT; 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 S1726836AbfFTOok (ORCPT + 99 others); Thu, 20 Jun 2019 10:44:40 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:43646 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbfFTOoj (ORCPT ); Thu, 20 Jun 2019 10:44:39 -0400 Received: by mail-yw1-f66.google.com with SMTP id t2so1263048ywe.10 for ; Thu, 20 Jun 2019 07:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hkFAHTitPkfoSMrSNRMsrnAtfZq9o+iv5woQgM2GCxU=; b=thXTMTeTx0xXiZ9u/a78f4w6z2h57qLbhWVkhGpc5uU4+H4pPEGPk9N0YCZIJUb/U4 TnuCUQ66JQqC0RvWoZCgR5L5jwqo76zVzKpMp8pXzP0t0CQ13sojAuWtJV7WnzKSCT2L TWtmySeyPfLwUziR7l0nrBHtk8fljJ+2ySjxfL+NG8AENzVWfMDj+iozng9mw4Awlsxa skqETBHwe+amhnj7vzDXN7JX46bW7xj9yy4+eq7BrRCQxowABoE0AiBdKbjHH05Jx41W 5BmmPDMNbpX33eiLB6cDqnj9kFawoUkLCrF0p8UIYzkm0l8IfyFnL90oSO42R54TvW4k dHxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hkFAHTitPkfoSMrSNRMsrnAtfZq9o+iv5woQgM2GCxU=; b=YVpfnJ4JQruoL7R5sL5ZfxxaZwk2jaFtIDHem0DnNzSacJFx1HrYxXe5SzOH8qP1Zy OeVvchJ+FqigvBP90S3x1tI6mrm5u8v0uoXqhnRIWthITzxHS0oDpbSmjrpSuh/jhTda 7lHkDzMb2F6PaXuU5olZmMD6cV6vJr0SaTl4gy+XwRxiCBpS9KHRr2P6RZpZ8JFAbDDD 7jvz8SAwOKVEGGHeC71Yr9jypH4L1bkhmdMDW06zfyzVWq5DG5sWGxmQSWumfYnTkbDO P2nCdCHFKRra97121xVsmCmTKiSqy/g4CIrM3cD30bK713y7KTxPyLY2/G3Xb5MAx5rI 7HEA== X-Gm-Message-State: APjAAAXb9vNUWHrQoJuHRjn+Nq64y12S7mu+QKqHFSgEq/EsbFYJJG8I 68waGD5TeotQxXAQj5ByPE6k8tigKq4UmIBlNKraTw== X-Received: by 2002:a81:ae0e:: with SMTP id m14mr55624057ywh.308.1561041878378; Thu, 20 Jun 2019 07:44:38 -0700 (PDT) MIME-Version: 1.0 References: <20190619232514.58994-1-shakeelb@google.com> <20190620055028.GA12083@dhcp22.suse.cz> In-Reply-To: <20190620055028.GA12083@dhcp22.suse.cz> From: Shakeel Butt Date: Thu, 20 Jun 2019 07:44:27 -0700 Message-ID: Subject: Re: [PATCH] slub: Don't panic for memcg kmem cache creation failure To: Michal Hocko Cc: Johannes Weiner , Christoph Lameter , Andrew Morton , Roman Gushchin , Pekka Enberg , David Rientjes , Joonsoo Kim , Cgroups , Linux MM , LKML , 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 On Wed, Jun 19, 2019 at 10:50 PM Michal Hocko wrote: > > 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? > The memcg kmem cache creation is async. The allocation has already been decided not to be accounted on creation trigger. If memcg kmem cache creation is failed, it will fail silently and the next allocation will trigger the creation process again. > > 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? > That would need some investigation into the history of SLAB_PANIC. I will look into it. > > Reported-by: Dave Hansen > > Signed-off-by: Shakeel Butt > > Acked-by: Michal Hocko Thanks.