Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1291731rwd; Tue, 16 May 2023 15:02:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LHQT6U0Iq1Sk/o/WaVmEAr6QiZ/wnkExy7nMMu5+FPYIz7hq5CWsCiVsTsKuIMgdU0WAs X-Received: by 2002:a17:90a:8004:b0:24e:29ed:af07 with SMTP id b4-20020a17090a800400b0024e29edaf07mr37716019pjn.31.1684274579509; Tue, 16 May 2023 15:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684274579; cv=none; d=google.com; s=arc-20160816; b=CjAOEv8SrpQ21AAgPOfZDQ8G5eTMqlYRge8sYYtjOT/0zS6KhSk3cX+nUAAiHhwafi ZTMlrMj0hXkYbojFrx7XJ47MF1LRY9e5nAO0SMDeYnIXE44pVhKZ8YzoA9ZkRU0o5K2b 4oDszNhr77NdzWoHkd3hxSr1uwwjM+7S4m0rCZsPnEfrPnJFGsGstcWdFgyYgHHYMedx wbELNnc0j2bqkU9nYJu9lmpwf3jBUTNc6TcmIhv8erkij481I2dgKH1VCT/HzwKZi035 8TUCLQ/9MdBJ4A8t+4VOmfuX/n/IkGNec5/siFFuadnTVPekB3UwTTqk5DKUuKCNVbmP YHQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ymyty6nUWDLHx8cOsNLWM5GIjv/3QYjcXUqTdKPQWGc=; b=QmWxNX9D99GE6Y+t759v6q2C4m0wxmgIrjgDagD2PenVQUrnMx0EQbQUmi3r45iPHu j9gB2qVlokDhxf2hckXgErHoOB8mENFqWc0qEtqIYAcgJmZHX4+B1gKxwGwr4rUAjEwB AWeZh22jpPj4GNKyTU27kuiX4LplcpgzDokUtUIDIolYBbXF+0Y8HFQzhqsGh/HQKq+0 VXme+Wd2z/NjM4WdEsEFggjmQWUeBaOn88/Z59gzi+GZT4n9Gi2lSznVcSebCsgXwd0D e7vAXOIHNp8N5n5ELdoVySrekjonFEs9X6NdulNIDeCNJ7hwn9Z+xQlM7Z7QKxUsaTNu S3ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=M1qZTSAm; 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 i6-20020a633c46000000b0053427b6841dsi4891598pgn.337.2023.05.16.15.02.47; Tue, 16 May 2023 15:02:59 -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=@infradead.org header.s=casper.20170209 header.b=M1qZTSAm; 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 S229709AbjEPVlz (ORCPT + 99 others); Tue, 16 May 2023 17:41:55 -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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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, 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?