Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3776749yba; Mon, 29 Apr 2019 08:20:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsRu7dZMlNDv9JNLQflhqjE8/znA8EkWsPXNryeUN/NngjCeE0+7nWOLZqUny0TIzwlOr4 X-Received: by 2002:a63:4a45:: with SMTP id j5mr60493229pgl.426.1556551243578; Mon, 29 Apr 2019 08:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556551243; cv=none; d=google.com; s=arc-20160816; b=jajGn9lJNZXuZCoNN2UUKvhKmASTeu/5XGP5Z5BH3KUJYbTv8zu3ijGwd+qhw66o8H dhA8mawhVExA0WY/w4XVO+bPYwbYmVIQCg/NY2gvBjudQ4TkprbFKQVUvwj4+AFksD9n eMcUHoJ3YETCuNucLPimAAj/1GXA02+jFifHNTx9/FF2mOT1rYHlrNziH05oIQGbVuLw jaIbnudQF8nAro1DHrjIh3SpkavnTNvbcNR8Sc7uRW5HTObicO+5k8wdHdO5ImjEMBHh sim6P2LLtyELb1BesCdd7zShcMn37zlfW/48udQ4ZhJhDj3CQUlsbfvmRV7qxGeXGqMT ob9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=za6wd3ncbnAMq2d/f/bTKRsc8vOJ+6tp4QpL9Lk6GZk=; b=UbDq8JMSdPP07oF+mMwR24quZI82Q+8p0AG5sJBhXR+zjQulxFiWM75tvpKKF/Ieey Qyf0y8ikz/cd2KKs/WbfcFZDUPdGLcp4vYY27WKuoxEo3mUGj6/O+6rg2Udl/FGmqLLh F2eK2Tlp5jwGRlxAWZa5GWFlLS4+z7JaBk5VivD49PhVRf+bq8Iiha7sXr1dFHJ6xP67 ZHkazTIdsm5/iB1ThEpVFmRIVdkhJqfTiKDQAGpe5fzKjInUwyRHlyTMpNWgyWDbmbgY R0tCJG9mCQ6h/TkDp3kKNjg4ErvyKRL8zVMvYG8PIbT95G3t7jfDQy+YFxWyYF6EFHQK PP0w== 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 n21si19450054pgh.52.2019.04.29.08.20.26; Mon, 29 Apr 2019 08:20:43 -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 S1728430AbfD2PSS (ORCPT + 99 others); Mon, 29 Apr 2019 11:18:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4179 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728253AbfD2PSS (ORCPT ); Mon, 29 Apr 2019 11:18:18 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61FEE3082B69; Mon, 29 Apr 2019 15:18:18 +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 EA4101001DCE; Mon, 29 Apr 2019 15:18:17 +0000 (UTC) From: Prarit Bhargava To: linux-kernel@vger.kernel.org Cc: Prarit Bhargava , Jessica Yu Subject: [PATCH] kernel/module: Reschedule while waiting for modules to finish loading Date: Mon, 29 Apr 2019 11:17:51 -0400 Message-Id: <20190429151751.15424-1-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 29 Apr 2019 15:18:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Heiko, do you want a Signed-off-by or a Reported-by? Either one works for me. P. ----8<---- 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. Reported-by: Heiko Carstens Fixes: linux-next commit f9a75c1d717f ("modules: Only return -EEXIST for modules that have finished loading") Signed-off-by: Prarit Bhargava Cc: Jessica Yu --- 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