Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1337599rwd; Tue, 16 May 2023 15:55:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qcSQ/UBFCwpZsHnSaZYWIUbPQTKXEmlZEs9ruRNz/zIDnDgwPuokS1Jew9/mD/KmFpdN1 X-Received: by 2002:a17:902:e847:b0:1ac:72ff:9853 with SMTP id t7-20020a170902e84700b001ac72ff9853mr39877200plg.30.1684277750641; Tue, 16 May 2023 15:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684277750; cv=none; d=google.com; s=arc-20160816; b=uClHYaW3TrOByKGxvpGqeod8YYk+gbqelEIgarZGSOahe/4OzliE6pXlduZypsD/Lb yL0cmsUDhfxklKzHW0FjShhEAmqsTqL7u2Ra1i9p9ySsJo0xhXr6Lh/GCIGP0h4RzatH ConXT+hwVnrYbnbMIGHLzjtT+iLTJncdDXk0xsCnS3Of1ml3uoT9LamsMelP9EINjwTD zMIsLTxactRvvShjQFwzFmiGDPEkbBa8YPBxBkhAgxDYehmPTtYCbV0hNyOhShfAns0I zR4jBfUK+rgdg35Uxq2et7+AZaUJML57ad70ccPaU7S1uaUgkR3JvdiCmNVt9FcpPZos usYA== 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=dXPs3WBueDFSsThkmoOYZubCiyIPFyN5PBIctEjpLoM=; b=H29za54PjkxodE1ZBFNTCVhfO4Mti1QEPxzHhb4qQGewjHil5/clTRBdg+02j2g6K7 t4oZiG8Zq9eAyKm1K+h3qs2f27Vr67dcxUC4ij+qh93EU1GN53d9/oh0i77VGUEE0Qb1 SbFURMiw6YN2C/L8zBPJaGLLoAPD3T3arkIeAgpDv4Qlpilb7E/JZBVA3Vghb28i4mx0 w2ArdpIxF3DchHX3ddb0mLGKRT8qH02y2fbD55BDcUQrXWkqhySIfGdxXjJtbg8E5Psc 1qJyc82TXY3ByfGqSQfg08C3j+5DWnZmwKxBgRDFLFVmSvjNA3wK+VcXHUuLcavNUXBm ymyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=b7J7c6Wd; 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 s5-20020a170902ea0500b0019ca54b0f0fsi20405636plg.638.2023.05.16.15.55.36; Tue, 16 May 2023 15:55:50 -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=b7J7c6Wd; 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 S230316AbjEPWuU (ORCPT + 99 others); Tue, 16 May 2023 18:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjEPWuT (ORCPT ); Tue, 16 May 2023 18:50:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1CB26EBB for ; Tue, 16 May 2023 15:50:15 -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 3D5AF6400C for ; Tue, 16 May 2023 22:50:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA396C433EF; Tue, 16 May 2023 22:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1684277414; bh=nwS/+R1Nz36K2RuprOKSZylh8GjG/v200hMwgApQJ3k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=b7J7c6WdL+ItXg9DqLpV1Jsr6fY0rGtXInr7s1fyXhF53Z/mH+yiu1qevDkJ/yrNE NyJFTLxiR6gbZB3HdbRyQ6WNtK4DGnhBr4Phxvxcy4Do3XoTyWl4DBzA4PC11bntgn i3p/YpxfBzxLrWc2xPGDFYhnNIpihOgt+j2FQ9jU= Date: Tue, 16 May 2023 15:50:13 -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: <20230516155013.5c6ec02a8c9deb1e8fc4af8f@linux-foundation.org> In-Reply-To: References: <20230516191441.34377-1-wander@redhat.com> <20230516140555.b150a43517d85b7cad75e7da@linux-foundation.org> 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=-9.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, 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 22:41:18 +0100 Matthew Wilcox wrote: > > Oh, I missed that put_task_struct() was still inlined. Should it be? > It seems quite large now. It's not significantly worse because of this patch. In fact, it's unchanged for non-RT kernels. Possibly put_task_struct() *should* be uninlined, because it made the mistake of using the dang refcount stuff, which never saw a byte which it couldn't consume :( I mean... --- a/fs/open.c~a +++ a/fs/open.c @@ -1572,3 +1572,9 @@ int stream_open(struct inode *inode, str } EXPORT_SYMBOL(stream_open); + +#include +bool foo(refcount_t *r) +{ + return refcount_dec_and_test(r); +} _ is worth 339 bytes of text for an allmodconfig build 67 bytes of text for an allnoconfig build 77 bytes of text for a defconfig build