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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 1F92CC17445 for ; Mon, 11 Nov 2019 18:15:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC9CE206C3 for ; Mon, 11 Nov 2019 18:15:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="l/M6bu5D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC9CE206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0CD6A6B0005; Mon, 11 Nov 2019 13:15:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 07E326B0006; Mon, 11 Nov 2019 13:15:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFCC86B0007; Mon, 11 Nov 2019 13:15:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id DF68F6B0005 for ; Mon, 11 Nov 2019 13:15:33 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 86D5C180AD822 for ; Mon, 11 Nov 2019 18:15:33 +0000 (UTC) X-FDA: 76144799346.30.root53_1364bef13060a X-HE-Tag: root53_1364bef13060a X-Filterd-Recvd-Size: 4709 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 Nov 2019 18:15:33 +0000 (UTC) Received: by mail-oi1-f193.google.com with SMTP id 14so6321908oir.12 for ; Mon, 11 Nov 2019 10:15:33 -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=Rq2V6d7Y7nciv2P1HM6a1jlid5GP970Xb5Uel2De6pXMulOgVOEl4UfnMYdTPlf9VC xkkIw1zMSAE0Sf2FG/e2Sfic4D31EUH1brVLdJ5egjGjCeq0SPobfWJjjua9+iFXs4GY uAM340fKBguida/THgVWdUFSLfFHk+z3S9vPzunEk5PEy0Ym/7vnlG9boHGBToQ5E5Fm kEIlWviLzD92MVxQYaJP2CYAYeembWEt7Kb7DMdFRkDA7Gvw/dOA4GA4j+PV8ugmeBIb /S+e+POLPcFgWQgZX8QQsurboHaGHrphFQbuA4i2gca1eoPGCwuOuUcA1bkRn1ehF0Op LDvw== X-Gm-Message-State: APjAAAXwXW19hAut3/HAOn7NDtHI79nL7qs3x+h5IqytICUBwWP9SopO 8ACTyoW0GnCNMRqWuayEoHlVLJhrmjxsDhFaF20U8w== X-Google-Smtp-Source: APXvYqyCKkeyiY3yL3VCysxF4ewu3NlESq+MKIQi1I+34jOM6EaAmQP2yu13y9xjdq8ILa2s5YuNCcaWS9QyH7dU/kw= 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" 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: +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.