Re: [PATCH] SIAL ps.c: Fix wrong access to .counter on non-SMP kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bernhard Walle wrote:
* Dave Anderson <anderson@xxxxxxxxxx> [2008-02-04 15:57]:
http://people.redhat.com/anderson/extensions/ps.c has been updated
with the patch above.

Thanks, I got a private mail from Luc Chouinard about the member()
function which I didn't know. The attached patch is against the ps.c
online and improves the detection.


        Bernhard


No problem -- the updated patch has been applied.

Dave



------------------------------------------------------------------------

---
 ps.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--- a/ps.c
+++ b/ps.c
@@ -127,13 +127,7 @@ int getasattr(task_t *t, int f)
 				return t->mm->rss*4;
 			} else {
 				struct mm_struct *mm=t->mm?t->mm:t->active_mm;
-
-				/*
-				 * on a SMP kernel (with a reasonable amount of NR_CPUS),
-				 * the _anon_rss and _file_rss is a atomic_t, on a UMP kernel
-				 * it's a normal integer
-				 */
-				if (exists("smp_num_cpus") || exists("__per_cpu_offset"))
+				if (member(&mm->_file_rss, "counter"))
 				    return (mm->_file_rss.counter+mm->_anon_rss.counter)*4;
                                 else
 				    return (mm->_file_rss+mm->_anon_rss)*4;


------------------------------------------------------------------------

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux