Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp796017rwb; Tue, 29 Nov 2022 05:35:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5sv4JxMrdVPWOJKCYwL4v1q4ZNFX6UIqnCyGKjdLLgf+1KPdbOl7Gmsfavv09qmVlEOgXi X-Received: by 2002:aa7:dc19:0:b0:461:f94:913 with SMTP id b25-20020aa7dc19000000b004610f940913mr36819057edu.102.1669728931847; Tue, 29 Nov 2022 05:35:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669728931; cv=pass; d=google.com; s=arc-20160816; b=wvEel4l/MFXe8TmD5QzmGh1UmgXRCCRh/Bx4Ig0jSOvS4b2p6xtLCjKTAXgLLQc7Nm QU4i68m+prpsrom7FYToBb7tfIEoKT9psA2opMRNwbuoY5ImTahTbQAw80wTqrpovEu6 KzS7Cely+kCYFllrJucJ9GEDv3BOzb1B3XtKDUh8MtljkHQFD+v5c1ePrANbWcuU+him DX4g7UxJb+PvRzGxpCcFg/po3R/MzjdtlEFel3WCBCOv3vxdyJpJVfxS97Cludn7E5fJ 4pHgRNyFeh75dlIacC0vq4ScOtw9/zrXvsPr9Cms3HJst8LtCNEKVETVz+y665ctOaHx DNRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=+ddLoPqUlGwN54qz/sZSyEFbmj1Q4v1kwEK4epfP/bo=; b=bYrxjGi0W2gKpIA5cgChKLgJ8KYBDaC3x7RstqVuyNdKX3041exgIYJlCzn9tMBrw1 wVFYzeMgOPRU5AoPU2DNn/0LCH32j8PaIbYBnGebNEH5lxFoKwVgM1V0muT1zipjlTAs axiUBkFdQX7b+4hOwJMx18IlYDcRoCMSBSSTHvAI57xMY6qzlO4cdsaRhyAO75Z+ItU7 qUPwhcdCahh1pGwVcFXuceCP4POEuhvhaXQJiNL8rTOE3HuyUXIF4yDPoHeszwBIzZQk DcGrQI0puUo5iFcqHuhmsSNRyH0a3a0ruwyqfPrDrn+OC8IxhPDL0usqo1jdbCP/TzAN 4NCg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=ixML41x2; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd11-20020a1709069b8b00b007af15567a5bsi12735905ejc.432.2022.11.29.05.35.11; Tue, 29 Nov 2022 05:35:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=ixML41x2; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233374AbiK2NOu (ORCPT + 84 others); Tue, 29 Nov 2022 08:14:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233813AbiK2NOX (ORCPT ); Tue, 29 Nov 2022 08:14:23 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6293263158; Tue, 29 Nov 2022 05:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TuqCdBDB9Hm4ZiD2B5TZU6E60RNJHkhg+d10Yi3JIYqmpSYephi11pmeTQNvXNyURn17RFILrdNSIaWsSd/Oh4K2MUGEIAtlR9gDtmtu9G3ggRnD6REmmsek5y0QYsQnyFjWO+JkTb1Ea/iU+MvndIlEE0reX+ICWJsC/COJroQj3I/8LJCgT4SDbmB+i5HhSOpWf7O+n1YwQLfeVHzR92nM5bnxGdTKuojvsLD5nFfhT7t/8HuKEW9/avGt50r0LbWlJdBl8gmTWGuwfsL0KF739h9l3XAEUTEL4P7MfuMuXU3cOR7M2UM7IB3EUFr6+rJAQTlOlnc+Pe5fvItl0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+ddLoPqUlGwN54qz/sZSyEFbmj1Q4v1kwEK4epfP/bo=; b=nu43Su27CxJOkIhRgxjSt6MLOyFTVC2XbFzv3Gl0+EVhazm4F/ur/lQgLUAEcuxf6k2Cl0wTKklG1Kl3aupjJe05FK441ufEG7oykyKoDU8zV2iYpAxnXaDTSlnNGTAM+RG3mGnCjrabM8ComizSa3Kq/k/my+T8AOtMzq2KThnERlomqbX2lZr/cQ+DJSTGhyHgXixcpyPU5OU98jitP5HC5H4MLSUByVC0beI2Q7NqF1jITqAQjBezgKEkRucI9TjAjxXr7+m/Ih6BwsxJx5EX5tchgwVY2Zhfo6cQml+VCmMgark4Yw9smV2GTF5vehKfsBKcfQ+E56zuXiXD2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ddLoPqUlGwN54qz/sZSyEFbmj1Q4v1kwEK4epfP/bo=; b=ixML41x2FfewdTQnV7SzN913lTdCSR30Uoom3S7HQlxTvJxoAmS2m4r6eMB/HDTdw2qkie/2ca0ky6I63FkC1n0Ays1GnokRvGXF2P6seYKJK+8oXwhJoqORBogSgjDu4cFJ0Ns2LV8XvuBwaCnPp+AzahlVNEqy4/TD4Q8fohOt5m2puQ17zFTh1CPWJDlsj90yH95Jz81ue3j4T7CxWPxNaw0uWi66p6bVgHeBuxRR9egOXhcrXlf7lv0LpxUWxySKrF8jgPFqznVLriIpYGfxs5Z02YCNwTrI9IPim+XYvma+xfxM6pKd5U9hkHgwXRuqtX5eycHGzvtyRswKwA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from AM0PR0402MB3395.eurprd04.prod.outlook.com (2603:10a6:208:1a::16) by DBBPR04MB7753.eurprd04.prod.outlook.com (2603:10a6:10:1e1::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20; Tue, 29 Nov 2022 13:13:40 +0000 Received: from AM0PR0402MB3395.eurprd04.prod.outlook.com ([fe80::14eb:6506:8510:875f]) by AM0PR0402MB3395.eurprd04.prod.outlook.com ([fe80::14eb:6506:8510:875f%7]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 13:13:39 +0000 Message-ID: <2ac0b871-60d0-c535-3fe0-bfaa0d9f7685@suse.com> Date: Tue, 29 Nov 2022 14:13:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2 2/2] module: Merge same-name module load requests Content-Language: en-US To: Prarit Bhargava , David Hildenbrand , Luis Chamberlain Cc: pmladek@suse.com, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220919123233.8538-1-petr.pavlu@suse.com> <20220919123233.8538-3-petr.pavlu@suse.com> <5467e66d-55de-ca8f-c1ae-ffe6efe7290d@redhat.com> <94cd5565-1058-2c97-57bb-0ddf12416cd6@redhat.com> From: Petr Pavlu In-Reply-To: <94cd5565-1058-2c97-57bb-0ddf12416cd6@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR2P281CA0173.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9f::8) To AM0PR0402MB3395.eurprd04.prod.outlook.com (2603:10a6:208:1a::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR0402MB3395:EE_|DBBPR04MB7753:EE_ X-MS-Office365-Filtering-Correlation-Id: a0314f4f-10d6-4b21-fc22-08dad20b8803 X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EySiwnHeGvQYZmpc1twdhv7RrR7fujvNjhNczVJLAJP5jiGhwjBxbCbiyNGAFR9PclHEmBlgPvFFaZP+RFyrYo34Trn1LWV+ZrbYX6DKfQ0oi17+uwqrxHqXKh7/07zwqkOe7sbj+EhQXpwlwRn1/HvE6V5iYKDlArgrQ8/OplcFB4BFRBPWaB8+pIIUADVhFsqPD8h1Z76lkISsbOll1RFV3beooY1TtWURbrsZBCbc6L7jfG1OkFm0j2UegNxZxu+nM26D627DdUiohILkMpH5Br03C8QxvIjeBBGkos3JdD/9+leeJOZydSd0ieEeVSaYmFAOyINM5NUd877Pmq6PfEB/wGS99bTKvfwNLQM+N0GkTfxjAXiISy0AhVqB1L9+jST+hArZ2DC/iD2SkdG+Sl+yA9u2ZDaz15O1qIZetWQuJ3RN9PfEm2/EzphqnSu6k3j3x3Zjx7cbzsmj+Am5lMmVNHQViWpPFxnq1Ed7Vi2HbNDL9WN6/9yZxmEKDzaQfoZeG2wuAVzuI6BzAXewcLomvl9UuisTwC36Q263tuatjfG7dNOP4FfjifT46gjHBEAGgiU7I9CoZ6ZVKmt7NI+tJmJWEezxsQbb7F8HoyEJ1VyUzrX3t859F3+NGdp/6drU7Agal+hnXErmt9K82lXbAnFwxum7oG1clWx0azexlCPp4XyOV5g6tLl1es20MaJ5no7e6Kib/BJcTCNOJCV0XY+WGgiLlHJd8bQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR0402MB3395.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(366004)(376002)(39860400002)(346002)(451199015)(6486002)(186003)(41300700001)(31686004)(478600001)(2616005)(36756003)(110136005)(38100700002)(6506007)(316002)(26005)(6512007)(55236004)(66946007)(86362001)(31696002)(66476007)(4326008)(66556008)(8676002)(8936002)(5660300002)(53546011)(2906002)(83380400001)(44832011)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R1l1WW5MTTlnbXdiQmZlaDR1Y2dBc0ljWlVmclMxcGMyVjYvZ3VJSDJKQUYw?= =?utf-8?B?azJNeGRRdTVEZzE3WVJkOTRmN0pFVE50NHA0TlJ1a3RXS3pxc3lNaTBLOTY4?= =?utf-8?B?d1F3WnU4cUMvM25sNzF4anBPMWlrMVNzUCt2dG5kU2FRSm1wWWhVY2ZkemdL?= =?utf-8?B?N2E3elVEWDN3Ni93VXhaRGhtWDdYZHZScVE5ZDZIUGdmZ2lreUhlSDBwZUcx?= =?utf-8?B?TjdzWlVLN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= =?utf-8?B?SXpzZlhucThDMTZjeEtHajBRYUNLSVBWM0ZuR0NJTmkrQTJ3d2JzVkMvQnc0?= =?utf-8?Q?FHU09h/fGX+MNjGlwQVe+1J4M?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0314f4f-10d6-4b21-fc22-08dad20b8803 X-MS-Exchange-CrossTenant-AuthSource: AM0PR0402MB3395.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 13:13:39.8219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: imr0k1sRjjv0sTVQdmqoQeq/ENR0A0t4AXGk42bIqpUbWOiGgwZS2E2JxcNr0BdAAZ03N4qMD0rmLpe9WF80KQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7753 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/22 17:29, Prarit Bhargava wrote: > On 11/14/22 10:45, David Hildenbrand wrote: >> On 14.11.22 16:38, Luis Chamberlain wrote: >>> On Mon, Nov 14, 2022 at 09:57:56AM +0100, David Hildenbrand wrote: >>>> On 12.11.22 02:47, Luis Chamberlain wrote: >>>>> On Wed, Oct 19, 2022 at 02:00:55PM +0200, Petr Pavlu wrote: >>>>>> On 10/18/22 20:33, Luis Chamberlain wrote: >>>>>>> On Sat, Oct 15, 2022 at 11:27:10AM +0200, Petr Pavlu wrote: >>>>>>>> The patch does address a regression observed after commit >>>>>>>> 6e6de3dee51a >>>>>>>> ("kernel/module.c: Only return -EEXIST for modules that have >>>>>>>> finished >>>>>>>> loading"). I guess it can have a Fixes tag added to the patch. >>>>>>>> >>>>>>>> I think it is hard to split this patch into parts because the >>>>>>>> implemented >>>>>>>> "optimization" is the fix. >>>>>>> >>>>>>> git describe --contains 6e6de3dee51a >>>>>>> v5.3-rc1~38^2~6 >>>>>>> >>>>>>> I'm a bit torn about this situation. Reverting 6e6de3dee51a would >>>>>>> be the >>>>>>> right thing to do, but without it, it still leaves the issue reported >>>>>>> by Prarit Bhargava. We need a way to resolve the issue on stable and >>>>>>> then your optimizations can be applied on top. >>>>>> >>>>>> Simpler could be to do the following: >>>>>> >>>>>> diff --git a/kernel/module/main.c b/kernel/module/main.c >>>>>> index d02d39c7174e..0302ac387e93 100644 >>>>>> --- a/kernel/module/main.c >>>>>> +++ b/kernel/module/main.c >>>>>> @@ -2386,7 +2386,8 @@ static bool finished_loading(const char *name) >>>>>>        sched_annotate_sleep(); >>>>>>        mutex_lock(&module_mutex); >>>>>>        mod = find_module_all(name, strlen(name), true); >>>>>> -    ret = !mod || mod->state == MODULE_STATE_LIVE; >>>>>> +    ret = !mod || mod->state == MODULE_STATE_LIVE >>>>>> +        || mod->state == MODULE_STATE_GOING; >>>>>>        mutex_unlock(&module_mutex); >>>>>>        return ret; >>>>>> @@ -2566,7 +2567,8 @@ static int add_unformed_module(struct module >>>>>> *mod) >>>>>>        mutex_lock(&module_mutex); >>>>>>        old = find_module_all(mod->name, strlen(mod->name), true); >>>>>>        if (old != NULL) { >>>>>> -        if (old->state != MODULE_STATE_LIVE) { >>>>>> +        if (old->state == MODULE_STATE_COMING >>>>>> +            || old->state == MODULE_STATE_UNFORMED) { >>>>>>                /* Wait in case it fails to load. */ >>>>>>                mutex_unlock(&module_mutex); >>>>>>                err = wait_event_interruptible(module_wq, >>>>>> @@ -2575,7 +2577,7 @@ static int add_unformed_module(struct module >>>>>> *mod) >>>>>>                    goto out_unlocked; >>>>>>                goto again; >>>>>>            } >>>>>> -        err = -EEXIST; >>>>>> +        err = old->state != MODULE_STATE_LIVE ? -EBUSY : -EEXIST; >>>>>>            goto out; >>>>>>        } >>>>>>        mod_update_bounds(mod); >>>>> >>>>> >>>>> Prarit, can you verify this still does not break the issue you >>>>> reported? >>>>> David, does this also fix your issue? >>>> >>>> I didn't try, but from a quick glimpse I assume no. Allocating module >>>> space >>>> happens before handling eventual duplicates right now, before a >>>> module even >>>> is "alive" and in the MODULE_STATE_UNFORMED state. >>> >>> The first two hunks are a revert of commit 6e6de3dee51a and I'm under >>> the impression that cauased your issues as *more* modules states are >>> allowed through. >>> >>> The last hunk tries to fix what 6e6de3dee51a wanted to do. >>> >> >> Note that I don't think the issue I raised is due to 6e6de3dee51a. >> >>>> But maybe I am missing something important. >>> >>> Please do test if you can. >> >> I don't have the machine at hand right now. But, again, I doubt this >> will fix it. >> >> >> The flow is in load_module(): >> >>     mod = layout_and_allocate(info, flags); >>     if (IS_ERR(mod)) { >>         ... >>     } >> >>     audit_log_kern_module(mod->name); >> >>     /* Reserve our place in the list. */ >>     err = add_unformed_module(mod); >>     if (err) >>         goto free_module; >> >> >> You can have 400 threads in layout_and_allocate() loading the same >> module at the same time and running out of module space. Any changes to >> add_unformed_module() and finished_loading() won't change that, because >> they are not involved before the module space allocations happened. >> > > I'd like to see a refreshed patch but I tested the latest version and > see that the boot time is LONGER with the change > > Before: > > [11:17 AM root@intel-eaglestream-spr-15 kernel-ark]# systemd-analyze > Startup finished in 55.418s (firmware) + 22.766s (loader) + 35.856s > (kernel) + 5.830s (initrd) + 15.671s (userspace) = 2min 15.542s > multi-user.target reached after 15.606s in userspace. > > After: > > Startup finished in 55.314s (firmware) + 23.033s (loader) + 35.331s > (kernel) + 5.176s (initrd) + 23.465s (userspace) = 2min 22.320s > multi-user.target reached after 23.093s in userspace. > > Subsequent reboots also indicate that userspace boot time is longer > after the change. Thanks for testing this patch, that is an interesting result. I see the following dependency chain on my system (openSUSE Tumbleweed): multi-user.target -> basic.target -> sysinit.target -> systemd-udev-trigger.service. My understanding is that the udev trigger service only performs the trigger operation but does not actually wait on all devices to be processed by udevd. In other words, handling of the forced udev events can still be in progress after multi-user.target is reached. The current serialization of same-name module loads can result in many udev workers sleeping in add_unformed_module() and hence creating at that point less pressure on the CPU time from udevd. I wonder if this then maybe allows other work needed to reach multi-user.target to proceed faster. Could you please boot the machine with 'udev.log_level=debug' and provide me logs ('journalctl -b -o short-monotonic') from a run with the vanilla kernel and with the discussed patch? Thanks, Petr