Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3144414pxb; Fri, 5 Nov 2021 10:27:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGhggDJ4khoo/FWJH5pov4ocJN3iaH7b0htagICSPUJ3Hq17sSkQEK+BCXB63xvUMRUeuU X-Received: by 2002:a17:907:1c97:: with SMTP id nb23mr72226207ejc.488.1636133276750; Fri, 05 Nov 2021 10:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636133276; cv=none; d=google.com; s=arc-20160816; b=ABDJLvntImMkuNatiJKh9jkqXlVN6qhyZ9kwDnqJ6bf4YYf9wzlD8z5kssQlG3pLIT z0IOA1ggvhOSXkc5zhA/dnnUqNQ+6PoOuB9BfuZJG0Q3OUVNcL5vr+7n3PtCuUa47l9s XZYwAqdJdnRJZsvgXo+FdYJHnsL0imgC4hKnr6Ls5eNnIRfAaGr19rI3XX3Up7+Q0mnw lCpiFVO2bnFKMFHUPxIjMY6eKOV5+BizPwRCS4xRg087d9Oh70cLkUgwVGcDw/3TUZj3 /J1xA+6GozxHvZkMv+IMPbnQQiuBuLtY8xA3FIcvtehLjrBwL5QO6HBjkpQ+LgbXGDif 2l2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Zv3ABwnUWd2T/SHLWRu++05oJKCkYNE3n6fh4ULeSmw=; b=URU42v3Vm+W/Z3ZsSYxpVUGFii9qiZvXE7immSSYJQWrD2lULbrpffF3VMcjCGh1pi wbc5QqHYcxKwjbA0tXhxmD47PqyMqBbAcq0+pD2KUAGuqi5ErsYgTgprug6/qEHkBY2a 7l4E5Tmmp54oK1BXN/eO4xG4PePjmmI44BCKheVcEOc0pSb3eip7FjOOmPQbOTWG0UbK viuNUHkVkGPVrYwKAN6JkgIi18F1HahWynOCbgWiS+7HIEMA9jtQvrwi2Jl659wMVDDH j08ZOI3josd8QcxacbJah4medsKuVL0m8+MesQhCa5xbpVXNdIY4LpJWRgA9AiFPIPOH VwNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@grsecurity.net header.s=grsec header.b=idSHuTwy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=grsecurity.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn4si16496980ejc.45.2021.11.05.10.27.30; Fri, 05 Nov 2021 10:27:56 -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=@grsecurity.net header.s=grsec header.b=idSHuTwy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=grsecurity.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231689AbhKERRQ (ORCPT + 99 others); Fri, 5 Nov 2021 13:17:16 -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-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