Re: [PATCH RFC 0/5] support cpu bandwidth in libvirt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 06/16/2011 12:44 AM, Wen Congyang wrote:
> In the kernel, the value of quota is stored in uint64_t:
> =======================================
> struct cfs_bandwidth {
> #ifdef CONFIG_CFS_BANDWIDTH
> 	raw_spinlock_t lock;
> 	ktime_t period;
> 	u64 quota;             <========== here is u64, not s64
> 	u64 runtime;
> 	u64 runtime_expires;
> 	s64 hierarchal_quota;
> 
> 	int idle;
> 	struct hrtimer period_timer, slack_timer;
> 	struct list_head throttled_cfs_rq;
> 
> 	/* statistics */
> 	int nr_periods, nr_throttled;
> 	u64 throttled_time;
> 
> #endif
> };
> =======================================
> 
> The unit of quota in kernel is ns, but the value we write to cpu.cfs_quota_us is us.
> So the max value we can write is 2^64/1000.
> 
> In the kernel, if quota is ~0ULL, it means unlimited.

Ok, I would think you can use the same semantics in libvirt then.  No
need for a structure.

-- 
Adam Litke
IBM Linux Technology Center

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]