From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbcFUVlE (ORCPT ); Tue, 21 Jun 2016 17:41:04 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46453 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109AbcFUVlA (ORCPT ); Tue, 21 Jun 2016 17:41:00 -0400 Date: Tue, 21 Jun 2016 23:10:54 +0200 From: Peter Zijlstra To: Konstantin Khlebnikov Cc: Ingo Molnar , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily Message-ID: <20160621211054.GV30154@twins.programming.kicks-ass.net> References: <146608182119.21870.8439834428248129633.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <146608182119.21870.8439834428248129633.stgit@buzz> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?