Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753861AbbK0EJ5 (ORCPT ); Thu, 26 Nov 2015 23:09:57 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34984 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753652AbbK0EJy (ORCPT ); Thu, 26 Nov 2015 23:09:54 -0500 From: yalin wang To: mingo@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org Cc: yalin wang Subject: [PATCH] sched: change nr_uninterruptible to be signed Date: Fri, 27 Nov 2015 12:09:44 +0800 Message-Id: <1448597384-28211-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1579 Lines: 46 nr_uninterruptible will be negative during running, this happened when dequeue a TASK_UNINTERRUPTIBLE task from rq1 and then wake up the task and queue it to rq2, then rq2->nr_uninterruptible-- will reuslt in negative value sometimes. Signed-off-by: yalin wang --- kernel/sched/loadavg.c | 2 +- kernel/sched/sched.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c index ef71590..39504c6 100644 --- a/kernel/sched/loadavg.c +++ b/kernel/sched/loadavg.c @@ -83,7 +83,7 @@ long calc_load_fold_active(struct rq *this_rq) long nr_active, delta = 0; nr_active = this_rq->nr_running; - nr_active += (long)this_rq->nr_uninterruptible; + nr_active += this_rq->nr_uninterruptible; if (nr_active != this_rq->calc_load_active) { delta = nr_active - this_rq->calc_load_active; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 84d4879..7b5f67b 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -605,7 +605,7 @@ struct rq { * one CPU and if it got migrated afterwards it may decrease * it on another CPU. Always updated under the runqueue lock: */ - unsigned long nr_uninterruptible; + long nr_uninterruptible; struct task_struct *curr, *idle, *stop; unsigned long next_balance; -- 1.9.1 -- 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/