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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EA43C433FE for ; Mon, 10 Oct 2022 03:55:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0D066B0071; Sun, 9 Oct 2022 23:55:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE37B6B0073; Sun, 9 Oct 2022 23:55:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AE2B6B0074; Sun, 9 Oct 2022 23:55:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 89B9E6B0071 for ; Sun, 9 Oct 2022 23:55:47 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 25AA11603D2 for ; Mon, 10 Oct 2022 03:55:47 +0000 (UTC) X-FDA: 80003675934.28.5B58455 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf19.hostedemail.com (Postfix) with ESMTP id B99381A0021 for ; Mon, 10 Oct 2022 03:55:46 +0000 (UTC) Received: by mail-pl1-f169.google.com with SMTP id 10so9378062pli.0 for ; Sun, 09 Oct 2022 20:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=jHg7PCQfsS+7XZtzpDwJLaneTRAAVsZzS3wdGwh5q+w=; b=ivq1nvTNX4FhoBYGr9suu1WrwgN3ItOhHAMqOLrDbFanfCkE6DuUbX9Iu/Dk0CDb9O IPaB+NV0ktWIk7XVBIEy8juI0R9uMyPC933JOOM6riwozLHo4bcvCjCKs0Egw3aZ1rhb iR3j1sUQOhpSqITye7w5Pq9JcUG7Oeit2Kz0EWdDnODSLcpahv8kN/iOckQCn8a7RxrJ njoh9hXUou8Zk3xRpAUS8NMqdMam1vQfTiCcsaga7wWRzsgRXuImaKb1CAobFuUI5fTF PxRQuwt7L/1nuGguBvQ4dMLSKhNnqzMAZs34dH74qzGSJvfzPc4DcDFy6OdCOOQNbker i8FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jHg7PCQfsS+7XZtzpDwJLaneTRAAVsZzS3wdGwh5q+w=; b=lsXyzlhHhsa1CWOuMKW+QbzdyILC5254BOWzjciCzU2NBSlNtxgWO8gjoIXNbH6zyq PxfVp7rYAAkJvM8f0HT9V1OwRY8PQ3i9MEWB6ntCZDqih1zpuSIS2maZJwllpivS+z3p 4vQStWGma6GTf31vpHDlctOZApWTNHqnuhp8lW5QR+OEB6g6bg9ll4GRUnkAEyK9IO1f GYpEDViKagk3jjYjesbc75fLkKz9uYM1scRNStLMckdrScpjdxlo1c2QmuLrkvJycmUN mZ06azsxO5BrR9kHzz5efH+OXiavonL10mdJ6RHHI0oqLXxNvQK+q0sohJr5VBzkKjTY sS0A== X-Gm-Message-State: ACrzQf2icVkNCr6SIQ0xPPLcXZyaZxZfrom2S6NxmHXY+YVukiFZvxtU dRP5zsl1X8QBC+KsjbfgGep4xevvkiKsqw== X-Google-Smtp-Source: AMsMyM4cqgTWOczXJA0pjCrfj7CLfHqkbLg0TOFRa584lWrORN6uRK9rrxFAqE2ZzzSxSpv6gvRzGQ== X-Received: by 2002:a17:902:900a:b0:178:77c7:aa28 with SMTP id a10-20020a170902900a00b0017877c7aa28mr17234333plp.3.1665374145681; Sun, 09 Oct 2022 20:55:45 -0700 (PDT) Received: from [2620:15c:29:203:5c2c:f18c:2a4e:44d2] ([2620:15c:29:203:5c2c:f18c:2a4e:44d2]) by smtp.gmail.com with ESMTPSA id x188-20020a6263c5000000b0056268979639sm5672143pfb.123.2022.10.09.20.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 20:55:45 -0700 (PDT) Date: Sun, 9 Oct 2022 20:55:44 -0700 (PDT) From: David Rientjes To: Rasmus Villemoes cc: Christoph Lameter , Pekka Enberg , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: slub: make slab_sysfs_init() a late_initcall In-Reply-To: <20220930102712.789755-1-linux@rasmusvillemoes.dk> Message-ID: <4e36bc37-07c7-b502-572c-62b3aaa2b3cc@google.com> References: <20220930102712.789755-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665374146; a=rsa-sha256; cv=none; b=MMHfvO/Kye9Q7/wU7GuY0lHCpZTFQuzJZ7HaT+EJe4eTNs+4yb2PEnDFxxC4X6xWL8q2MP l80LleI+2c7bLbDP0hMe/5VkHW+RD4cdBqm9kxL6OtyUEtpieY01wvEm6Wn7yTe0hT/t1U 5E/2hh0zhGHsDKP3wllV+dk5zzqYtp8= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ivq1nvTN; spf=pass (imf19.hostedemail.com: domain of rientjes@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665374146; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jHg7PCQfsS+7XZtzpDwJLaneTRAAVsZzS3wdGwh5q+w=; b=56a3dI196ChNO++ARtX0IxlC3VovrhxGDcgsp8+bHH+E4v3GYADLu9g6hc+xuQw9vfF4zT mb9bZhsuQ6kK/xXmr2iZv9E6QmnFF7TPpWnUmkyzf1vNmP7i85q1mY4O4eyK0zjnSyekDs Hxf5RDH6t1e3tZewD4AYTVPTNHu7tSE= Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ivq1nvTN; spf=pass (imf19.hostedemail.com: domain of rientjes@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: hd5mys36hbdduh8tb3bjak5nb8jhtfz8 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B99381A0021 X-Rspam-User: X-HE-Tag: 1665374146-41956 X-Bogosity: Ham, tests=bogofilter, spamicity=0.002835, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 30 Sep 2022, Rasmus Villemoes wrote: > Currently, slab_sysfs_init() is an __initcall aka device_initcall. It > is rather time-consuming; on my board it takes around 11ms. That's > about 1% of the time budget I have from U-Boot letting go and until > linux must assume responsibility of keeping the external watchdog > happy. > > There's no particular reason this would need to run at device_initcall > time, so instead make it a late_initcall to allow vital functionality > to get started a bit sooner. > > This actually ends up winning more than just those 11ms, because the > slab caches that get created during other device_initcalls (and before > my watchdog device gets probed) now don't end up doing the somewhat > expensive sysfs_slab_add() themselves. Some example lines (with > initcall_debug set) before/after: > > initcall ext4_init_fs+0x0/0x1ac returned 0 after 1386 usecs > initcall journal_init+0x0/0x138 returned 0 after 517 usecs > initcall init_fat_fs+0x0/0x68 returned 0 after 294 usecs > > initcall ext4_init_fs+0x0/0x1ac returned 0 after 240 usecs > initcall journal_init+0x0/0x138 returned 0 after 32 usecs > initcall init_fat_fs+0x0/0x68 returned 0 after 18 usecs > > Altogether, this means I now get to petting the watchdog around 17ms > sooner. [Of course, the time the other initcalls save is instead spent > in slab_sysfs_init(), which goes from 11ms to 16ms, so there's no > overall change in boot time.] > > Signed-off-by: Rasmus Villemoes Acked-by: David Rientjes