From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751504AbcFVIL1 (ORCPT ); Wed, 22 Jun 2016 04:11:27 -0400 Received: from forward-corp1m.cmail.yandex.net ([5.255.216.100]:33892 "EHLO forward-corp1m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbcFVIK5 (ORCPT ); Wed, 22 Jun 2016 04:10:57 -0400 Authentication-Results: smtpcorp1m.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily To: Peter Zijlstra References: <146608182119.21870.8439834428248129633.stgit@buzz> <20160621211054.GV30154@twins.programming.kicks-ass.net> Cc: Ingo Molnar , linux-kernel@vger.kernel.org, stable@vger.kernel.org From: Konstantin Khlebnikov Message-ID: <576A4806.3090701@yandex-team.ru> Date: Wed, 22 Jun 2016 11:10:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160621211054.GV30154@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.06.2016 00:10, Peter Zijlstra wrote: > On Thu, Jun 16, 2016 at 03:57:01PM +0300, Konstantin Khlebnikov wrote: >> Cgroup created inside throttled group must inherit current throttle_count. >> Broken throttle_count allows to nominate throttled entries as a next buddy, >> later this leads to null pointer dereference in pick_next_task_fair(). >> >> This patch initialize cfs_rq->throttle_count at first enqueue: laziness >> allows to skip locking all rq at group creation. Lazy approach also allows >> to skip full sub-tree scan at throttling hierarchy (not in this patch). > > You're talking about taking rq->lock in alloc_fair_sched_group(), right? > > We're about to go do that anyway... But I suppose for backports this > makes sense. Doing it at creation time also avoids the issues Ben > raised, right? Yes, all will be fine. But for 8192-cores this will be disaster =) throttle_count must be initialized after linking tg into lists. obviously. -- Konstantin