From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49C88C433DB for ; Fri, 29 Jan 2021 05:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13BDA64DFF for ; Fri, 29 Jan 2021 05:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbhA2FLA (ORCPT ); Fri, 29 Jan 2021 00:11:00 -0500 Received: from verein.lst.de ([213.95.11.211]:59972 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbhA2FK7 (ORCPT ); Fri, 29 Jan 2021 00:10:59 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 9FA1568AFE; Fri, 29 Jan 2021 06:10:12 +0100 (CET) Date: Fri, 29 Jan 2021 06:10:12 +0100 From: Christoph Hellwig To: Thiago Jung Bauermann Cc: Christoph Hellwig , Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Michal Marek , linux-kbuild@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 04/13] module: use RCU to synchronize find_module Message-ID: <20210129051012.GA2053@lst.de> References: <20210128181421.2279-1-hch@lst.de> <20210128181421.2279-5-hch@lst.de> <874kj023bj.fsf@manicouagan.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874kj023bj.fsf@manicouagan.localdomain> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote: > > struct module *find_module(const char *name) > > { > > - module_assert_mutex(); > > Does it make sense to replace the assert above with the warn below (untested)? > > RCU_LOCKDEP_WARN(rcu_read_lock_sched_held()); One caller actually holds module_mutex still. And find_module_all, which implements the actual logic already asserts that either module_mutex is held or rcu_read_lock, so I don't tink we need an extra one here.