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 B728CC433F5 for ; Fri, 5 Nov 2021 17:14:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F4E76120D for ; Fri, 5 Nov 2021 17:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbhKERRR (ORCPT ); Fri, 5 Nov 2021 13:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbhKERRP (ORCPT ); Fri, 5 Nov 2021 13:17:15 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06676C061714 for ; Fri, 5 Nov 2021 10:14:36 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id o29so3821515wms.2 for ; Fri, 05 Nov 2021 10:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=grsecurity.net; s=grsec; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Zv3ABwnUWd2T/SHLWRu++05oJKCkYNE3n6fh4ULeSmw=; b=idSHuTwy4Uk7mPYTHSQxC+MiMEzIGIndfKskDrMAbruy3ClegQCNDa6l+DvIzbSICq p9a6kWPhVxaq4SvJK/8s0qDRe50CuuvcxxC5JABmP6FugBm3KdVbvLsTpJhC0guxJ1LX ZcHXL5f09/B31OEbqyALl7J5723cuzTbyHDlV+tMJMdse6anL/RNzlVgoQ12ASpIcxGW fDLcj10IviIxiUUvovQEpYLfWY2CPRNJ9EMt+46+ZsszChUn9hWEQ894uHm28O6uSw2O ezez9Srcepu+I0F7QolDv9QH26K7HH607YLlki2Vgz/ziiDPLHp/ReGk23DF8jCp0S3I yeMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Zv3ABwnUWd2T/SHLWRu++05oJKCkYNE3n6fh4ULeSmw=; b=QMY/oPj0hrvI+caPMsEsVAHjl0JkbIujSJOsEF0iVJXstQh9M05u9fj2+fe3JCJQ11 4m0kf7qonyQncjuEFEqvTbtR5ihzFOuC8cVFPQSyrC6jROreqEFgr3wsCqj9Ix6Pz+9W SM+nrLV6kThvDjgTmLBXNcUlEis2B3+CFnkAuIQXcQqkzSsDo6vUJpj2t/P77BREMgZT 3PeDAHrAJzgnXyB9YTeVeA7u60zfje/Qzl+qAhtBDyCO0dOrmHDD4p3FgXudsarT4wUz va1jojI+hu9bo35ofu8i/ggO16x1rf/sAXslGOKyb/h0dJNeW7RnJlgkh+qc6RbbumA1 +lBA== X-Gm-Message-State: AOAM531WbIQFTVyR95LVG6TwcyjV8QjobPBHB+N7UiC84JKKIyYoflQR 4cq9JHmdS2ihvru1fyAFFRzvqA== X-Google-Smtp-Source: ABdhPJwl9lJ17OoBtFWDvNaVdLhq+ue5nx2Z0aiGSyfReQQwWbzK0CKtIrinFtL6ZTYo04tLhs4Ryg== X-Received: by 2002:a05:600c:1d28:: with SMTP id l40mr4257963wms.192.1636132474580; Fri, 05 Nov 2021 10:14:34 -0700 (PDT) Received: from ?IPv6:2003:f6:af04:5300:7c00:c62b:b3aa:158b? (p200300f6af0453007c00c62bb3aa158b.dip0.t-ipconnect.de. [2003:f6:af04:5300:7c00:c62b:b3aa:158b]) by smtp.gmail.com with ESMTPSA id m36sm8529706wms.25.2021.11.05.10.14.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Nov 2021 10:14:34 -0700 (PDT) Subject: Re: [PATCH] sched/fair: Prevent dead task groups from regaining cfs_rq's To: Peter Zijlstra Cc: Vincent Guittot , =?UTF-8?Q?Michal_Koutn=c3=bd?= , 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 References: <20211103190613.3595047-1-minipli@grsecurity.net> <8f4ed996-e6e5-75f4-b5fa-dffb7b7da05b@grsecurity.net> <20211105162914.215420-1-minipli@grsecurity.net> From: Mathias Krause Message-ID: Date: Fri, 5 Nov 2021 18:14:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 05.11.21 um 17:58 schrieb Peter Zijlstra: > 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? There is already one and this patch makes use of it for the second RCU GP requirement. Basically, the patch is doing what you request, no? See the new free_fair_sched_group(). Thanks, Mathias