Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jun 2010 18:59:37 +0300
From:      Andriy Gapon <avg@freebsd.org>
To:        freebsd-acpi@freebsd.org
Cc:        Alexander Motin <mav@freebsd.org>
Subject:   cpufreq_curr_sysctl: memory allocation
Message-ID:  <4C1E3AE9.3020505@freebsd.org>

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

I noticed that cpufreq_curr_sysctl performs a substantial memory allocation and
deallocation on each call.  Its size is CF_MAX_LEVELS * sizeof(*levels), which
is ~24KB.  This happens even for read-only calls to just query current level.
And such calls happen quite frequently when powerd is running.

I think that this is an unnecessary and avoidable load for VM system.
Couldn't a buffer be preallocated in sc and re-used for the calls?
Even if not, for some reason, then wouldn't it be better to have a dedicated uma
zone for that rather than doing malloc+free?

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C1E3AE9.3020505>