[PATCH 7/8] pseries: phyp dump: Tracking memory range freed.
This patch tracks the size freed. For now it does a simple rudimentary calculation of the ranges freed. The idea is to keep it simple at the external shell script level and send in large chunks for now. Signed-off-by: Manish Ahuja [EMAIL PROTECTED] --- arch/powerpc/platforms/pseries/phyp_dump.c | 35 + 1 file changed, 35 insertions(+) Index: 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c === --- 2.6.25-rc1.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-03-21 22:14:00.0 -0500 +++ 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c 2008-03-21 22:14:05.0 -0500 @@ -261,6 +261,39 @@ static void release_memory_range(unsigne } } +/** + * track_freed_range -- Counts the range being freed. + * Once the counter goes to zero, it re-registers dump for + * future use. + */ +static void +track_freed_range(unsigned long addr, unsigned long length) +{ + static unsigned long scratch_area_size, reserved_area_size; + + if (addr phyp_dump_info-init_reserve_start) + return; + + if ((addr = phyp_dump_info-init_reserve_start) + (addr = phyp_dump_info-init_reserve_start + +phyp_dump_info-init_reserve_size)) + reserved_area_size += length; + + if ((addr = phyp_dump_info-reserved_scratch_addr) + (addr = phyp_dump_info-reserved_scratch_addr + +phyp_dump_info-reserved_scratch_size)) + scratch_area_size += length; + + if ((reserved_area_size == phyp_dump_info-init_reserve_size) + (scratch_area_size == phyp_dump_info-reserved_scratch_size)) { + + invalidate_last_dump(phdr, + phyp_dump_info-reserved_scratch_addr); + register_dump_area(phdr, + phyp_dump_info-reserved_scratch_addr); + } +} + /* - */ /** * sysfs_release_region -- sysfs interface to release memory range. @@ -285,6 +318,8 @@ static ssize_t store_release_region(stru if (ret != 2) return -EINVAL; + track_freed_range(start_addr, length); + /* Range-check - don't free any reserved memory that * wasn't reserved for phyp-dump */ if (start_addr phyp_dump_info-init_reserve_start) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 7/8] pseries: phyp dump: Tracking memory range freed.
This patch tracks the size freed. For now it does a simple rudimentary calculation of the ranges freed. The idea is to keep it simple at the external shell script level and send in large chunks for now. Signed-off-by: Manish Ahuja [EMAIL PROTECTED] - --- arch/powerpc/platforms/pseries/phyp_dump.c | 35 + 1 file changed, 35 insertions(+) Index: 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c === --- 2.6.25-rc1.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-02-28 23:36:47.0 -0600 +++ 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c 2008-02-28 23:36:49.0 -0600 @@ -262,6 +262,39 @@ void release_memory_range(unsigned long } } +/** + * track_freed_range -- Counts the range being freed. + * Once the counter goes to zero, it re-registers dump for + * future use. + */ +static void +track_freed_range(unsigned long addr, unsigned long length) +{ + static unsigned long scratch_area_size, reserved_area_size; + + if (addr phyp_dump_info-init_reserve_start) + return; + + if ((addr = phyp_dump_info-init_reserve_start) + (addr = phyp_dump_info-init_reserve_start + +phyp_dump_info-init_reserve_size)) + reserved_area_size += length; + + if ((addr = phyp_dump_info-reserved_scratch_addr) + (addr = phyp_dump_info-reserved_scratch_addr + +phyp_dump_info-reserved_scratch_size)) + scratch_area_size += length; + + if ((reserved_area_size == phyp_dump_info-init_reserve_size) + (scratch_area_size == phyp_dump_info-reserved_scratch_size)) { + + invalidate_last_dump(phdr, + phyp_dump_info-reserved_scratch_addr); + register_dump_area(phdr, + phyp_dump_info-reserved_scratch_addr); + } +} + /* - */ /** * sysfs_release_region -- sysfs interface to release memory range. @@ -286,6 +319,8 @@ static ssize_t store_release_region(stru if (ret != 2) return -EINVAL; + track_freed_range(start_addr, length); + /* Range-check - don't free any reserved memory that * wasn't reserved for phyp-dump */ if (start_addr phyp_dump_info-init_reserve_start) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 7/8] pseries: phyp dump: Tracking memory range freed.
This patch tracks the size freed. For now it does a simple rudimentary calculation of the ranges freed. The idea is to keep it simple at the external shell script level and send in large chunks for now. Signed-off-by: Manish Ahuja [EMAIL PROTECTED] - --- arch/powerpc/platforms/pseries/phyp_dump.c | 35 + 1 file changed, 35 insertions(+) Index: 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c === --- 2.6.25-rc1.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-02-18 03:31:22.0 -0600 +++ 2.6.25-rc1/arch/powerpc/platforms/pseries/phyp_dump.c 2008-02-18 03:31:30.0 -0600 @@ -260,6 +260,39 @@ void release_memory_range(unsigned long } } +/** + * track_freed_range -- Counts the range being freed. + * Once the counter goes to zero, it re-registers dump for + * future use. + */ +static void +track_freed_range(unsigned long addr, unsigned long length) +{ + static unsigned long scratch_area_size, reserved_area_size; + + if (addr phyp_dump_info-init_reserve_start) + return; + + if ((addr = phyp_dump_info-init_reserve_start) + (addr = phyp_dump_info-init_reserve_start + +phyp_dump_info-init_reserve_size)) + reserved_area_size += length; + + if ((addr = phyp_dump_info-reserved_scratch_addr) + (addr = phyp_dump_info-reserved_scratch_addr + +phyp_dump_info-reserved_scratch_size)) + scratch_area_size += length; + + if ((reserved_area_size == phyp_dump_info-init_reserve_size) + (scratch_area_size == phyp_dump_info-reserved_scratch_size)) { + + invalidate_last_dump(phdr, + phyp_dump_info-reserved_scratch_addr); + register_dump_area(phdr, + phyp_dump_info-reserved_scratch_addr); + } +} + /* - */ /** * sysfs_release_region -- sysfs interface to release memory range. @@ -284,6 +317,8 @@ static ssize_t store_release_region(stru if (ret != 2) return -EINVAL; + track_freed_range(start_addr, length); + /* Range-check - don't free any reserved memory that * wasn't reserved for phyp-dump */ if (start_addr phyp_dump_info-init_reserve_start) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 7/8] pseries: phyp dump: Tracking memory range freed.
This patch tracks the size freed. For now it does a simple rudimentary calculation of the ranges freed. The idea is to keep it simple at the external shell script level and send in large chunks for now. Signed-off-by: Manish Ahuja [EMAIL PROTECTED] - --- arch/powerpc/platforms/pseries/phyp_dump.c | 35 + 1 file changed, 35 insertions(+) Index: 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c === --- 2.6.24-rc5.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-02-12 06:13:17.0 -0600 +++ 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c 2008-02-12 06:13:21.0 -0600 @@ -259,6 +259,39 @@ void release_memory_range(unsigned long } } +/** + * track_freed_range -- Counts the range being freed. + * Once the counter goes to zero, it re-registers dump for + * future use. + */ +static void +track_freed_range(unsigned long addr, unsigned long length) +{ + static unsigned long scratch_area_size, reserved_area_size; + + if (addr phyp_dump_info-init_reserve_start) + return; + + if ((addr = phyp_dump_info-init_reserve_start) + (addr = phyp_dump_info-init_reserve_start + +phyp_dump_info-init_reserve_size)) + reserved_area_size += length; + + if ((addr = phyp_dump_info-reserved_scratch_addr) + (addr = phyp_dump_info-reserved_scratch_addr + +phyp_dump_info-reserved_scratch_size)) + scratch_area_size += length; + + if ((reserved_area_size == phyp_dump_info-init_reserve_size) + (scratch_area_size == phyp_dump_info-reserved_scratch_size)) { + + invalidate_last_dump(phdr, + phyp_dump_info-reserved_scratch_addr); + register_dump_area (phdr, + phyp_dump_info-reserved_scratch_addr); + } +} + /* - */ /** * sysfs_release_region -- sysfs interface to release memory range. @@ -282,6 +315,8 @@ ssize_t store_release_region(struct kset if (ret != 2) return -EINVAL; + track_freed_range(start_addr, length); + /* Range-check - don't free any reserved memory that * wasn't reserved for phyp-dump */ if (start_addr phyp_dump_info-init_reserve_start) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 7/8] pseries: phyp dump: Tracking memory range freed.
This patch tracks the size freed. For now it does a simple rudimentary calculation of the ranges freed. The idea is to keep it simple at the external shell script level and send in large chunks for now. Signed-off-by: Manish Ahuja [EMAIL PROTECTED] - --- arch/powerpc/platforms/pseries/phyp_dump.c | 35 + 1 file changed, 35 insertions(+) Index: 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c === --- 2.6.24-rc5.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-21 23:30:18.0 -0600 +++ 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-21 23:42:04.0 -0600 @@ -275,6 +275,39 @@ void release_memory_range(unsigned long } } +/** + * track_freed_range -- Counts the range being freed. + * Once the counter goes to zero, it re-registers dump for + * future use. + */ +static void +track_freed_range(unsigned long addr, unsigned long length) +{ + static unsigned long scratch_area_size, reserved_area_size; + + if (addr phyp_dump_info-init_reserve_start) + return; + + if ((addr = phyp_dump_info-init_reserve_start) + (addr = phyp_dump_info-init_reserve_start + +phyp_dump_info-init_reserve_size)) + reserved_area_size += length; + + if ((addr = phyp_dump_info-reserved_scratch_addr) + (addr = phyp_dump_info-reserved_scratch_addr + +phyp_dump_info-reserved_scratch_size)) + scratch_area_size += length; + + if ((reserved_area_size == phyp_dump_info-init_reserve_size) + (scratch_area_size == phyp_dump_info-reserved_scratch_size)) { + + invalidate_last_dump(phdr, + phyp_dump_info-reserved_scratch_addr); + register_dump_area (phdr, + phyp_dump_info-reserved_scratch_addr); + } +} + /* - */ /** * sysfs_release_region -- sysfs interface to release memory range. @@ -298,6 +331,8 @@ ssize_t store_release_region(struct kset if (ret != 2) return -EINVAL; + track_freed_range(start_addr, length); + /* Range-check - don't free any reserved memory that * wasn't reserved for phyp-dump */ if (start_addr phyp_dump_info-init_reserve_start) ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev