Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2805270ybl; Sun, 12 Jan 2020 03:07:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwLyv3WC71X549T7YXV5DK7lViEgHDMjPodURp+zY7gTW1M+WgDt3Jz593U84U+6WD/3aOp X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr9133910otr.82.1578827247651; Sun, 12 Jan 2020 03:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578827247; cv=none; d=google.com; s=arc-20160816; b=AdPpi2ma6gSi+RjWX4nVwVbc1wYinHaS+2oA25XDySbDsfeBRhA1elE7aqfGoyRfPQ yGi2bz5qdukfpXxKwBLDDAIDPmIQjt1h7dpOkMqaB9wqUFSz3cVzBMOK/PQUit/U2wOU dPDcc0ZJEpSWwkZUeCQER5AdaAG3jt6CDNgUoLwodvbtHJktPxEJRWGZz0JRbdnUQDH4 prc++/KCOpjdITfSia+uQXXzcGRueBV33g8kF8mXTxJgOdN1f9FmqpqFqay8K0yl5yEJ ScgRaoUlM7wdRGKDIeQOO46AsuoAtEHC4hz/KFZ3ZMZ/fJJMY1QjagRJFka6cjnPGRY9 pGKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qyW4qxQHQofmIruSmMHfu6tPK9e1Lt1YgiorN405HNg=; b=JeXHE6/VTW7Q9TLduwg+9kmtGgWxXEAmwP9OeuVFZpkNFTYXxTvPWXuwQHglKjNrl0 btLOHHi8x1SWgIIdYbQtC2FXLrEob2ehK/xaXCgVwMwqCOSJs+hZXUijEuFili4SUvyq zcolr1sBv/8ZhctoYFVVffIpb5qP1YamRzAcW4461mCZFN2OFEAOHn4PU/MddR8LWtqH pO8ZXSDB69TUNpWh8FME0KGA8s9XIg0IuEEpAg4yPEzd3zJm0m7aOckNq5zIxmcf8Msa DOdAfZ9u0hqJFtPaUf1IAmb1VyvS1wf8AbNFjYL57SDuC3i6cIvF7xEk1nHApv9eJhXK 7U8w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z24si5366692otm.101.2020.01.12.03.06.49; Sun, 12 Jan 2020 03:07:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732649AbgALLED (ORCPT + 99 others); Sun, 12 Jan 2020 06:04:03 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:51497 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732641AbgALLED (ORCPT ); Sun, 12 Jan 2020 06:04:03 -0500 Received: from fsav102.sakura.ne.jp (fsav102.sakura.ne.jp [27.133.134.229]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 00CB40vT035022; Sun, 12 Jan 2020 20:04:00 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav102.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav102.sakura.ne.jp); Sun, 12 Jan 2020 20:04:00 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav102.sakura.ne.jp) Received: from [192.168.1.9] (softbank126040062084.bbtec.net [126.40.62.84]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 00CB3sXg034964 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Jan 2020 20:04:00 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [FIX] slub: Remove kmalloc under list_lock from list_slab_objects() V2 To: Vlastimil Babka , Yu Zhao , Christopher Lameter Cc: Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , "Kirill A . Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" References: <20191108193958.205102-1-yuzhao@google.com> <20191108193958.205102-2-yuzhao@google.com> <20191109230147.GA75074@google.com> <20191110184721.GA171640@google.com> <20191130150908.06b2646edfa7bdc12a943c25@linux-foundation.org> <20191207220320.GA67512@google.com> From: Tetsuo Handa Message-ID: Date: Sun, 12 Jan 2020 20:03:53 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/01/10 23:11, Vlastimil Babka wrote: > On 12/7/19 11:03 PM, Yu Zhao wrote: >> On Mon, Dec 02, 2019 at 03:12:20PM +0000, Christopher Lameter wrote: >>> On Sat, 30 Nov 2019, Andrew Morton wrote: >>> >>>>> Perform the allocation in free_partial() before the list_lock is taken. >>>> >>>> No response here? It looks a lot simpler than the originally proposed >>>> patch? >>> >>> Yup. I prefer this one but its my own patch so I cannot Ack this. >> >> Hi, there is a pending question from Tetsuo-san. I'd be happy to ack >> once it's address. > > Tetsuo's mails don't reach linux-mm for a while and he has given up > trying to do something about it. It's hard to discuss anything outside > the direct CC group then. I don't know what's the pending question, for > example. > Hmm, this one? Even non-ML destinations are sometimes rejected (e.g. 554 5.7.1 Service unavailable; Client host [202.181.97.72] blocked using b.barracudacentral.org; http://www.barracudanetworks.com/reputation/?pr=1&ip=202.181.97.72 ). Anyway, I just worried whether it is really safe to do memory allocation which might involve memory reclaim. You MM guys know better... -------- Forwarded Message -------- Subject: Re: [FIX] slub: Remove kmalloc under list_lock from list_slab_objects() V2 Message-ID: <54b6c6a1-f9e4-5002-c828-3084c5203489@i-love.sakura.ne.jp> Date: Sun, 1 Dec 2019 10:17:38 +0900 On 2019/12/01 8:09, Andrew Morton wrote: >> Perform the allocation in free_partial() before the list_lock is taken. > > No response here? It looks a lot simpler than the originally proposed > patch? > >> --- linux.orig/mm/slub.c 2019-10-15 13:54:57.032655296 +0000 >> +++ linux/mm/slub.c 2019-11-11 15:52:11.616397853 +0000 >> @@ -3690,14 +3690,15 @@ error: >> } >> >> static void list_slab_objects(struct kmem_cache *s, struct page *page, >> - const char *text) >> + const char *text, unsigned long *map) >> { >> #ifdef CONFIG_SLUB_DEBUG >> void *addr = page_address(page); >> void *p; >> - unsigned long *map = bitmap_zalloc(page->objects, GFP_ATOMIC); Changing from !(__GFP_IO | __GFP_FS) allocation to >> + >> if (!map) >> return; >> + >> slab_err(s, page, text, s->name); >> slab_lock(page); >> >> @@ -3723,6 +3723,11 @@ static void free_partial(struct kmem_cac >> { >> LIST_HEAD(discard); >> struct page *page, *h; >> + unsigned long *map = NULL; >> + >> +#ifdef CONFIG_SLUB_DEBUG >> + map = bitmap_alloc(oo_objects(s->max), GFP_KERNEL); __GFP_IO | __GFP_FS allocation. How is this path guaranteed to be safe to perform __GFP_IO | __GFP_FS reclaim? >> +#endif >> >> BUG_ON(irqs_disabled()); >> spin_lock_irq(&n->list_lock);