From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752077AbbKKJ0o (ORCPT ); Wed, 11 Nov 2015 04:26:44 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:36113 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbbKKJ0n (ORCPT ); Wed, 11 Nov 2015 04:26:43 -0500 Date: Wed, 11 Nov 2015 10:26:32 +0100 From: Peter Zijlstra To: byungchul.park@lge.com Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, efault@gmx.de, tglx@linutronix.de, yuyang.du@intel.com, pjt@google.com Subject: Re: [PATCH] sched: prevent getting too much vruntime Message-ID: <20151111092632.GK17308@twins.programming.kicks-ass.net> References: <1447231827-1891-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447231827-1891-1-git-send-email-byungchul.park@lge.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2015 at 05:50:27PM +0900, byungchul.park@lge.com wrote: I've not actually read anything; my brain isn't working right today. > +static inline void vruntime_unnormalize(struct cfs_rq *cfs_rq, struct sched_entity *se) > +{ > + se->vruntime += cfs_rq->min_vruntime; > + if (unlikely((s64)se->vruntime < 0)) > + se->vruntime = 0; > +} But this is broken. This simply _cannot_ be right. vruntime very much needs to wrap in u64 space. While regular time in ns takes some 584 year to wrap, vruntime is scaled. The fastest vruntime is 2/1024 or 512 times faster than normal time. Making it take just over a year to wrap around. This will happen.