From patchwork Mon May 23 17:39:39 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 11889 Received: from epz01.nefonline.de ([212.204.66.1]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DaGv5-0002zO-6g for vdr@linuxtv.org; Mon, 23 May 2005 19:40:51 +0200 Received: from dsl01.212.114.234.249.nefkom.net (DSL01.212.114.234.249.NEFkom.net [212.114.234.249]) by epz01.nefonline.de (NEFkom Mailservice) with SMTP id j4NHeTc16110 for ; Mon, 23 May 2005 19:40:29 +0200 From: Matthias Schwarzott To: vdr@linuxtv.org Date: Mon, 23 May 2005 19:39:39 +0200 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Message-Id: <200505231939.40269.zzam@gmx.de> Subject: [vdr] Section handler thread eating too much cpu X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 17:40:51 -0000 Status: O X-Status: X-Keywords: X-UID: 2434 Hi there, in the last days I come accross a strange phenomen: One vdr thread eats up to 45% cpu on my Pentium3 700Mhz system when I did nothing with my vdr except live viewing on a ff card without transfer mode. Some digging resulted in this: - The thread is the section handler thread. - The cpu-load depends on the transponder currently watching on. The Pro7/Sat1 Transponder was the one with the highest load. Worst case is to record Pro7 and watch it live at the same moment: Recording goes over the second card resulting in 2 section handler threads, one for each card eating whole cpu. Attached is a Patch to simply add one sleep(1) inte the loop before the poll. This results in reducing the cpu-load from 45% to 1.3%. And it does not seem to lose any sections. If you need more data to reproduce this: I have a gentoo system without nptl using the newest cvs dvb driver. The system itself has a FF 1.3 card and a skystar 2.6B card. Matthias diff -ur vdr-1.3.24-vanilla/sections.c vdr-1.3.24/sections.c --- vdr-1.3.24-vanilla/sections.c 2005-05-23 19:19:47.000000000 +0200 +++ vdr-1.3.24/sections.c 2005-05-23 19:20:04.000000000 +0200 @@ -183,6 +183,7 @@ int oldStatusCount = statusCount; Unlock(); + sleep(1); if (poll(pfd, NumFilters, 1000) > 0) { bool DeviceHasLock = device->HasLock(); if (!DeviceHasLock)