Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Apr 2012 19:54:12 +0800
From:      Yanhui Shen <shen.elf@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   CPU usage so high, fread() on the FILE wrapped by libfetch's fetchXGetURL()
Message-ID:  <CAEEM4vkZEopsP=2BCwunQ-dw5SEHE=yUC1xihyZYM=GZdXAvEg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I found the CPU usage is pretty high while running 'pkg update', 'pkg
install [fooapp]'.
Seems it was caused by fread() on the FILE wrapped by libfetch's
fetchXGetURL() , maybe fetch_read() in common.c.

Here is a simple test code: http://pastebin.com/2sP1f4Wv
I want to know whether it is a bug, or misuse of libfetch API, or any other
matter?

Run and look about its CPU usage (HTTP url has this issue, FTP url has not):
% ./a.out
http://mirrors.163.com/FreeBSD/ISO-IMAGES-amd64/8.3/FreeBSD-8.3-RELEASE-amd64-bootonly.iso

Env:
% uname -a
FreeBSD ThinkPad 9.0-STABLE FreeBSD 9.0-STABLE #1: Tue Apr 10 12:46:50 CST
2012     shen@ThinkPad:/usr/obj/usr/src/sys/ThinkPad  amd64

-- 
Best regards,
Yanhui Shen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEEM4vkZEopsP=2BCwunQ-dw5SEHE=yUC1xihyZYM=GZdXAvEg>