Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6537568yba; Wed, 1 May 2019 14:29:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/OltDx/redrNvKNZd9JrpDmhcBvBiEq8m1oTjuiDUWwAsb8ortUzsR5v908JfwL98u4BE X-Received: by 2002:a63:4f41:: with SMTP id p1mr236149pgl.63.1556746182801; Wed, 01 May 2019 14:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556746182; cv=none; d=google.com; s=arc-20160816; b=ltrZHoh0YKfFqcIRgIwot7nPbi05sxBJT0f/EBxj/Wj4ZQtjMPngBGyzBBb8i+K0oW QSdVtfLHsUck0WN/eVyTnlv43wHdJ0cqfjOGMgpOpZRoohvkdLB18Uz8nsT8JJo4iNW6 +Z0pAcZQliCH0oeUny2v7N/2XhwYEKlIH3YoBCJN3jPEvQfUdfQwnCLIZM0WucHK1rM6 jepyoiUIfZc9mIG/o/cNsVDY0A/2zTJtenxKSqEmGgt5th6Csskl4UZ/jGSMqFeNF1ZL EwlLMHln2QpAi5/r9wKs6oix/ll+raySYmtsHneA21xW3Bo7r6JrSojDdnHoTWFKe18W kHEQ== 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=GBADIr/s4lrygBCUKymu5VmDlYGk2VWUVVYfh3WxH3I=; b=TnrKUy+U1AS3w2Hae33XkGgsgQmoOypduHQPMt7xrDhq5v7pa5BiJtvFcRFQec32GP S0T1Dk7/672fSG+ZxdIca93uUabpDH4CtdSGigSz28OqrCYOatpAsHcpqWT6Hh8/Xw9m i3muJIuPXDnSRUosaz26zpRGHL0TzJdxVjDXZ1wzrVE6Nk/4cMnPmufaNVIdOfxXjgFT RF0A5l5goZ51CxuQQhXLpq4HsffaYyJDqa+vjbA9gOsGYAJpRSqNX/cocX7kSF42zzds AIshJFGovxfRgcMkOtE/wx6TYWwl7BGFPFOT1JalBLhSh17q/pt00eNr/L0aH6CGOXBj kiNw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si14362053pfa.289.2019.05.01.14.29.27; Wed, 01 May 2019 14:29:42 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbfEAV0w (ORCPT + 99 others); Wed, 1 May 2019 17:26:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44642 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfEAV0v (ORCPT ); Wed, 1 May 2019 17:26:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A49A93082A24; Wed, 1 May 2019 21:26:51 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw1.lab.eng.bos.redhat.com [10.16.200.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3755678905; Wed, 1 May 2019 21:26:51 +0000 (UTC) Subject: Re: [PATCH v3] kernel/module: Reschedule while waiting for modules to finish loading To: linux-kernel@vger.kernel.org, Jessica Yu Cc: Heiko Carstens , David Arcari References: <20190430222207.3002-1-prarit@redhat.com> From: Prarit Bhargava Message-ID: <90e18809-2b70-52d8-00b3-9c16768db9ad@redhat.com> Date: Wed, 1 May 2019 17:26:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190430222207.3002-1-prarit@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 01 May 2019 21:26:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/30/19 6:22 PM, Prarit Bhargava wrote: > On a s390 z14 LAR with 2 cpus about stalls about 3% of the time while > loading the s390_trng.ko module. > > Add a reschedule point to the loop that waits for modules to complete > loading. > > v3: cleanup Fixes line. Jessica, even with this additional patch there appears to be some other issues in the module code that are causing significant delays in boot up on large systems. Please revert these fixes from linux-next & modules-next. I apologize for the extra work but I think it is for the best until I come up with a more complete & better tested patch. FWIW, the logic in the original patch is correct. It's just that there's, as Heiko discovered, some poor scheduling, etc., that is impacting the module loading code after these changes. Again, my apologies, P. > > Reported-by: Heiko Carstens > Fixes: f9a75c1d717f ("modules: Only return -EEXIST for modules that have finished loading") > Signed-off-by: Prarit Bhargava > Cc: Jessica Yu > Cc: Heiko Carstens > --- > kernel/module.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/module.c b/kernel/module.c > index 410eeb7e4f1d..48748cfec991 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -3585,6 +3585,7 @@ static int add_unformed_module(struct module *mod) > finished_loading(mod->name)); > if (err) > goto out_unlocked; > + cond_resched(); > goto again; > } > err = -EEXIST; >