Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1262221rwd; Tue, 16 May 2023 14:29:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Gzrs+HtjbKQwCcNdruSr7Db8x3TD48Jw8yr/b9zssG7mxwUPyCHk2HTzIjJHY5eXPGC2W X-Received: by 2002:a05:6a00:2d83:b0:643:9ca:3c7d with SMTP id fb3-20020a056a002d8300b0064309ca3c7dmr49943387pfb.4.1684272551942; Tue, 16 May 2023 14:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684272551; cv=none; d=google.com; s=arc-20160816; b=NBNL6ekDxdde0vo2tMP5MmyrWNlmXo4KosCgrjHcK7Pabqhqytl7K+SIexR3XTmAYr oa3m5YY8rwsyKlJW+U9aFUOlllKbdURqRYaZWxnnE3nmHDMtHFFm60eGEPt+y/zlSTXo DN2YtZfO3atQI2IKJz0ALPSdsKoxtgMc8q/Jd06DP48pDibV/ey+dg+FxfLv26+5muUx jbyfet7SmWRoizSbq1pnOKtO9GiM7rmVbw6lRyZafYIan3+XxbWtNrVvt4yXaAiuDIoQ V/SPbOPE/H07Q8xQRdAaCdy5cAszwfBLraT65X+A3mIczH1U1U/j//8Z8nLOS0DHZSkM S/uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=uDRsJbgxFgwbidfCoEZ1CmCV26MZr5zOftWaIkWDqQI=; b=b1YF8t9gtzCog5Y8eiouEMIETYRQlr/jN7XjaMS87RHa9KRZtsPJvTuYd+3seGx3j7 lZtc2SzeNSZp5E5GEI2agrMq4cQScLcfdppRh8UiPzYfG2j3pplDHjy3UL8qATYthESO +VRgLG4bQUX6CsCDwyEdvcGduvGuFKN+Llm0fndDSH/bhoONoWGOIFVxVPDeQ5o1udTw MbytfZmRV/xiD/FBrbg4ZsVl7It1ru5LInOAnqZDuVtaX94W7HVqB9o1ZpfGDo37OBh6 eKyTuwNktkfFhhKgJy8hXiBjv4mGtN74Cmi+Pe/lAM5kwU1lFQ5MhDYIrBCzSpZukn5v XjZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="SPM/7Qhg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m125-20020a625883000000b00641353bc7e3si20552115pfb.373.2023.05.16.14.28.59; Tue, 16 May 2023 14:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="SPM/7Qhg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230296AbjEPVGA (ORCPT + 99 others); Tue, 16 May 2023 17:06:00 -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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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?