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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89DEAC433F5 for ; Fri, 5 Nov 2021 17:02:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6375F611EF for ; Fri, 5 Nov 2021 17:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234214AbhKERFa (ORCPT ); Fri, 5 Nov 2021 13:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbhKERF2 (ORCPT ); Fri, 5 Nov 2021 13:05:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF6F2C061714 for ; Fri, 5 Nov 2021 10:02:48 -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=X1Uc0xG1ycwLqEqfHYgzuR37X93BKygFxrIOeSsoh0k=; b=K+pXQiH0veWQE9+dUByB6VuuLs HlhjZHPU6F1j7yyg6abyUqckyhns2U/CxNYMUAvj0F8kD3Sg9G8ZDmaQBNpK3mYPt3jUC9QbeZd58 2xkVye7H1iodhtIVjxC9lgRTvJfgQKpv1jiLDVgke+fc523BE6XMkj6wU/nsO47DtLcdq5u/JGn8R 32pbUIX+5VNzZbA+89hsRaPfIH9hLFYO6UUISsLX/MvciAe4zD2Z0nn8bc7Q1MXdSyr/F4j0VHL2L UesVVYUfmDCoRBM+HNEW1Mmfobr6vVX4wzqK0UDOhbPebT1UJz0AIctfp7ISYPGtx9QCUSAbp7ZJJ YvEacANw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mj2XV-006gyQ-Ui; Fri, 05 Nov 2021 16:58:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5E2B23000DD; Fri, 5 Nov 2021 17:58:03 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1F842302B9809; Fri, 5 Nov 2021 17:58:03 +0100 (CET) Date: Fri, 5 Nov 2021 17:58:03 +0100 From: Peter Zijlstra To: Mathias Krause Cc: Vincent Guittot , Michal =?iso-8859-1?Q?Koutn=FD?= , Benjamin Segall , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Odin Ugedal , Kevin Tanguy , Brad Spengler Subject: Re: [PATCH] sched/fair: Prevent dead task groups from regaining cfs_rq's Message-ID: References: <20211103190613.3595047-1-minipli@grsecurity.net> <8f4ed996-e6e5-75f4-b5fa-dffb7b7da05b@grsecurity.net> <20211105162914.215420-1-minipli@grsecurity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211105162914.215420-1-minipli@grsecurity.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 05, 2021 at 05:29:14PM +0100, Mathias Krause wrote: > > Looks like it needs to be the kfree_rcu() one in this case. I'll prepare > > a patch. > > Testing the below patch right now. Looking good so far. Will prepare a > proper patch later, if we all can agree that this covers all cases. > > But the basic idea is to defer the kfree()'s to after the next RCU GP, > which also means we need to free the tg object itself later. Slightly > ugly. :/ Can't we add an rcu_head to struct task_group and simply call_rcu() the thing with a free function?