Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3241953imu; Sat, 24 Nov 2018 00:54:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/U5gCOg6PH087f68da2bWSjlAJbZyuYJiAK1PIEoCM+FP36urmpqlIh0XcjiddBRRJTBxKF X-Received: by 2002:a17:902:1d4a:: with SMTP id u10mr17225297plu.122.1543049640339; Sat, 24 Nov 2018 00:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543049640; cv=none; d=google.com; s=arc-20160816; b=vcW2d5sf6gVp6HaiNgCg0nZEnIWAQD47j+NXqeNG4Zv8VbNEKBEDue9zhXrbPMTbRt OUQxTklm2ebXF/lSbTTPVlsMmCW0kNmjQZTqxJwt4js++Rsa6tYyM5fXr9ZB2/Gbsi0F HaWfvbl1+K13YyeD0vbzrxS8VQ6qeJ4PpTOxyyGGxYR4e6hgQ1ymcQeq1zm/USQpllZv TWLgzEKvhuMRzjWPb4A8hl7FPh5CeTHoxWLkySMhBV+8j4YphxmEhMyOunSrr4S0HCTY rtPoND4MH0Pk6heU7tnVT37aad1QYZhp6TChf8umWZITCj0jT6tZTEAKt20HyoqSO9Cb RkSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=4BNoKMXavjr0j7zuy+XSGLeGGFqD/zgR4GidS27v4d0=; b=WGyJJVtnb4Ay7JQM1LHtC+UOATxHPzNsOtA8fPfxqYJN1n6Fn4AoJu7OC4YadZPNHX KoMdoO1CQ/JUMwk04knP5t6gegqncclpRRnc1ss/bhTTek25LTFpaT1JBfadBbNlTcGI MqApntRrBQ4n6tywEepXh9shA7mHitTWcIZdQ+cUH2BsEOR+3WuQg4wqzXgWK0nS9/kT Jo31XMZN6zdFKNnflaE+gc6ZP7g8MpFAu9ytjEOXTcLk1f7Mr6wJ7EmJIRzA/ibn1a/w YJR6ibe55MSgeeRlMKcMCsjNOCjWT6aKNDDnFPdWfGycu9hKeusHFtLVwmpu3jFUyhJ+ RwLA== 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 s59si16339614plb.237.2018.11.24.00.53.46; Sat, 24 Nov 2018 00:54:00 -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 S1726922AbeKXIck (ORCPT + 99 others); Sat, 24 Nov 2018 03:32:40 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:51248 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbeKXIck (ORCPT ); Sat, 24 Nov 2018 03:32:40 -0500 Received: from p4fea46ac.dip0.t-ipconnect.de ([79.234.70.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gQJHW-0007M0-8H; Fri, 23 Nov 2018 22:46:34 +0100 Date: Fri, 23 Nov 2018 22:46:33 +0100 (CET) From: Thomas Gleixner To: Waiman Long cc: Qian Cai , akpm@linux-foundation.org, yang.shi@linux.alibaba.com, arnd@arndb.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH] debugobjects: call debug_objects_mem_init eariler In-Reply-To: Message-ID: References: <20181123043117.992-1-cai@gmx.us> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Nov 2018, Waiman Long wrote: > On 11/22/2018 11:31 PM, Qian Cai wrote: > > The current value of the early boot static pool size, 1024 is not big > > enough for systems with large number of CPUs with timer or/and workqueue > > objects selected. As the results, systems have 60+ CPUs with both timer > > and workqueue objects enabled could trigger "ODEBUG: Out of memory. > > ODEBUG disabled". > > > > However, none of the things are actually used or required beofre before > > debug_objects_mem_init() is invoked. > > > > According to tglx, > > "the reason why the call is at this place in start_kernel() is > > historical. It's because back in the days when debugobjects were added > > the memory allocator was enabled way later than today. So we can just > > move the debug_objects_mem_init() call right before sched_init()." > > > > Afterwards, when calling debug_objects_mem_init(), interrupts have > > already been disabled and lockdep_init() will only be called later, so > > no need to worry about interrupts in > > debug_objects_replace_static_objects(). Just out of curiosity. How many objects are allocated between early and mem init? > > diff --git a/lib/debugobjects.c b/lib/debugobjects.c > > index 70935ed91125..cc5818ced652 100644 > > --- a/lib/debugobjects.c > > +++ b/lib/debugobjects.c > > @@ -1132,13 +1132,6 @@ static int __init debug_objects_replace_static_objects(void) > > hlist_add_head(&obj->node, &objects); > > } > > > > - /* > > - * When debug_objects_mem_init() is called we know that only > > - * one CPU is up, so disabling interrupts is enough > > - * protection. This avoids the lockdep hell of lock ordering. > > - */ > > - local_irq_disable(); > > I think you should have a comment saying that debug_objects_mm_init() is > called early with only one CPU up and interrupt disabled. So it is safe > to replace static objects without any protection. Yes please. Thanks, tglx