diff options
author | Peter Volkov <pva@gentoo.org> | 2011-07-28 15:33:24 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2011-07-28 15:33:24 +0000 |
commit | 242bd56da05f41c78bc0de383e13c7015c2731e0 (patch) | |
tree | 8f4929338a6cef86324936066b9fac25ca190ff4 /net-wireless/bluez/files | |
parent | Fix building with gtk by appending no-as-needed on quickstarter. Fixes bug #3... (diff) | |
download | gentoo-2-242bd56da05f41c78bc0de383e13c7015c2731e0.tar.gz gentoo-2-242bd56da05f41c78bc0de383e13c7015c2731e0.tar.bz2 gentoo-2-242bd56da05f41c78bc0de383e13c7015c2731e0.zip |
Fix high CPU usage, bug #376677.
(Portage version: 2.1.10.7/cvs/Linux x86_64)
Diffstat (limited to 'net-wireless/bluez/files')
-rw-r--r-- | net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch b/net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch new file mode 100644 index 000000000000..a3029e102ef8 --- /dev/null +++ b/net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch @@ -0,0 +1,43 @@ +From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> +Date: Wed, 20 Jul 2011 09:12:22 +0000 (+0300) +Subject: Fix removing inotify watch whenever an adapter is removed +X-Git-Url: http://git.kernel.org/?p=bluetooth%2Fbluez.git;a=commitdiff_plain;h=e2482a5ee3626e426149558e27a8e50ad07d7dad;hp=9a7e2cc81cdea7a673a2cc29cd8eae43155122c0 + +Fix removing inotify watch whenever an adapter is removed + +This sometimes cause bluetoothd to burn cpu when an adapter is removed +from the system. + +Since the watch is not really bond to any adapter, in fact it is added on +plugin .init, its removal is now moved to plugin .exit. +--- + +diff --git a/plugins/adaptername.c b/plugins/adaptername.c +index 2a54cc0..9e99e6a 100644 +--- a/plugins/adaptername.c ++++ b/plugins/adaptername.c +@@ -262,10 +262,6 @@ static gboolean handle_inotify_cb(GIOChannel *channel, GIOCondition cond, + + static void adaptername_remove(struct btd_adapter *adapter) + { +- if (watch_fd >= 0) +- close(watch_fd); +- if (inotify != NULL) +- g_io_channel_shutdown(inotify, FALSE, NULL); + } + + static struct btd_adapter_driver adaptername_driver = { +@@ -314,6 +310,13 @@ static int adaptername_init(void) + + static void adaptername_exit(void) + { ++ if (watch_fd >= 0) ++ close(watch_fd); ++ if (inotify != NULL) { ++ g_io_channel_shutdown(inotify, FALSE, NULL); ++ g_io_channel_unref(inotify); ++ } ++ + btd_unregister_adapter_driver(&adaptername_driver); + } + |