Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3230456pxb; Fri, 5 Nov 2021 11:59:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXHo3GhHwcNM031JXQnvPg4EeI05U0Yq9uWZaFPq0IOSmI8vG35HAex09Xg31w46+vFOmg X-Received: by 2002:aa7:d48d:: with SMTP id b13mr53848063edr.106.1636138748220; Fri, 05 Nov 2021 11:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636138748; cv=none; d=google.com; s=arc-20160816; b=uWgGVdiELt+BpldOBuifOqNDOrn6UECk0hlZ2FvP4N2+ifZOdbdwuDPh3Ztkv/Q0VI lpcjrTXUtXrxRVt0EE4L+Plvap9NieCPGV3jBYAGpkF3YnOUtXcXYOMgSigIBocDaL9i gAaJD4V1Al3gDPTXFEBwKuXsxKWBoLFVaUgVvPPls7oIWIPw0WgJkCGtxGS/YvGLo3lL 2Lh0r9zRLTraGhV4EQagI0hzIF6KgKm9zWottDQVXibOAgYBCuT+pY/yFHshtkWGtELK 7a1aSljWLpunI/iWncTiMRKS+sxx1Tn9Mk3fiMTCBRsfM0gG9UkPshCsv9Z0O+q5lCxS NLSw== 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=X1Uc0xG1ycwLqEqfHYgzuR37X93BKygFxrIOeSsoh0k=; b=mdYMao1ufavdo6MX42Od//Gj201rtrCb5V7x46Pd5TtioaGTmRmeQhbngi5XhhgFr1 EFq1ChM1uo2UBxsAIIrb8dQVDTUrbiMdqlmOOewj3rneZ/CXJYZx3hWM5MUs6tYUqdER jvOfbuq5hh7UOPXScbeMMQ6Pi3E0ajK9DZxDZT8++xEhc9M3W58igZj1g6xe1jSHzXUj T03QDW3o0OMmxomRnIyqD3apm3OzoaZM37vQ+2GEkCJwwYbZbQd6BG+E8ZbJAhYCy4y0 dRPbJ+mNUi3Ls9T0ZcdRfGMMsfH7WjBpM/ipbWr3iz7PHJ067a0KL7J/wHXSGNMfOO8Y SHmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=K+pXQiH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd27si19931892ejc.554.2021.11.05.11.58.44; Fri, 05 Nov 2021 11:59:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=K+pXQiH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234209AbhKERF3 (ORCPT + 99 others); Fri, 5 Nov 2021 13:05:29 -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?