Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


kobayashi.kk at ncos

Jun 5, 2008, 4:32 PM

Post #1 of 6 (188 views)
Permalink
[PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay

Add members for memory reclaim delay to taskstats,
and accumulate them in __delayacct_add_tsk() .

Signed-off-by: Keika Kobayashi <kobayashi.kk[at]ncos.nec.co.jp>
---
include/linux/taskstats.h | 4 ++++
kernel/delayacct.c | 3 +++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 5d69c07..87aae21 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -81,6 +81,10 @@ struct taskstats {
__u64 swapin_count;
__u64 swapin_delay_total;

+ /* Delay waiting for memory reclaim */
+ __u64 freepages_count;
+ __u64 freepages_delay_total;
+
/* cpu "wall-clock" running time
* On some architectures, value will adjust for cpu time stolen
* from the kernel in involuntary waits due to virtualization.
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index 84b6782..b3179da 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -145,8 +145,11 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
d->blkio_delay_total = (tmp < d->blkio_delay_total) ? 0 : tmp;
tmp = d->swapin_delay_total + tsk->delays->swapin_delay;
d->swapin_delay_total = (tmp < d->swapin_delay_total) ? 0 : tmp;
+ tmp = d->freepages_delay_total + tsk->delays->freepages_delay;
+ d->freepages_delay_total = (tmp < d->freepages_delay_total) ? 0 : tmp;
d->blkio_count += tsk->delays->blkio_count;
d->swapin_count += tsk->delays->swapin_count;
+ d->freepages_count += tsk->delays->freepages_count;
spin_unlock_irqrestore(&tsk->delays->lock, flags);

done:
--
1.5.0.6

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


balbir at linux

Jun 5, 2008, 9:13 PM

Post #2 of 6 (168 views)
Permalink
Re: [PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay [In reply to]

Keika Kobayashi wrote:
> Add members for memory reclaim delay to taskstats,
> and accumulate them in __delayacct_add_tsk() .
>
> Signed-off-by: Keika Kobayashi <kobayashi.kk[at]ncos.nec.co.jp>

Two suggested changes

1. Please add all fields at the end (otherwise we risk breaking compatibility)
2. please also update Documentation/accounting/taskstats-struct.txt

--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


h-shimamoto at ct

Jun 6, 2008, 2:58 PM

Post #3 of 6 (164 views)
Permalink
Re: [PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay [In reply to]

Balbir Singh wrote:
> Keika Kobayashi wrote:
>> Add members for memory reclaim delay to taskstats,
>> and accumulate them in __delayacct_add_tsk() .
>>
>> Signed-off-by: Keika Kobayashi <kobayashi.kk[at]ncos.nec.co.jp>
>
> Two suggested changes
>
> 1. Please add all fields at the end (otherwise we risk breaking compatibility)
> 2. please also update Documentation/accounting/taskstats-struct.txt
>
And update TASKSTATS_VERSION, right?

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


kobayashi.kk at ncos

Jun 6, 2008, 5:24 PM

Post #4 of 6 (162 views)
Permalink
Re: [PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay [In reply to]

Add members for memory reclaim delay to taskstats,
and accumulate them in __delayacct_add_tsk() .

Signed-off-by: Keika Kobayashi <kobayashi.kk[at]ncos.nec.co.jp>
---

Balbir Singh <balbir[at]linux.vnet.ibm.com> wrote:

> Two suggested changes
>
> 1. Please add all fields at the end (otherwise we risk breaking compatibility)
> 2. please also update Documentation/accounting/taskstats-struct.txt
>

Thanks for your suggestion.
Update version is here.

In taskstats-struct.txt, there was not a discription for "Time accounting for SMT machines".
This patch was made after the following patch had been applied.
http://lkml.org/lkml/2008/6/6/436 .

Documentation/accounting/taskstats-struct.txt | 7 +++++++
include/linux/taskstats.h | 6 +++++-
kernel/delayacct.c | 3 +++
3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt
index cd784f4..b988d11 100644
--- a/Documentation/accounting/taskstats-struct.txt
+++ b/Documentation/accounting/taskstats-struct.txt
@@ -26,6 +26,8 @@ There are three different groups of fields in the struct taskstats:

5) Time accounting for SMT machines

+6) Extended delay accounting fields for memory reclaim
+
Future extension should add fields to the end of the taskstats struct, and
should not change the relative position of each field within the struct.

@@ -170,4 +172,9 @@ struct taskstats {
__u64 ac_utimescaled; /* utime scaled on frequency etc */
__u64 ac_stimescaled; /* stime scaled on frequency etc */
__u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
+
+6) Extended delay accounting fields for memory reclaim
+ /* Delay waiting for memory reclaim */
+ __u64 freepages_count;
+ __u64 freepages_delay_total;
}
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 5d69c07..18269e9 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
*/


-#define TASKSTATS_VERSION 6
+#define TASKSTATS_VERSION 7
#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
* in linux/sched.h */

@@ -157,6 +157,10 @@ struct taskstats {
__u64 ac_utimescaled; /* utime scaled on frequency etc */
__u64 ac_stimescaled; /* stime scaled on frequency etc */
__u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
+
+ /* Delay waiting for memory reclaim */
+ __u64 freepages_count;
+ __u64 freepages_delay_total;
};


diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index 84b6782..b3179da 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -145,8 +145,11 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
d->blkio_delay_total = (tmp < d->blkio_delay_total) ? 0 : tmp;
tmp = d->swapin_delay_total + tsk->delays->swapin_delay;
d->swapin_delay_total = (tmp < d->swapin_delay_total) ? 0 : tmp;
+ tmp = d->freepages_delay_total + tsk->delays->freepages_delay;
+ d->freepages_delay_total = (tmp < d->freepages_delay_total) ? 0 : tmp;
d->blkio_count += tsk->delays->blkio_count;
d->swapin_count += tsk->delays->swapin_count;
+ d->freepages_count += tsk->delays->freepages_count;
spin_unlock_irqrestore(&tsk->delays->lock, flags);

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


kosaki.motohiro at jp

Jun 6, 2008, 9:44 PM

Post #5 of 6 (161 views)
Permalink
Re: [PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay [In reply to]

> Add members for memory reclaim delay to taskstats,
> and accumulate them in __delayacct_add_tsk() .
>
> Signed-off-by: Keika Kobayashi <kobayashi.kk[at]ncos.nec.co.jp>
> ---
>
> Balbir Singh <balbir[at]linux.vnet.ibm.com> wrote:
>
> > Two suggested changes
> >
> > 1. Please add all fields at the end (otherwise we risk breaking compatibility)
> > 2. please also update Documentation/accounting/taskstats-struct.txt
> >
>
> Thanks for your suggestion.
> Update version is here.
>
> In taskstats-struct.txt, there was not a discription for "Time accounting for SMT machines".
> This patch was made after the following patch had been applied.
> http://lkml.org/lkml/2008/6/6/436 .

The code of this patch looks good to me.
but this change log isn't so good.

Do you want remain email bare discssion on git log?


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


kobayashi.kk at ncos

Jun 9, 2008, 9:27 AM

Post #6 of 6 (148 views)
Permalink
Re: [PATCH 2/3 v2] per-task-delay-accounting: update taskstats for memory reclaim delay [In reply to]

On Sat, 07 Jun 2008 13:44:07 +0900
KOSAKI Motohiro <kosaki.motohiro[at]jp.fujitsu.com> wrote:

> The code of this patch looks good to me.
> but this change log isn't so good.
>
> Do you want remain email bare discssion on git log?
>

Thanks for your comment.

But I confirmed this patch did not remain
"email bare discssion" on git log.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.