Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6517471ybx; Mon, 11 Nov 2019 10:17:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxmAcvoyvlGMCuU3174OfBS/tmFs1rJdELV9kTxgYza21eFe+j8kerDbSPD6RkPfa136stv X-Received: by 2002:a17:907:20b8:: with SMTP id pw24mr12169669ejb.28.1573496221320; Mon, 11 Nov 2019 10:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573496221; cv=none; d=google.com; s=arc-20160816; b=Wz1Z/wTqNSzq0ddJVse4iEJ4GivVF06HTWfa7wSjqWrlQUvScHIDBHCq4trhB10D9s 0jPCPcwlgZiDlKsoed0+XE205H5tP/uj57QGDIR5A7s14MCGh6WzLgOAEIfV+2TgH0/L oHOhxF2fVt6/IbUYIVrQ4w/97DweIOeqJUqgjfpC6N/aOt/fekAvUYi9NK14RXPsUJL2 I2y36w1MGZ+RNl4TGIh0lfpHpW20twpSC91rxUlyMtK7Rb1a5C8Xyx7jlq0rhCFtVdJs Irw7WdPovMBfPj7HmrqSb99dKoZHXJIS7Lzxv2jYxapoDauyPfn1EIodBIGOiYSeu7WJ Lwhw== 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=Wp8sNHHWKT8+0gi2mlOjdtdiQUngDsbO3HXqLtINp/4=; b=xxWffZo7WBHHwuzlTOvFFSg8fN93X27PcaM5jGxLxISgeMue0TD1C/o9MPl81foRLg Q6FsK+BauE3ECfo4GQF6bQSBJ6E+lideL1agaH2OtIugGxqKFKFpsEJTBlB2bw+6TCto /TeGANw4KrFOWxx/MFCWitmzToJkldeHUOYHTQN+QRhEwnBfcuJ8tKBttnT59tNYduH3 H9iQ3syp5BmAbZVUapLonK0R85v6MG+8R7hqc2fYB3sn44Fnc+oSSaglijYJDh3Is3nY SRGpy7c1LfhJDUT5YgtZHO+h+Bmzo41OCxjBHWVYCUDBe84uQbDmRcVmlnm90JtR0Xog VRbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="l/M6bu5D"; 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 l15si9932119ejc.27.2019.11.11.10.16.37; Mon, 11 Nov 2019 10:17:01 -0800 (PST) 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="l/M6bu5D"; 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 S1726957AbfKKSPd (ORCPT + 99 others); Mon, 11 Nov 2019 13:15:33 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:46420 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbfKKSPd (ORCPT ); Mon, 11 Nov 2019 13:15:33 -0500 Received: by mail-oi1-f195.google.com with SMTP id n14so12274610oie.13 for ; Mon, 11 Nov 2019 10:15:32 -0800 (PST) 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=Wp8sNHHWKT8+0gi2mlOjdtdiQUngDsbO3HXqLtINp/4=; b=l/M6bu5DsPv1ggcaYLv0rj75Z+n1KYiYbFPcRtoYSAzEFuALAktcqMbOstn/rQ3Q7y A1HEZ+E2f1nw7BW1yJxy0Oez4a7h680j8FZR9SSZvyLaBlQA2t4R97S1gm7XI0zZHnWt fcDk1qLckOYvjrSvIm4z84U1Let85I67Aa+geIkkUjk99DM0BJ9JvlTAwg7sgKtxLrj/ gvRekgJPtvxlI+J33aQgIyZPJAcxft6JZNmJNW0S/jwvCbGCkahYAUaMfQVqFwBkpnKC 6ydhI1qYjviq0PvXA1N3hi8IdnVQMoFLrb09Oock6NqDBcRt9mPsQ4PVHNSmdyBhINvw ckrg== 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=Wp8sNHHWKT8+0gi2mlOjdtdiQUngDsbO3HXqLtINp/4=; b=gKHyjqe12ufE4R3vdzs5RW0vbapfnGqC6B8GdRYRa1DXY2PglbdYoCr6ai4G8eeZmB woZ4NilYaO4WlzObQKvZGWUOkfqAg2I4GiP05aZUV9CewL+tfL2mbgTKNXfb61998moP X40OZNqt3OzMBjU5JSTTjfStk4C6HI7uSJy5uxFR+B6qR3uqjglInh6q7vakB1rdXEf9 OSUiJztRlNbNGbprcghrAN13fBUyF1pFNW68i5QUj4bvMOZgEss6ZmraMAVW72vSGYeb kiDIPM8b/N++P/FIVuB7pZA01wg/98t2y1Fa236gH2xp1b95QKqjQmirTk0YOTl+Q+SF nFxg== X-Gm-Message-State: APjAAAX9wBYtIcaX5U16/LkjHI2j+XPSbRsp0KF736wg6kH3wvFeSYEw Dk8XqGUqHT98TunaHs9c7p8XsthGSxLictGmGO1dBw== X-Received: by 2002:aca:f1c5:: with SMTP id p188mr230164oih.125.1573496131953; Mon, 11 Nov 2019 10:15:31 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: From: Shakeel Butt Date: Mon, 11 Nov 2019 10:15:20 -0800 Message-ID: Subject: Re: [PATCH v4 2/2] mm: avoid slub allocation while holding list_lock To: Christopher Lameter , Roman Gushchin Cc: Yu Zhao , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , "Kirill A . Shutemov" , Tetsuo Handa , Linux MM , LKML , "Kirill A . Shutemov" 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 +Roman Gushchin On Mon, Nov 11, 2019 at 7:47 AM Christopher Lameter wrote: > > 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? > > Roman recently added reparenting of memcg kmem caches on memcg offline and can comment in more detail but we don't shutdown a kmem cache until all the in-fly memcg allocations are resolved. Also the allocation here does not look like a __GFP_ACCOUNT allocation.