Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp576012rdb; Mon, 29 Jan 2024 10:58:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTps3lvs+awN4Q1i+SKHef2vuLtcAzUCBEbk3zAfx23Jcjvmrlc6mcO6VoQQUrF1nWatQQ X-Received: by 2002:a17:90b:364a:b0:290:b29a:5258 with SMTP id nh10-20020a17090b364a00b00290b29a5258mr2582984pjb.29.1706554702511; Mon, 29 Jan 2024 10:58:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706554702; cv=pass; d=google.com; s=arc-20160816; b=N8mX2cO1FR9/tAsSDoPffCRtkO/j7lA65mTeEa9t5HMGKNDa6lrhybacijbr2uRd03 5l705uKUkmDftX6HnSBeHN1wkADJP4P3kelc4jHMX7C6fTPQhdATi18DJ+3qYeE+bAMm zyUBzXAvHsuIoOlV3RC3BGM2/FHu6agt69nKiNyV50KlIvn5iEPBkB/n2S2TZPit3Ust YhWHnR0rhTgfSY0uuMaJ1rQA/sA1DzZFPg0kGFtQvV3n9SqFO6/R4rWHDNYrG/SG6ETV vQMLE2Xs/lOuKneYDh5qOh8mXcaM3hl4YRz7uUd+45U+EweUzADdKOyj6UicEM0CfYHf muNw== ARC-Message-Signature: i=2; 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=Hn8e0rCKXynZRayBOuybeU9OQdp57Kiz//hwQN/PKpo=; fh=AkPWagxRyfwIKENnVxOB4aCuWUkiRwmAch8bSaEduFM=; b=sCiz/SpDXVFTlzu6teRPJZ0uRPTp06odN2kC/Aj1wQFXqKvbSlisguFRfO0IvxdgrX PLxlPOQDnGHbUHG/INK9T/XzMNHljztbNIgT7ERuvLx+lS8vosyXGWnMzSohtCcu4FP0 e1AH0UD0Q9znSMTVC+0Bn7ppxZyKUVU8/NUFF2TL1dK5QfdEjHnEH2DH3R5uvgP+TjAP spf38FAlB39xFa4HCU1NiBvCXhUvFBtbU4EyKVr/frtm9z5LXthb0ycol4BB+FlQcOjb dPg17ltERD18GHUJvApAj48u3oztKhhFwtqxwqnXB0VEhvcfIPeKw7LXIyDHZwPZTih9 opJA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=mO45akmq; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-43239-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43239-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id pf5-20020a17090b1d8500b00290a456e6a7si6265021pjb.59.2024.01.29.10.58.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:58:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43239-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=mO45akmq; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-43239-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43239-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 1886E2890B8 for ; Mon, 29 Jan 2024 17:54:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67AB276C99; Mon, 29 Jan 2024 17:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="mO45akmq" 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 5421D76C87; Mon, 29 Jan 2024 17:54:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706550841; cv=none; b=kt/PicdgIptqiiPy0t7MupyrUoD2Z5pGD+XE/XRUbhGgn/7xV2i3xAcNPZy7XNSJ85zlzkO4bbLd4zqgJZ20EzN/9mbZ0eiA3iPWpqDNz4TRf5x2RHSTdlHcVD3AKACBX1jQKGC6LHs3MC1J9nHlSsBMNIvstByrCpnh/a0P6Nw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706550841; c=relaxed/simple; bh=cFhxzTUGZUjLGXc4jgk26wSlW6J36EcjbQ0FN1zFJdg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gvZuGl1huUr4X1t2BKwV/RiTS+zpUnOEBCQ56z2+cxBl753GPdkGtQwAihhD1ZN5PKyGsFaA9NCuIVOnzw1BuBkVn8TkTvLk+JSUIo/CcX4tlTFdmWgvJ1gBdIppotuJExQh9EZTXacm2hh5GXZCqkiaWWYYoDhbpieuy6DzFYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=mO45akmq; arc=none smtp.client-ip=198.137.202.133 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=Hn8e0rCKXynZRayBOuybeU9OQdp57Kiz//hwQN/PKpo=; b=mO45akmq24ReWpNREFP+ZZolxm 6kiczh5UFoSpioku8eHhnrC7Ifz0bV4A9XEBDHl9Y5PY44arOygIisJ7V4XZyqeM+5mFty6Xl0JRi O5TrKaJHlhGywkR4W+lwXGmEjUEL5bD4hJ+saIlW2ypn499FtnwkI6yoB7+2n5vII2MYSte7CFnZX KY0ToAqSrmq/6JMADBKLophvkugaS/ku8yAb+0KyLT1+uwW2AAoLsOhAjgwL5Y/z9b+Xdt7lWY0z6 zCfQwPlvdLh2WtXw7JiRDOgu6SGr2P383cX4q6aucvdop0hzk437/yzJ4A2C/Y03e7vaTGwhTjCKJ uXiAKr+Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUVpW-0000000DozE-0IZP; Mon, 29 Jan 2024 17:53:58 +0000 Date: Mon, 29 Jan 2024 09:53:58 -0800 From: Luis Chamberlain To: Changbin Du Cc: Andrew Morton , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyi Su Subject: Re: [RESEND PATCH v2] modules: wait do_free_init correctly Message-ID: References: <20240129020304.1981372-1-changbin.du@huawei.com> 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: <20240129020304.1981372-1-changbin.du@huawei.com> Sender: Luis Chamberlain On Mon, Jan 29, 2024 at 10:03:04AM +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 > rcu_barrier() can not ensure that do_free_init has completed. We should > wait it via flush_work(). > > Without this fix, we still could encounter false positive reports in > W+X checking, and rcu synchronization is unnecessary. You didn't answer my question, which should be documented in the commit log. Does this mean we never freed modules init because of this? If so then your commit log should clearly explain that. It should also explain that if true (you have to verify) then it means we were no longer saving the memory we wished to save, and that is important for distributions which do want to save anything on memory. You may want to do a general estimate on how much that means these days on any desktop / server. Luis