Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp68244rdb; Wed, 20 Dec 2023 06:32:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3/j1Y/Dfu5CarrZCAQEw1GBDkn4fuzdxb6iykgS2lvfws7zBtDBGuLWnMP2uONm5PbeG+ X-Received: by 2002:a17:903:2806:b0:1d3:9f4b:fdb5 with SMTP id kp6-20020a170903280600b001d39f4bfdb5mr7099932plb.58.1703082768447; Wed, 20 Dec 2023 06:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703082768; cv=none; d=google.com; s=arc-20160816; b=Q/EOhPFwBm+3acYzEXHHqu46jL4eLtI3VetxnmT7WpExVBkySgGEkXxrdcBSUtUB/s Jwi8M2g6+1AVS6qsxrZPRnbPzafXB8vIHZFvjbtdP0wqJe/fxuBwLgI9Bt5LwEJm9Dbb +6vq3sSFsW9sun8/mWP7r3iWHBUXoCS7EzVYIe1fK8vmr2JuPkQkDA49bjkubBgh5xGX B6udiSOUWc8e8F7mjeVQSCBEasRH0QtbUAm6fyuTLwaHCG0KIhJCJsFth5yOvJhn9cbE oqOVEtC0TOG8L7dZgze5Xe/mp1QXsBsJTYF2pdxFpvT3djQqvVn4mecRO8fcZHGEPSq9 sFFQ== 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=VNHZHPVNhEEveJLtUV0KuZwFmyIaK/A3vrG6c+yO65g=; fh=y15yaIp7t9c9J9+lodLF9CR48nWjaBSH0tjeBJDjuns=; b=glzM/QVhPY5PdGMsP/54T0lBxl8C0iYNjk+zc41pgh151VCaRrFH6QzbqhgCqqtlyu APZjGahEuhY7g1nzhUiEqJzKizMPuMei7O3JuiNijq0uq4GSmn0JTeBTw2FXPO2qZNG7 SJgI+nNloffU7UBzOur+jpcsEXxCUe7PPQuZfciCXJ2VM0r/ex3yJO2moQWczedededL fXjNYJLBCuDJ4gfQKwiYCvBnak3EQrYxlv49YBGuRzFAEVMp+cICI7Wypq5TsOdIZ9KT lmcL8FBIlTDZOL8rPCkjKsKr9WEkujXMJ9mMDMBUShShDlqzP0ZYYHmIQUVJFdWhpWW+ nB6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fxU8N4Yf; spf=pass (google.com: domain of linux-kernel+bounces-7063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7063-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jh4-20020a170903328400b001d3ed1548b4si1451389plb.476.2023.12.20.06.32.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:32:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=fxU8N4Yf; spf=pass (google.com: domain of linux-kernel+bounces-7063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7063-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6D3FF2856FA for ; Wed, 20 Dec 2023 14:32:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 731063A280; Wed, 20 Dec 2023 14:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fxU8N4Yf" 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 4CE9A39849; Wed, 20 Dec 2023 14:32:41 +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=VNHZHPVNhEEveJLtUV0KuZwFmyIaK/A3vrG6c+yO65g=; b=fxU8N4YfOAZ3LkTlOSH03ox0NS mMHOTduh9EOTBCxgSmvCW8zTi6D3Cr731pTfRjbHNxSrleCuAj+GM+E8VdqOmL4VoiM9RfA9QYTIn OdbogdzY0AKRbZiwiU+/IJHFzE2bFb9fOH3EU5J1hUo4xWWSSrUrDthtWbDtZhuN9XLjJNvdyfh9/ IN/D41s4nEzli2hlxSHoMyJpy4xXen+/kHuiP90dxDbbxeij2gtkDwPJvq9R8IPBQGjm0mCuNSYAG ur0bmnFwOsOPWrwQaiGYQM831XA2+6Vcy6rx5f+0THUW1uCu5WYIo4NH7jTkoHCgxG31oGHDi7t7C oiMlRVkw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1rFxcl-0005wK-1J; Wed, 20 Dec 2023 14:32:39 +0000 Date: Wed, 20 Dec 2023 06:32:39 -0800 From: Luis Chamberlain To: Changbin Du Cc: Andrew Morton , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Hui Wang , Xiaoyi Su , Jeffrey Hugo Subject: Re: [PATCH] modules: wait do_free_init correctly Message-ID: References: <20231219141231.2218215-1-changbin.du@huawei.com> <20231219125151.4a042a259edf3c916580ccfe@linux-foundation.org> <20231220052751.3zcnsnvjk5vf5t7j@M910t> 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: <20231220052751.3zcnsnvjk5vf5t7j@M910t> Sender: Luis Chamberlain On Wed, Dec 20, 2023 at 01:27:51PM +0800, Changbin Du wrote: > On Tue, Dec 19, 2023 at 01:52:03PM -0800, Luis Chamberlain wrote: > > 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? > > > Seems the waiting was introduced by commit ae646f0b9ca ("init: fix false positives > in W+X checking"). > > As what I have observed, mark_readonly() is only invoked by the first user mode > thread function kernel_init(), which is before userspace /init. So is it real > possible we have loaded modules at this point? Are you saying we don't free any module inits at all then? I asked a lot of questions and your answers seem slim. How did you find this? What actual impact does this have without the patch? The commit must document this. Luis