Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp199683rdb; Tue, 19 Dec 2023 13:52:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGe42wRT+7+8T9dxrx9iIhwiClZASFg5Yqq4IIp+7hfH4JHDD/I6uE3a2pnvWfLlyjNZWed X-Received: by 2002:a17:903:455:b0:1d3:86d1:12b4 with SMTP id iw21-20020a170903045500b001d386d112b4mr3924967plb.85.1703022738209; Tue, 19 Dec 2023 13:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703022738; cv=none; d=google.com; s=arc-20160816; b=exLhlttCTHQidQJqlAx18GZ4JP/+e1oJQsJKimG6W4FXeL3Sq+h2hwx1/5SQoPTZ5b Cp1q4reg9kRpy9rS9iKbO2N3D+2wjW0KujYKCgbs2NIk+AnFoWOUe9QufAGgWjgf2fUH c0Zobg+N+h/NRnintwG7m/P2gPwPf7uSGdmuwg7LeGAw8+9xk5iu/V7GVXKD5UdI0EzG +jQOQOBYAD+HMKmmd2/GTJa08Arp7KFJron3I9/ccxdBdyt28gha4+g9q7aVVF1wvYb4 T6Inv+xh63Xt7wHWGTmLaW3sbNzpT91OsWfl9nJgfewUoY8+ERT+jFXcjPG24uL9r9rk gLrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=gVd47evYyjxYsUBmxgwI2kdHq36z+sE1ylaz9D0MCCM=; fh=nnJIFdweB6aY6kNmlxVaa+qgM158aA3KL/cLeThhR4Q=; b=LUyClZpN3YmMwFRil44wLCF19eyoJ/orQRntvBDZSIn1BDboOu0Bhoc9VGd2DEb0e9 ScexsAVIzr4NzfkrRWqm2Kmo7HR+uwihMjkQgq7l57pKvGC2qknzxSwUuXye2QqImlUW W9bFV+roiWvmEyKiBz0ahxWZoI5rSqkYHUytPHyrJNesOZqw9U1nbFxdPxUu1TkawcqW CtUrZCNcm134v1WLLFj54Uag5JyH2tCsz4ZMgmK0Ee1AN/H+NkCJ47IAUZbOsx7ml45J 3JGMldl8l2Tyn8chm8jdtLfYpFuDL6n7+8WPfn5eAEPoaDPdFgV55iLN4iqA/ir/hBkQ kcOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=HDSZgooh; spf=pass (google.com: domain of linux-kernel+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j4-20020a170902da8400b001d0b6ba6109si20843544plx.248.2023.12.19.13.52.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 13:52:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=HDSZgooh; spf=pass (google.com: domain of linux-kernel+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 96C11B24782 for ; Tue, 19 Dec 2023 21:52:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A54B3B797; Tue, 19 Dec 2023 21:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HDSZgooh" X-Original-To: linux-kernel@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F32BC3B786; Tue, 19 Dec 2023 21:52:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gVd47evYyjxYsUBmxgwI2kdHq36z+sE1ylaz9D0MCCM=; b=HDSZgoohkuO0F/vcntn/Pp24jx 53FgXclHwvGi6RQBCc/AICMcLkQG9P/w6jIr2wlQfO/z7QBOdtx3556hPx7HSdCmFSI43UqWtoZ+S +OqpaAgUysNro18l045Qa7HHAvns6WGIjP9JgXTJLgRufqTWG0/3TmPDcC9/nBfo/2owiLx6AkYYc g+EcJS9lErwwCsyIB4sPA9clKtx+mBOIrilZFlfL/AKDL+pnk+lIq+V6XaPRTi6TgWaL30nJHRSG1 zuz3dCbQIEuHjZtSz70iq+Qdf7B3PVoPX5+MDVBPYonZhn8DPTh2mUnsYSmZvYHAKBHyCaMvO0OD9 ZkBB4thQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rFi0R-00FWw8-1k; Tue, 19 Dec 2023 21:52:03 +0000 Date: Tue, 19 Dec 2023 13:52:03 -0800 From: Luis Chamberlain To: Andrew Morton Cc: Changbin Du , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Hui Wang , Xiaoyi Su Subject: Re: [PATCH] modules: wait do_free_init correctly Message-ID: References: <20231219141231.2218215-1-changbin.du@huawei.com> <20231219125151.4a042a259edf3c916580ccfe@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231219125151.4a042a259edf3c916580ccfe@linux-foundation.org> Sender: Luis Chamberlain On Tue, Dec 19, 2023 at 12:51:51PM -0800, Andrew Morton wrote: > On Tue, 19 Dec 2023 22:12:31 +0800 Changbin Du wrote: > > > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > > do_free_init() into a global workqueue instead of call_rcu(). So now > > we should wait it via flush_work(). > > What are the runtime effects of this change? Indeed that's needed given how old this culprit commit is: git describe --contains 1a7b7d922081 v5.2-rc1~192^2~5 Who did this work and for what reason? What triggered this itch? Is it perhaps for an out of tree driver that did something funky on its module exit? As per Documentation/RCU/rcubarrier.rst rcu_barrier will ensure the callbacks complete, so interms of determinism both mechanisms will have waited for the free. It seems we're now just limiting the scope. This could also mean initialization grew used to having RCU calls on init complete at this point in time, even for modules, and so localizing this wait may now also introduce other unexpected behaviour. Luis