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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BC87C77B7F for ; Tue, 16 May 2023 21:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbjEPVl4 (ORCPT ); Tue, 16 May 2023 17:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjEPVlw (ORCPT ); Tue, 16 May 2023 17:41:52 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4910559C4 for ; Tue, 16 May 2023 14:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ymyty6nUWDLHx8cOsNLWM5GIjv/3QYjcXUqTdKPQWGc=; b=M1qZTSAmV5YEKRsZOG9TTXrFYh aHbYyMOg/jR+IUt67hDNUiantahZv4uNWUhEhpCPSuEy1czStKeWKk1bHaHa1ZG9oJLvqeXOMlQm4 8An9ZmCRL3xTsHivUjAcD9oaX2O41obzN99H69yZB3fDjLLffJv4I6lf8c/Ubc/VQ4pCzCOD/6Ume 6CDKK7uKI5QWPNSnyDU5cyxMfF+5G8zt5nea1LLs+PJb2ryKPeevbhBcMbqJx8B0VnfRKR/zKR3WG 95WPSUCdBdukHD1mMLvnSbDbTJCyvCX6SfCal95qd135XZIyIoqnyqZt18c7AfqW/2BO7FEDnQYTU rL0f8jJA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pz2Q2-004aC4-DS; Tue, 16 May 2023 21:41:18 +0000 Date: Tue, 16 May 2023 22:41:18 +0100 From: Matthew Wilcox To: Andrew Morton Cc: Wander Lairson Costa , Oleg Nesterov , "Russell King (Oracle)" , Brian Cain , Michael Ellerman , Stafford Horne , Kefeng Wang , "Liam R. Howlett" , Vlastimil Babka , "Eric W. Biederman" , Andrei Vagin , Peter Zijlstra , "Paul E. McKenney" , Daniel Bristot de Oliveira , Yu Zhao , Alexey Gladkov , Mike Kravetz , Yang Shi , open list , Hu Chunyu , Valentin Schneider , Sebastian Andrzej Siewior , Steven Rostedt , Luis Goncalves Subject: Re: [PATCH v9] kernel/fork: beware of __put_task_struct calling context Message-ID: References: <20230516191441.34377-1-wander@redhat.com> <20230516140555.b150a43517d85b7cad75e7da@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230516140555.b150a43517d85b7cad75e7da@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 16, 2023 at 02:05:55PM -0700, Andrew Morton wrote: > On Tue, 16 May 2023 20:24:04 +0100 Matthew Wilcox wrote: > > > On Tue, May 16, 2023 at 04:14:41PM -0300, Wander Lairson Costa wrote: > > > +void __put_task_struct_rcu_cb(struct rcu_head *rhp) > > > +{ > > > + struct task_struct *task = container_of(rhp, struct task_struct, rcu); > > > + > > > + __put_task_struct(task); > > > +} > > > +EXPORT_SYMBOL_GPL(__put_task_struct_rcu_cb); > > > > Why does this need to be exported when its only caller is within the > > main kernel and cannot possibly be built as a module? > > It's referenced by inlined put_task_struct(), which is called from all > over. Oh, I missed that put_task_struct() was still inlined. Should it be? It seems quite large now. > However I believe the above definition could be inside #ifdef > CONFIG_PREEMPT_RT, to save a scrap of resources?