From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbbKKJs7 (ORCPT ); Wed, 11 Nov 2015 04:48:59 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:56907 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752375AbbKKJs4 (ORCPT ); Wed, 11 Nov 2015 04:48:56 -0500 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Wed, 11 Nov 2015 18:48:49 +0900 From: Byungchul Park To: Peter Zijlstra 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: <20151111094849.GD7136@byungchulpark-X58A-UD3R> References: <1447231827-1891-1-git-send-email-byungchul.park@lge.com> <20151111092632.GK17308@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151111092632.GK17308@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2015 at 10:26:32AM +0100, Peter Zijlstra wrote: > 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. Then, do you mean it's no problem even if we compare between a vruntime not wrapped yet and another vruntime already wrapped? I really wonder it. > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/