lkml.org 
[lkml]   [2007]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 13/30] cpu alloc: genhd statistics conversion
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/linux/genhd.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-2.6/include/linux/genhd.h
===================================================================
--- linux-2.6.orig/include/linux/genhd.h 2007-11-15 21:18:07.967654575 -0800
+++ linux-2.6/include/linux/genhd.h 2007-11-15 21:25:31.066904143 -0800
@@ -158,21 +158,21 @@ struct disk_attribute {
*/
#ifdef CONFIG_SMP
#define __disk_stat_add(gendiskp, field, addnd) \
- (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd)
+ (THIS_CPU(gendiskp->dkstats)->field += addnd)

#define disk_stat_read(gendiskp, field) \
({ \
typeof(gendiskp->dkstats->field) res = 0; \
int i; \
for_each_possible_cpu(i) \
- res += per_cpu_ptr(gendiskp->dkstats, i)->field; \
+ res += CPU_PTR(gendiskp->dkstats, i)->field; \
res; \
})

static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) {
int i;
for_each_possible_cpu(i)
- memset(per_cpu_ptr(gendiskp->dkstats, i), value,
+ memset(CPU_PTR(gendiskp->dkstats, i), value,
sizeof (struct disk_stats));
}

@@ -209,7 +209,7 @@ static inline void disk_stat_set_all(str
#ifdef CONFIG_SMP
static inline int init_disk_stats(struct gendisk *disk)
{
- disk->dkstats = alloc_percpu(struct disk_stats);
+ disk->dkstats = CPU_ALLOC(struct disk_stats, GFP_KERNEL | __GFP_ZERO);
if (!disk->dkstats)
return 0;
return 1;
@@ -217,7 +217,7 @@ static inline int init_disk_stats(struct

static inline void free_disk_stats(struct gendisk *disk)
{
- free_percpu(disk->dkstats);
+ CPU_FREE(disk->dkstats);
}
#else /* CONFIG_SMP */
static inline int init_disk_stats(struct gendisk *disk)
--
-
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/

\
 
 \ /
  Last update: 2007-11-17 00:19    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site