Gentoo Archives: gentoo-commits

From: "Peter Volkov (pva)" <pva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-wireless/bluez/files: bluez-4.95-high-cpu-usage.patch
Date: Thu, 28 Jul 2011 16:02:44
Message-Id: 20110728153324.BCAC720051@flycatcher.gentoo.org
1 pva 11/07/28 15:33:24
2
3 Added: bluez-4.95-high-cpu-usage.patch
4 Log:
5 Fix high CPU usage, bug #376677.
6
7 (Portage version: 2.1.10.7/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/bluez/files/bluez-4.95-high-cpu-usage.patch?rev=1.1&content-type=text/plain
14
15 Index: bluez-4.95-high-cpu-usage.patch
16 ===================================================================
17 From: Luiz Augusto von Dentz <luiz.von.dentz@×××××.com>
18 Date: Wed, 20 Jul 2011 09:12:22 +0000 (+0300)
19 Subject: Fix removing inotify watch whenever an adapter is removed
20 X-Git-Url: http://git.kernel.org/?p=bluetooth%2Fbluez.git;a=commitdiff_plain;h=e2482a5ee3626e426149558e27a8e50ad07d7dad;hp=9a7e2cc81cdea7a673a2cc29cd8eae43155122c0
21
22 Fix removing inotify watch whenever an adapter is removed
23
24 This sometimes cause bluetoothd to burn cpu when an adapter is removed
25 from the system.
26
27 Since the watch is not really bond to any adapter, in fact it is added on
28 plugin .init, its removal is now moved to plugin .exit.
29 ---
30
31 diff --git a/plugins/adaptername.c b/plugins/adaptername.c
32 index 2a54cc0..9e99e6a 100644
33 --- a/plugins/adaptername.c
34 +++ b/plugins/adaptername.c
35 @@ -262,10 +262,6 @@ static gboolean handle_inotify_cb(GIOChannel *channel, GIOCondition cond,
36
37 static void adaptername_remove(struct btd_adapter *adapter)
38 {
39 - if (watch_fd >= 0)
40 - close(watch_fd);
41 - if (inotify != NULL)
42 - g_io_channel_shutdown(inotify, FALSE, NULL);
43 }
44
45 static struct btd_adapter_driver adaptername_driver = {
46 @@ -314,6 +310,13 @@ static int adaptername_init(void)
47
48 static void adaptername_exit(void)
49 {
50 + if (watch_fd >= 0)
51 + close(watch_fd);
52 + if (inotify != NULL) {
53 + g_io_channel_shutdown(inotify, FALSE, NULL);
54 + g_io_channel_unref(inotify);
55 + }
56 +
57 btd_unregister_adapter_driver(&adaptername_driver);
58 }