From patchwork Sat Mar 1 18:18:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 25575 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0FC50206A6 for ; Sat, 1 Mar 2014 18:19:30 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf5601084yha.7 for ; Sat, 01 Mar 2014 10:19:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=ABKa1YTJJ5sDHk1Wr3raNED2i5nTG8otTaqO7rsGkZ4=; b=KJHsstK7xHzjCACjx3HCEkElyzVU7VvLeJMY/TVpClk6QYuKIJQaPscAERAhksq1sI y7EWLS6pGpfhe6oNUkR2eGcEjtV2LEgRXDAfJEXw6JSdTOZo5KQnWWZ8xl1ERi9WKF22 srijN56MzPwrKalBqqsOZeZRu1K6m3XgMTtYPilWfetkTqVUe8gOgPzEYVGHCU98kHyM afc12CcM9GsgwWlnVk71x2A3ydW244M6DOaWgeFNdIp8C8ip/QcHJpwT5o//84J3AF78 /9o+GD9gLoqJZd17FosdOyQZVMfVLbp/gPBcxrqTFyWSwY9iKcwy2G4lAUx4NkTxWq+N qCmQ== X-Gm-Message-State: ALoCoQni7Wnw9jcONzyj4FQmMX785hTaKAyBWjxHwZlqcZ/RTiRGjCajPlkDQeWydErqdBs5tp6w X-Received: by 10.236.132.231 with SMTP id o67mr3767341yhi.15.1393697970439; Sat, 01 Mar 2014 10:19:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.161 with SMTP id d30ls1564384qge.4.gmail; Sat, 01 Mar 2014 10:19:30 -0800 (PST) X-Received: by 10.58.186.132 with SMTP id fk4mr8682149vec.9.1393697970231; Sat, 01 Mar 2014 10:19:30 -0800 (PST) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [2607:f8b0:400c:c01::229]) by mx.google.com with ESMTPS id tr5si1938796vdc.91.2014.03.01.10.19.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 10:19:30 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::229; Received: by mail-ve0-f169.google.com with SMTP id pa12so2181810veb.28 for ; Sat, 01 Mar 2014 10:19:30 -0800 (PST) X-Received: by 10.52.61.133 with SMTP id p5mr18568143vdr.4.1393697970109; Sat, 01 Mar 2014 10:19:30 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp133451vcs; Sat, 1 Mar 2014 10:19:29 -0800 (PST) X-Received: by 10.66.26.81 with SMTP id j17mr10449065pag.87.1393697969103; Sat, 01 Mar 2014 10:19:29 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zo6si6006767pbc.13.2014.03.01.10.19.28; Sat, 01 Mar 2014 10:19:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbaCASSp (ORCPT + 26 others); Sat, 1 Mar 2014 13:18:45 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:55173 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbaCASSn (ORCPT ); Sat, 1 Mar 2014 13:18:43 -0500 Received: by mail-ee0-f46.google.com with SMTP id t10so243765eei.33 for ; Sat, 01 Mar 2014 10:18:42 -0800 (PST) X-Received: by 10.15.42.68 with SMTP id t44mr139195eev.114.1393697922100; Sat, 01 Mar 2014 10:18:42 -0800 (PST) Received: from pedro (ppp-112-198.29-151.libero.it. [151.29.198.112]) by mx.google.com with ESMTPSA id m9sm26427176eeh.3.2014.03.01.10.18.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 10:18:41 -0800 (PST) Date: Sat, 1 Mar 2014 19:18:38 +0100 From: Juri Lelli To: Kirill Tkhai Cc: , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Subject: Re: [PATCH]sched/core: Return possibility to set RT and DL classes back Message-Id: <20140301191838.d15d03112b2598a671dac22c@gmail.com> In-Reply-To: <1393584643.3522.5.camel@tkhai> References: <1393496657.3522.3.camel@tkhai> <1393584643.3522.5.camel@tkhai> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: juri.lelli@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (bad format) header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Fri, 28 Feb 2014 14:50:43 +0400 Kirill Tkhai wrote: > Thomas, have you seen this? > > Nothing works at the moment: > Noticed the same once rebased on tip/master as of today. > now > > 21 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/3 > 16 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/2 > 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1 > 10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0 > > 22 root 20 0 0 0 0 S 0.0 0.0 0:00.00 migration/3 > 17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 migration/2 > 12 root 20 0 0 0 0 S 0.0 0.0 0:00.04 migration/1 > 9 root 20 0 0 0 0 S 0.0 0.0 0:00.20 migration/0 > > with fix > > 21 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/3 > 16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/2 > 11 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1 > 10 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0 > > 22 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3 > 17 root RT 0 0 0 0 S 0.0 0.0 0:00.03 migration/2 > 12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1 > 9 root RT 0 0 0 0 S 0.0 0.0 0:00.24 migration/0 > > В Чт, 27/02/2014 в 14:24 +0400, Kirill Tkhai пишет: > > [PATCH]sched/core: Return possibility to set RT and DL classes back > > > > I found that it's impossible to set RT policy for tasks at the moment. > > > > This is regression after commit [sched: Consider pi boosting in setscheduler()] > > [c365c292d05908c6ea6f32708f331e21033fe71d ] > > Fix that. > > > > Signed-off-by: Kirill Tkhai > > CC: Thomas Gleixner > > CC: Peter Zijlstra > > CC: Ingo Molnar > > --- > > kernel/sched/core.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index 84b23ce..30cf9ad 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -3193,6 +3193,10 @@ static void __setscheduler_params(struct task_struct *p, > > * getparam()/getattr() don't report silly values for !rt tasks. > > */ > > p->rt_priority = attr->sched_priority; > > + > > + p->normal_prio = normal_prio(p); > > + p->prio = rt_mutex_getprio(p); > > + > > set_load_weight(p); > > } > > > > I'd propose what follows, so that we can still use __setscheduler_params() as it is. Regards, - Juri >From 73bae0ad978db6e75f492eea9adff12ec9d6d2a3 Mon Sep 17 00:00:00 2001 From: Juri Lelli Date: Sat, 1 Mar 2014 16:43:30 +0100 Subject: [PATCH] sched/core: restore __setscheduler() behavior Commit c365c29 introduced __setscheduler_params(), that is now used to only store a task's new scheduling parameters in the case it is priority boosted. Before this change, __setscheduler() was in charge of changing tasks normal_prio and prio, and the latter is used to actually perform sched_class change. Unfortunately, the commit above broke this behavior, causing tasks to remain in fair_sched_class. Restore the old behaviour setting normal_prio and prio to the right values after the __setscheduler_params() call. Signed-off-by: Juri Lelli --- kernel/sched/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ee8004c..04ae20d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3206,6 +3206,13 @@ static void __setscheduler(struct rq *rq, struct task_struct *p, { __setscheduler_params(p, attr); + /* + * Since we checked before with rt_mutex_check_prio(), + * we don't have pi waiters or our top waiter has lower + * priority (user space view) than what we got. + */ + p->prio = p->normal_prio = normal_prio(p); + if (dl_prio(p->prio)) p->sched_class = &dl_sched_class; else if (rt_prio(p->prio))