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 74AACC77B7F for ; Tue, 16 May 2023 21:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230330AbjEPVGB (ORCPT ); Tue, 16 May 2023 17:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjEPVF6 (ORCPT ); Tue, 16 May 2023 17:05:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CB476BF for ; Tue, 16 May 2023 14:05:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 487E763F8F for ; Tue, 16 May 2023 21:05:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBB77C4339E; Tue, 16 May 2023 21:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1684271156; bh=rglh49XttM/A3Yw8/UP+4HALmbmlwvPVy+YWDyVLm/4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SPM/7QhgOGmJhjuPZBF+TZZc41MeUvORho6igaIsZMAbo6BegvYTJ5no4ov7wDn3u DxfUdwcCLFO4ugjQ2RGwTHnhAtUe+UdjJzDPyiklGmnjOMxs1u99BL1Aa2pR+5MxLD OYBYntSdyMgaW8WmaPRRe3G11z/D5wj4NMK8d/js= Date: Tue, 16 May 2023 14:05:55 -0700 From: Andrew Morton To: Matthew Wilcox 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: <20230516140555.b150a43517d85b7cad75e7da@linux-foundation.org> In-Reply-To: References: <20230516191441.34377-1-wander@redhat.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. However I believe the above definition could be inside #ifdef CONFIG_PREEMPT_RT, to save a scrap of resources?