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 F3D04C77B7F for ; Tue, 16 May 2023 22:50:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbjEPWuU (ORCPT ); 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 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