Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3110787rwi; Sun, 16 Oct 2022 05:32:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LAk1mxzzHw0spfCNCd74KjFIccSVp8SICs4+OO+56eRfvzyFd0QwsIuiP7Xe0s6AoymJM X-Received: by 2002:a17:90a:4607:b0:202:e22d:4892 with SMTP id w7-20020a17090a460700b00202e22d4892mr7842718pjg.220.1665923533084; Sun, 16 Oct 2022 05:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665923533; cv=none; d=google.com; s=arc-20160816; b=gfUeAf9vrbBUXWp+9xgULc6RmCsMNMLLB5h+Ih0j4guSbOe+Fn1x1ozEOJUTLTnyxO 7ERz95msSBX/Y2Kuk5aDKKULfXB4L865J0AUoVkIaRGO62dIb2jObMqA40kcuEWyPD1i aExYrGph4odj+P3D4XDNLQBgNAAeQh8bkK1vNdlrKkhhaEzooom6lxOFhSCymCArhNNz KF9mvvzBrAE5/QPMxftJU6O3zE42ED0j51ml9h+SlVaAYjco8N1qiOPjlmmN1r7r1z5V ng6iE7paCaCIHizOK951WJlOueuoO78I/+LAVRtZKZ+Ogf+eX6la9HPP0VVV1P8+XdpY TyBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fb+yTSMK3jSZs82B8z4U15J58ZeLRAv+ql0OMM3ibe0=; b=G0yJaDVUVlod6AU94RiZER6Y2D59Aqlm8h+zRi82eYm8SujQVD9Vru/eNrkpyP6jPX Y0CbNpbkVGyDwAEdxkvrizFpHWYVLqRU68UUWlCBchl3UdD/+RYREFoC62Vyab9lt55S 6cSzGbLqB6uFWhvgWhdazWBmk8IA/1HIUQ6zQ6WbfG+MbNNYNt4N47mid+wc7liutor6 UOzhlz/u1MPO0/ZYf0mOg9lEP+ZNtgbuuri6r8l28+1QyKAKnvYsGdQ7vzFQsmdEPoSd Z47pd30hGpmscKUYr58lNaIyAd+q373r+SccV8sb35ISZAwf3G1Mo2rh30eqOWnfaOxd hB3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=dWNXiW4x; 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 h23-20020a17090ac39700b00205ee3e845bsi7672353pjt.116.2022.10.16.05.31.59; Sun, 16 Oct 2022 05:32:13 -0700 (PDT) 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=susede1 header.b=dWNXiW4x; 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 S229782AbiJPMbV (ORCPT + 99 others); Sun, 16 Oct 2022 08:31:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbiJPMbS (ORCPT ); Sun, 16 Oct 2022 08:31:18 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B010331DC2; Sun, 16 Oct 2022 05:31:17 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 65BAA33A43; Sun, 16 Oct 2022 12:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1665923476; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fb+yTSMK3jSZs82B8z4U15J58ZeLRAv+ql0OMM3ibe0=; b=dWNXiW4xhEUBvjoCNF1MGYqLIjJ8eRdtHvra0XKja8by17o1yRyDmBjpVeEJ2nGOKPXXca 5+z/V6wdRRnju3MucKRNIHmf+PNHch7qZsJxTjVdDSm1P7kcFnkNEq/4U4ZyqQH6aPiSpD k57gbxuBI50O89ItIbXQujOIucMyOuM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 40A6113A36; Sun, 16 Oct 2022 12:31:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6CvJDpT5S2MyMAAAMHmgww (envelope-from ); Sun, 16 Oct 2022 12:31:16 +0000 From: Petr Pavlu To: mcgrof@kernel.org Cc: pmladek@suse.com, david@redhat.com, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Pavlu Subject: [PATCH v3 1/4] module: Correct wake up of module_wq Date: Sun, 16 Oct 2022 14:30:28 +0200 Message-Id: <20221016123031.3963-2-petr.pavlu@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221016123031.3963-1-petr.pavlu@suse.com> References: <20221016123031.3963-1-petr.pavlu@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, 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 The module_wq wait queue has only non-exclusive waiters and all waits are interruptible, therefore for consistency use wake_up_interruptible() to wake its waiters. Suggested-by: Petr Mladek Reviewed-by: Petr Mladek Signed-off-by: Petr Pavlu --- kernel/module/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index d02d39c7174e..a12e177ea81f 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -764,7 +764,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, free_module(mod); /* someone could wait for the module in add_unformed_module() */ - wake_up_all(&module_wq); + wake_up_interruptible(&module_wq); return 0; out: mutex_unlock(&module_mutex); @@ -2522,7 +2522,7 @@ static noinline int do_init_module(struct module *mod) schedule_work(&init_free_wq); mutex_unlock(&module_mutex); - wake_up_all(&module_wq); + wake_up_interruptible(&module_wq); return 0; @@ -2538,7 +2538,7 @@ static noinline int do_init_module(struct module *mod) klp_module_going(mod); ftrace_release_mod(mod); free_module(mod); - wake_up_all(&module_wq); + wake_up_interruptible(&module_wq); return ret; } @@ -2879,7 +2879,7 @@ static int load_module(struct load_info *info, const char __user *uargs, /* Unlink carefully: kallsyms could be walking list. */ list_del_rcu(&mod->list); mod_tree_remove(mod); - wake_up_all(&module_wq); + wake_up_interruptible(&module_wq); /* Wait for RCU-sched synchronizing before releasing mod->list. */ synchronize_rcu(); mutex_unlock(&module_mutex); -- 2.35.3