lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1DD7BFEDD3147247B1355BEFEFE46652379C3DF117@HQMAIL04.nvidia.com>
Date:	Wed, 9 May 2012 11:55:23 -0700
From:	Diwakar Tundlam <dtundlam@...dia.com>
To:	'Michael Wang' <wangyun@...ux.vnet.ibm.com>
CC:	'Peter Zijlstra' <peterz@...radead.org>,
	'Ingo Molnar' <mingo@...nel.org>,
	'David Rientjes' <rientjes@...gle.com>,
	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
	Peter De Schrijver <pdeschrijver@...dia.com>
Subject: RE: [PATCH] sched: Make nr_uninterruptible count a signed value

>> -       P(nr_uninterruptible);
>> +       P((signed long)nr_uninterruptible);

I thought of it too, but it won't compile because the P macro expands to dereferencing rq->nr_uninterruptible, so with your change, it will show up as rq->(signed long)nr_uninterruptible which is a syntax error.

--Diwakar.

-----Original Message-----
From: Michael Wang [mailto:wangyun@...ux.vnet.ibm.com] 
Sent: Wednesday, May 09, 2012 12:49 AM
To: Diwakar Tundlam
Cc: 'Peter Zijlstra'; 'Ingo Molnar'; 'David Rientjes'; 'linux-kernel@...r.kernel.org'; Peter De Schrijver
Subject: Re: [PATCH] sched: Make nr_uninterruptible count a signed value

On 05/09/2012 06:46 AM, Diwakar Tundlam wrote:

>> No that's right. nr_uninterruptible counts the number of tasks in 
>> uninterruptible sleep, so deactivate_task puts a task to sleep, so we 
>> need to increment the number of sleeping tasks, activate_task wakes a 
>> task up so we need to decrement the number of sleeping tasks.
> 
> Yep, I looked at the code for task_contributes_to_load() and I understand what it is all about.
> The ++ and -- are correct, I see it now.
> 
> On the -ve values, strangely inspite of %Ld in the print statement, in my kernel, I see high unsigned values instead of -ve values for nr_uninterruptible.
> 
> But the sum is always 0, though.
> 
> Maybe it is an artifact of 32-bit machine displaying 64-bit print format.
> An (unsigned long)(-24) promoted to (signed long long) ends up as 4294967272.
> As seen in my output of sched_debug.


This may do some help.

Regards,
Michael Wang
---
 kernel/sched/debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 09acaa1..ab9d53f 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -270,7 +270,7 @@ static void print_cpu(struct seq_file *m, int cpu)
                   rq->load.weight);
        P(nr_switches);
        P(nr_load_updates);
-       P(nr_uninterruptible);
+       P((signed long)nr_uninterruptible);
        PN(next_balance);
        P(curr->pid);
        PN(clock);
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ