From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71AEBC17445 for ; Mon, 11 Nov 2019 15:47:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A7A520679 for ; Mon, 11 Nov 2019 15:47:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A7A520679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 866696B0005; Mon, 11 Nov 2019 10:47:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8172B6B0006; Mon, 11 Nov 2019 10:47:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77A2F6B0007; Mon, 11 Nov 2019 10:47:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 673BF6B0005 for ; Mon, 11 Nov 2019 10:47:05 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 19435180AD811 for ; Mon, 11 Nov 2019 15:47:05 +0000 (UTC) X-FDA: 76144425210.02.loaf99_20b650df4e817 X-HE-Tag: loaf99_20b650df4e817 X-Filterd-Recvd-Size: 2575 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 Nov 2019 15:47:04 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id B85DF3EC1E; Mon, 11 Nov 2019 15:47:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id B71FA3EC1D; Mon, 11 Nov 2019 15:47:03 +0000 (UTC) Date: Mon, 11 Nov 2019 15:47:03 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Yu Zhao cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , "Kirill A . Shutemov" , Tetsuo Handa , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" Subject: Re: [PATCH v4 2/2] mm: avoid slub allocation while holding list_lock In-Reply-To: <20191110184721.GA171640@google.com> Message-ID: References: <20190914000743.182739-1-yuzhao@google.com> <20191108193958.205102-1-yuzhao@google.com> <20191108193958.205102-2-yuzhao@google.com> <20191109230147.GA75074@google.com> <20191110184721.GA171640@google.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, 10 Nov 2019, Yu Zhao wrote: > On Sat, Nov 09, 2019 at 11:16:28PM +0000, Christopher Lameter wrote: > > On Sat, 9 Nov 2019, Yu Zhao wrote: > > > > > > struct page *page, *h; > > > > + unsigned long *map = bitmap_alloc(oo_objects(s->max), GFP_KERNEL); > > > > + > > > > + if (!map) > > > > + return; > > > > > > What would happen if we are trying to allocate from the slab that is > > > being shut down? And shouldn't the allocation be conditional (i.e., > > > only when CONFIG_SLUB_DEBUG=y)? > > > > Kmalloc slabs are never shut down. > > Maybe I'm not thinking straight -- isn't it what caused the deadlock in > the first place? Well if kmalloc allocations become a problem then we have numerous issues all over the kernel to fix. > Kmalloc slabs can be shut down when memcg is on. Kmalloc needs to work even during shutdown of a memcg. Maybe we need to fix memcg to not allocate from the current memcg during shutdown?