Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2067559ybi; Thu, 20 Jun 2019 08:35:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGfuxxxI/2B11BJ403EWGqXx1eNFF9LNFRWRcd48xe0VpWFE8ByNR72sHjwyPfaJFenaaH X-Received: by 2002:a65:6210:: with SMTP id d16mr13270678pgv.180.1561044944387; Thu, 20 Jun 2019 08:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561044944; cv=none; d=google.com; s=arc-20160816; b=xdEBN6W/xeL+Z8GK57BniS6/u+T+fAiT770NTR/I2ax6964QIrmjIgRK7Jc00MQkqG Un8ETrwmdYvtfXsRsHLdygLbFT7XfPPzG+juTYdB3vaR/85ttPGtxtk7ZkohR6kYMPEB q11M46w/5IWZg0rObrxxbc1qxazLZqnk7WAQYCGEpQFHkrVATKVbSPPjhMrNJKfQnnsd MK0yyRznf9UBU95of821bIlRQCT0uvu5zJ4trTcAtcD1vC6PgL/0j/y0tXil+HT00L/P eN6oVMW2c3u/WJ7D67fjd00iho1t+MrzsqRD+7YGhWsBbYRkfx7LkncutEQbAvtWdjNn AVwA== 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=u+mmkWAHRBgKlRAKMtOSMbXS1tIdbWjLVcOXwPY9fFQ=; b=zUxfSH5xvYYJ9KHdVIg2VojI7NnVdI0TA29xEiNP+9B7RRnLEx16mewRm9LntmAwtu iTR0CKZUfnvsbqhoUJQ+kfArIZXbIf8IUW5darSrSjsZxCRXEt5DKGCGLnvYomI9+Anr API9nVSZVdkXujH2qpmRgloQ473oa2eEGRFLoc4eAJ56o2R/53Hr+iQcYS1QmPzQARxY KV8QNWI7tz+7RhqzQOmnUiqEM6AFqaQbmbBvsD/9kafTL9dPWOqY79NyqNGFCxBxyrzf oE/1JIECCEpkzmfkj5x1XKOdpUBuHB2HaohIGLmbrIJMAR4jUoAuL2fi1PotkOvgeI26 Ii3g== 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 x7si5080793pfi.257.2019.06.20.08.35.28; Thu, 20 Jun 2019 08:35:44 -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 S1726894AbfFTPfT (ORCPT + 99 others); Thu, 20 Jun 2019 11:35:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:41364 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726757AbfFTPfT (ORCPT ); Thu, 20 Jun 2019 11:35:19 -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 1977EAE46; Thu, 20 Jun 2019 15:35:18 +0000 (UTC) Date: Thu, 20 Jun 2019 17:35:16 +0200 From: Michal Hocko To: Shakeel Butt Cc: Johannes Weiner , Christoph Lameter , Andrew Morton , Roman Gushchin , Pekka Enberg , David Rientjes , Joonsoo Kim , Cgroups , Linux MM , LKML , Dave Hansen Subject: Re: [PATCH] slub: Don't panic for memcg kmem cache creation failure Message-ID: <20190620153516.GG12083@dhcp22.suse.cz> References: <20190619232514.58994-1-shakeelb@google.com> <20190620055028.GA12083@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu 20-06-19 07:44:27, Shakeel Butt wrote: > 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. Ohh, right I forgot that it will get retried. This would be useful to mention in the changelog as it is not straightforward from reading just the particular function. > > > 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. Well, I strongly suspect this is a relict from the past. I have hard time to believe that the system would get to a usable state if many of those caches would fail to allocate. And as Dave said in his reply it is quite silly to give this weapon to a random driver hands. Everybody just thinks his toy is the most important one... -- Michal Hocko SUSE Labs