Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5460446yba; Tue, 30 Apr 2019 15:23:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDjJ9l5a39ZxCFoEWErgwdeUVbllbVApTO06BKj16jB6ouR/C4IIrhjofsyI3sUhkz4glX X-Received: by 2002:a17:902:2aa8:: with SMTP id j37mr74048292plb.164.1556663031649; Tue, 30 Apr 2019 15:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556663031; cv=none; d=google.com; s=arc-20160816; b=mf4yKq3OjK3MFx8t9wzNFH98zLroxBRf07qYT7A7cS5eJ92pE5F1AjN2N0x4vZNlN7 L4Oq5UL3cNQAlEXdbzll+4DoTA3dbbDhZaUpRH91idH+kaSWrvVHTYFLBbl+gZh8qAFB H3IVJG8q0FuhECVREYWohHqshS0M/khb1MnupQpixB32DHSH8nFzZXESsdGnyk2tOzpO MPT6apD/JWN31Y36/YWseJJluv8U3iYd77S7k4PBsOvJKP5OeCATl2KCojEe03eZchtt PFURmoxPAX0RUHPJT4/WzYJxTgTeb75O42RoiPGGCFB8rT778UywdILFvo1D3ZdaGZ/4 g0Ow== 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:mime-version :message-id:date:subject:cc:to:from; bh=Oslq2IYpHW9wgb/LfhwWE0cRxTavBJutfSy9HJ0XpeA=; b=RFm7re+9Ubvq1Ev1GPrCh4zP7w4h3EcNJdQmBmv0STxHPhELAla/S55P7mGekj4bCZ MQ5sqQUARAvUd32+ujEKOXw/UwwwE/Nn4EvaAYNNUVcNuVB+V05MT14pl6v+Z+bjnyka LmaoEY8n2ZM4TY5TnYsE095pxMa594kg/lNqaLVBcwYBVrBBNMDiriHSblJicrRPL/A5 Hq6vXP/fufR8YGb2hpGP3XNpuXYKc2SXtl5yYRxN+NeSmec3EKl0YT+vv3xVxe2R+ZBb u5OVyeY+db/fRk3spaNlXTqZxgzvhkNGvvtFPdycvaT1xZOWs7dCX0Krc2mdTWgIuYko H/4g== 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 w2si20132343plp.26.2019.04.30.15.23.36; Tue, 30 Apr 2019 15:23:51 -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 S1727138AbfD3WWK (ORCPT + 99 others); Tue, 30 Apr 2019 18:22:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37816 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfD3WWJ (ORCPT ); Tue, 30 Apr 2019 18:22:09 -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 7F03936809; Tue, 30 Apr 2019 22:22:09 +0000 (UTC) Received: from prarit.khw1.lab.eng.bos.redhat.com (prarit-guest.khw1.lab.eng.bos.redhat.com [10.16.200.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0FC75C239; Tue, 30 Apr 2019 22:22:08 +0000 (UTC) From: Prarit Bhargava To: linux-kernel@vger.kernel.org Cc: Prarit Bhargava , Heiko Carstens , Jessica Yu Subject: [PATCH v3] kernel/module: Reschedule while waiting for modules to finish loading Date: Tue, 30 Apr 2019 18:22:07 -0400 Message-Id: <20190430222207.3002-1-prarit@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.30]); Tue, 30 Apr 2019 22:22:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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; -- 2.18.1