rpms/kernel/devel perf-dont-free-perf_mmap_data-until-work-has-been-done.patch, NONE, 1.1 config-debug, 1.36, 1.37 config-nodebug, 1.48, 1.49 kernel.spec, 1.1870, 1.1871

Kyle McMartin kyle at fedoraproject.org
Thu Dec 10 01:41:25 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24272

Modified Files:
	config-debug config-nodebug kernel.spec 
Added Files:
	perf-dont-free-perf_mmap_data-until-work-has-been-done.patch 
Log Message:
* Wed Dec 09 2009 Kyle McMartin <kyle at redhat.com> 2.6.32-8
- Add a patch off lkml from krh to fix perf when DEBUG_PERF_USE_VMALLOC
  (rhbz#542791)
- Re-enable CONFIG_DEBUG_PERF_USE_VMALLOC on debug kernels.


perf-dont-free-perf_mmap_data-until-work-has-been-done.patch:
 perf_event.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- NEW FILE perf-dont-free-perf_mmap_data-until-work-has-been-done.patch ---
>From linux-kernel-owner+kyle=40mcmartin.ca-S1751352AbZLAUFg at vger.kernel.org Tue Dec  1 15:06:00 2009
From:	=?UTF-8?q?Kristian=20H=C3=B8gsberg?= <krh at bitplanet.net>
Subject: [PATCH] perf: Don't free perf_mmap_data until work has been done.
Date:	Tue,  1 Dec 2009 15:05:01 -0500

In the CONFIG_PERF_USE_VMALLOC case, perf_mmap_data_free() only
schedules the cleanup of the perf_mmap_data struct.  In that case
we have to wait until the work has been done before we free data.

Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
---
 kernel/perf_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7f29643..f1854b9 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2174,6 +2174,7 @@ static void perf_mmap_data_free(struct perf_mmap_data *data)
 	perf_mmap_free_page((unsigned long)data->user_page);
 	for (i = 0; i < data->nr_pages; i++)
 		perf_mmap_free_page((unsigned long)data->data_pages[i]);
+	kfree(data);
 }
 
 #else
@@ -2214,6 +2215,7 @@ static void perf_mmap_data_free_work(struct work_struct *work)
 		perf_mmap_unmark_page(base + (i * PAGE_SIZE));
 
 	vfree(base);
+	kfree(data);
 }
 
 static void perf_mmap_data_free(struct perf_mmap_data *data)
@@ -2319,7 +2321,6 @@ static void perf_mmap_data_free_rcu(struct rcu_head *rcu_head)
 
 	data = container_of(rcu_head, struct perf_mmap_data, rcu_head);
 	perf_mmap_data_free(data);
-	kfree(data);
 }
 
 static void perf_mmap_data_release(struct perf_event *event)
-- 
1.6.5.rc2

--
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/



Index: config-debug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-debug,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- config-debug	8 Dec 2009 20:38:46 -0000	1.36
+++ config-debug	10 Dec 2009 01:41:24 -0000	1.37
@@ -55,7 +55,7 @@ CONFIG_DEBUG_CREDENTIALS=y
 
 CONFIG_EXT4_DEBUG=y
 
-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_DEBUG_PERF_USE_VMALLOC=y
 
 # off in both production debug and nodebug builds,
 #  on in rawhide nodebug builds


Index: config-nodebug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-nodebug,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -p -r1.48 -r1.49
--- config-nodebug	8 Dec 2009 20:38:46 -0000	1.48
+++ config-nodebug	10 Dec 2009 01:41:24 -0000	1.49
@@ -59,7 +59,7 @@ CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
 
 CONFIG_EXT4_DEBUG=y
 
-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_DEBUG_PERF_USE_VMALLOC=y
 
 CONFIG_JBD2_DEBUG=y
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1870
retrieving revision 1.1871
diff -u -p -r1.1870 -r1.1871
--- kernel.spec	9 Dec 2009 14:28:45 -0000	1.1870
+++ kernel.spec	10 Dec 2009 01:41:24 -0000	1.1871
@@ -730,6 +730,8 @@ Patch12013: linux-2.6-rfkill-all.patch
 # rhbz#544471
 Patch12014: ext4-fix-insufficient-checks-in-EXT4_IOC_MOVE_EXT.patch
 
+Patch12015: perf-dont-free-perf_mmap_data-until-work-has-been-done.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1348,6 +1350,8 @@ ApplyPatch linux-2.6-rfkill-all.patch
 # rhbz#544471
 ApplyPatch ext4-fix-insufficient-checks-in-EXT4_IOC_MOVE_EXT.patch
 
+ApplyPatch perf-dont-free-perf_mmap_data-until-work-has-been-done.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2003,6 +2007,11 @@ fi
 # and build.
 
 %changelog
+* Wed Dec 09 2009 Kyle McMartin <kyle at redhat.com> 2.6.32-8
+- Add a patch off lkml from krh to fix perf when DEBUG_PERF_USE_VMALLOC
+  (rhbz#542791)
+- Re-enable CONFIG_DEBUG_PERF_USE_VMALLOC on debug kernels.
+
 * Wed Dec 09 2009 Kyle McMartin <kyle at redhat.com> 2.6.32-7
 - ext4-fix-insufficient-checks-in-EXT4_IOC_MOVE_EXT.patch: CVE-2009-4131
   fix insufficient permission checking which could result in arbitrary




More information about the scm-commits mailing list