Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp280114pxb; Wed, 3 Nov 2021 04:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJi1JGdsP/JogSWfudVyFguvyCok+OI4Kz5ioR4HWH12CwDLkpp9/Wl+0ePgy8WvTeUyx7 X-Received: by 2002:a05:6402:207c:: with SMTP id bd28mr49321348edb.240.1635938005946; Wed, 03 Nov 2021 04:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635938005; cv=none; d=google.com; s=arc-20160816; b=sDM70yUos0At+KvMVpep7+kOmQ8emkiuxKI6FxRE7dpOTIZ9GGbUTSx4YV7L/wHHrk qXYj62gVg8SVtzckL6fJww6FTqWSPiauQkVXf0GVfKeMZwZWOe8SrLMExW5mXcNBJ8XX ATUEzBdQonui2/hEussPpngRzMhKctUKR0Z621oaG1WhrdGhd7lDR/9K23u0Ik9xLptv lJ4b0zutzKWzIJRM45AMh6aGy3c01j/qoBXV393qYSd0Cvhx6vGU320Yqr2MZlKicHOV e7udJ6t3P/XKgT5KywoQAG2hztLx/CSZzotSl6KCixeKfUXmWpDsOj98O5vPIV3hmDNU twEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AqTFYVPEJHUUFz1K4JpGQHNHu3HXx46Z0gT7uGeWIJk=; b=LI6NwRRGeWmWT1eaa8t0sJ2IbIoHgsJppVAO9+jRc3shrxQ2B5n4V/pYqpXXhwgv2a pYf0PwRpts3yg6R5C+oWp1pTJpGlJscJntUE6cvny3F2EpXLZMPkOGYquF/CrVvzax/g hFpMGQAuuxCPRZcNxlFj8Up93ga9jF/WUV7lAxpjVoE28E8cSAVDsz3hm5bn45O3VPdt KY1BgH0emptQj/2jDedrHAeBlUPkDwn3KqUrNuMrHS3EowjO7ouEkF4iFkGJt9XQr04G 3hDJ4XrICzclhup+wilr5rZV5F0YJTUq9ci4wsn3tgVLI796y/hKziSzvkcbIbqlstc+ fv/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ZnH1ic3V; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si2651315eds.558.2021.11.03.04.13.01; Wed, 03 Nov 2021 04:13:25 -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=@suse.com header.s=susede1 header.b=ZnH1ic3V; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbhKCLNQ (ORCPT + 99 others); Wed, 3 Nov 2021 07:13:16 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:40698 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhKCLNP (ORCPT ); Wed, 3 Nov 2021 07:13:15 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0579D1FD4C; Wed, 3 Nov 2021 11:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1635937838; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AqTFYVPEJHUUFz1K4JpGQHNHu3HXx46Z0gT7uGeWIJk=; b=ZnH1ic3Vv22wURax8liabigAOQ8BTnK37dsrYEsO2i51QuWrVnJtUMKspAbxnmonxIs4B0 o7tOOcNiOR5jpKgg86VytWOKUIx8f0qJSe6802OtGriUEsRNadKn0Ss/kDgvA4zHvHy9Vd E0RVSdyKMPdc7xUzf6MwWFFoKV0cBF4= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D002813CCA; Wed, 3 Nov 2021 11:10:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id t3xHMi1ugmHEKgAAMHmgww (envelope-from ); Wed, 03 Nov 2021 11:10:37 +0000 Date: Wed, 3 Nov 2021 12:10:36 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Mathias Krause Cc: Vincent Guittot , Odin Ugedal , Kevin Tanguy , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel Subject: Re: task_group unthrottling and removal race (was Re: [PATCH] sched/fair: Use rq->lock when checking cfs_rq list) presence Message-ID: <20211103111036.GA10034@blackbody.suse.cz> References: <20211011172236.11223-1-mkoutny@suse.com> <20211013142643.GA48428@blackbody.suse.cz> <20211102160228.GA57072@blackbody.suse.cz> <73b4bddb-335b-1f25-a203-199be546e44a@grsecurity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 03, 2021 at 11:51:12AM +0100, Mathias Krause wrote: > Adding synchronize_rcu() here will ensure all concurrent RCU "readers" > will have finished what they're doing, so we can unlink safely. That > was, apparently, the missing piece. What reader(s) are you referring to here? The list_for_each_entry_rcu(cfs_rq, &cfs_b->throttled_cfs_rq, throttled_list) in distribute_cfs_runtime()? I'm think (not sure) that wouldn't work since the unthrottle_cfs_rq can still be called after this synchronize_rcu() but before free_fair_sched_group(). (But if you considered update_blocked_averages() as the reader(s) and synchronize_rcu() within free_fair_sched_group(), that may ensure UBA won't step on a free'd cfs_rq (+unlinking would need to happen only in free_fair_sched_group() too.)) Michal