Cpu steal
Author: g | 2025-04-24
This was interesting, as %st was representing the Cpu Steal Time. Here is IBM's definition of Cpu Steal Time - Steal time is the percentage of time a virtual CPU waits for a This is what s known as CPU Steal or Stolen CPU . In the step-by-step explanation below, we will show you how to detect when CPU Steal is occurring in your AWS instances using Datadog. How to detect AWS CPU steal With Datadog. To detect CPU steal you need to track the system metric system.cpu.stolen.
cpu-steal-diff/cpu-steal-diff.pl at main - GitHub
*st = &per_cpu(steal_time, cpu);if (!has_steal_clock)return;memset(st, 0, sizeof(*st));wrmsrl(MSR_KVM_STEAL_TIME, (slow_virt_to_phys(st) | KVM_MSR_ENABLED));}此时steal_time的内存地址写入到MSR_KVM_STEAL_TIME中,guest中初始化部分完成。继续,前面提到kvm_steal_clock被注册到了steal_clock中,kvm_steal_clock本质就是计算出指定CPU的steal time,从代码上可以明显看出steal time来自每CPU变量,此处假设每CPU变量赋值正常,再看,调用注册点steal_clock则是paravirt_steal_clock,往上走有steal_account_process_tick函数,top看到的st值就是它计算出来的,account_process_tick和irqtime_account_process_tick中都有调用steal_account_process_tick,即是steal_time的更新已经集成到kenrel的定时器更新中,在steal_account_process_tick函数中,paravirt_steal_clock获取steal clock,paravirt_steal_clock的返回值是一个累积值,减去this_rq()->prev_steal_time即得出当前的steal time,然后累加到kcpustat_this_cpu->cpustat[CPUTIME_STEAL],同时刷新this_rq()->prev_steal_time,而kcpustat_this_cpu则是top命令看到的st数据的来源。static __always_inline bool steal_account_process_tick(void){#ifdef CONFIG_PARAVIRTif (static_key_false(¶virt_steal_enabled)) {u64 steal;cputime_t steal_ct;//获取steal timesteal = paravirt_steal_clock(smp_processor_id());//减去上次更新的steal time就得到这次时间片(伪概念)内的steal timesteal -= this_rq()->prev_steal_time;/* * cputime_t may be less precise than nsecs (eg: if it's * based on jiffies). Lets cast the result to cputime * granularity and account the rest on the next rounds. */steal_ct = nsecs_to_cputime(steal);//再次刷新prev_steal_time,其实就是第一次的steal直接赋值更快this_rq()->prev_steal_time += cputime_to_nsecs(steal_ct);//将结果赋值到kcpustat_this_cpuaccount_steal_time(steal_ct);return steal_ct;}#endifreturn false;}另外一个调用paravirt_steal_clock是update_rq_clock_task,用来更新队列中的clock_task,先看调用它的update_rq_clock,update_rq_clock_task的入参delta来自sched_clock_cpu(cpu_of(rq)) - rq->clock,如果config中CONFIG_PARAVIRT_TIME_ACCOUNTING=y,update_rq_clock_task则会在delta中减去steal time,赋值给clock_task。void update_rq_clock(struct rq *rq){s64 delta;lockdep_assert_held(&rq->lock);if (rq->clock_skip_update & RQCF_ACT_SKIP)return;delta = sched_clock_cpu(cpu_of(rq)) - rq->clock;if (delta clock += delta;update_rq_clock_task(rq, delta);}static void update_rq_clock_task(struct rq *rq, s64 delta){#if defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)s64 steal = 0, irq_delta = 0;#endif#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTINGif (static_key_false((¶virt_steal_rq_enabled))) {steal = paravirt_steal_clock(cpu_of(rq));steal -= rq->prev_steal_time_rq;if (unlikely(steal > delta))steal = delta;rq->prev_steal_time_rq += steal;delta -= steal;}#endifrq->clock_task += delta;}通过观察clock_task的调用者就可以发现,clock_task则是进程调度中rq计算task运行时间的重要数据,如此看就是steal time是被guest可以意识到的时间,但这个时间不被计算到具体的调度队列的运行时间中,虚拟化下guest中的task调度正常。最后留下的疑问就是steal_time的每CPU变量是如何刷新的,在kvm_vcpu_arch下有下面的一个结构体struct {u64 msr_val;u64 last_steal;u64 accum_steal;struct gfn_to_hva_cache stime;struct kvm_steal_time steal;} st;在vcpu_enter_guest函数中,有record_steal_time,其他地方还有另外一个函数,accumulate_steal_time,它们的调用关系如下kvm_vcpu_ioctl->vcpu_load->kvm_arch_vcpu_load->accumulate_steal_timekvm_vcpu_ioctl->kvm_arch_vcpu_ioctl_run->vcpu_run->vcpu_enter_guest->record_steal_time也就是说accumulate_steal_time必然在record_steal_time之前执行,最新的4.4代码直接把accumulate_steal_time放到了record_steal_time函数的最前面。accumulate_steal_time函数顾名思义,计算steal time,只有3行重点delta = current->sched_info.run_delay - vcpu->arch.st.last_steal;vcpu->arch.st.last_steal = current->sched_info.run_delay;vcpu->arch.st.accum_steal = delta;先理解run_delay是什么,"在运行队列上等待的时间"?#ifdef CONFIG_SCHED_INFOstruct sched_info {/* cumulative counters */unsigned long pcount; /* # of times run on this cpu */unsigned long long run_delay; /* time spent waiting on a runqueue *//* timestamps */unsigned long long last_arrival,/* when we last ran on a cpu */ last_queued;/* when we were last queued to run */};#endif /* CONFIG_SCHED_INFO */那么,current->sched_info.run_delay就是qemu的run_delay,也就是陷入到guest中的时间,那么在t5时刻(每次enter到guest中的时候),current->sched_info.run_delay=t2-t1+t4-t3,而vcpu->arch.st.last_steal则是上次enter guest时(t3时刻)的run_delay,即t2-t1,那么本次时间段的steal time则是vcpu->arch.st.accum_steal=t4-t3。这样就将当前时间段内的steal time存储到accum_steal中。再看record_steal_time函数,此处使用了kvm_read_guest_cached和kvm_write_guest_cached,本质就是直接读取或写入guest的某段内存,涉及到gfn_to_hva_cache结构体,因为写入的gfn2hva映射关系一般是不变的,所以不需要在guest重复转换浪费计算能力,vcpu->arch.st.stime的gfn_to_hva_cache结构体是在kvm_set_msr_common函数下MSR_KVM_STEAL_TIME case下初始化的,函数是case MSR_KVM_STEAL_TIME:if (unlikely(!sched_info_on()))return 1;if (data & KVM_STEAL_RESERVED_MASK)return 1;//下面的kvm_gfn_to_hva_cache_init中第三个入参是gpa,前面提到把steal_time//的每CPU变量的物理地址注册到MSR_KVM_STEAL_TIME中,此处则data则是//MSR_KVM_STEAL_TIME索引的msr的值,即每CPU变量的物理地址if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.st.stime,data & KVM_STEAL_VALID_BITS,sizeof(struct kvm_steal_time)))return 1;vcpu->arch.st.msr_val = data;vcpu->arch.st.last_steal = current->sched_info.run_delay;break;kvm_gfn_to_hva_cache_init就是纯粹的转换,不提。回到record_steal_time,kvm_read_guest_cached本质就是__copy_from_user,拷贝到vcpu->arch.st.stime,然后加上vcpu->arch.st.accum_steal,赋值给vcpu->arch.st.steal.steal,然后再通过kvm_write_guest_cached函数写入到guest中的映射地址中,这样就和steal_time每CPU变量对应起来了。if (unlikely(kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,&vcpu->arch.st.steal, sizeof(struct kvm_steal_time))))return;vcpu->arch.st.steal.steal += vcpu->arch.st.accum_steal;vcpu->arch.st.steal.version += 2;vcpu->arch.st.accum_steal = 0;kvm_write_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,&vcpu->arch.st.steal, sizeof(struct kvm_steal_time));KVM下steal_time源代码分析来自于OenHan链接为:
CPU Steal - nic.uoregon.edu
Priority of a given thread arbitrarily, as long as it is equal to or greater than the BasePriority value for that thread.On Windows NT, numeric priority values range between 0 and 31 , although the value 0 is reserved by the OS. Thus, no threads, except specially designated OS threads, may use this priority. This range is divided into two categories: dynamic priorities and real-time priorities.Dynamic priorities are values between 1 and 15. They are referred to as "dynamic" because the OS varies the priority of threads in this range. Thus, for example, it is not possible for a thread in this range to steal the CPU and cause starvation of other threads that are waiting to run.Real-time priorities are values between 16 and 31 . They are referred to as real-time because the OS does not vary the priority of threads in this range. Real-time range threads can continue to control the CPU, as long as no other threads of equal or higher priority are scheduled. Thus, it is possible for a real-time thread to steal the CPU and cause starvation of other threads that are waiting to run.For either dynamic or real-time priorities, the BasePriority is established when the thread is first created and may be programmatically adjusted via such calls as KeSetBasePriorityThread().For dynamic threads, the Priority starts out equal to the BasePriority , but may be adjusted by the OS. For example during I/O completion IoCompleteRequest(), KeSetEvent(), Quantum exhaustion.For real-time threads, the OS never adjusts the PriorityNormal CPU steal in VPSLowEndTalk
A beating. AMD Bulldozer AMD's Bulldozer was supposed to steal a march on Intel by cleverly sharing certain chip capabilities to improve efficiency and reduce die size. AMD wanted a smaller core, with higher clocks to offset any penalties related to the shared design. What it got was a disaster. Bulldozer couldn't hit its target clocks, drew too much power, and its performance was a fraction of what it needed to be. It's rare that a CPU is so bad, it nearly kills the company that invented it. Bulldozer nearly did. AMD did penance for Bulldozer by continuing to use it. Despite the cores flaws, it formed the backbone of AMD's CPU family from late 2011 through early 2017. Cyrix 6x86 Cyrix was one of the x86 manufacturers that didn't survive the late 1990s (VIA now holds their x86 license). Chips like the 6x86 were a major part of the reason why. Cyrix has the dubious distinction of being the reason why some games and applications carried compatibility warnings. The 6x86 was significantly faster than Intel's Pentium in integer code, but its FPU was abysmal and its chips weren't particularly stable when paired with Socket 7 motherboards. If you were a gamer in the late 1990s, you wanted an Intel CPU but could settle for AMD. The 6x86 was one of the terrible "everybody else" chips you didn't want in your Christmas stocking. The 6x86 failed because it couldn't differentiate itself from Intel or AMD in a way that made sense or gave Cyrix an effective niche of its own. The company tried to develop a unique product and wound up earning itself a second place on this list instead. Cyrix MediaGX The MediaGX was the first attempt to build an integrated SoC processor for desktop, with graphics, CPU, PCI bus, and memory controller all on one die. Unfortunately, this happened in 1998, which means all those components were really terrible. Motherboard compatibility was incredibly limited, the underlying CPU architecture (Cyrix 5x86) was equivalent to Intel's 80486, and the CPU couldn't connect to an off-die L2 cache (the only kind of L2 cache there was, back then). Chips like the Cyrix 6x86 could at least claim to compete with Intel in business applications. The MediaGX couldn't compete with a dead manatee. The entry for the MediaGX on Wikipedia includes the sentence "Whether this processor belongs in the fourth or fifth generation of x86 processors can be considered a matter of debate." The 5th generation of x86 CPUs is the Pentium's generation, while the 4th generation refers to 80486 CPUs. The MediaGX shipped in 1997 with a CPU core stuck somewhere between 1989 and 1992, at a time when people really. This was interesting, as %st was representing the Cpu Steal Time. Here is IBM's definition of Cpu Steal Time - Steal time is the percentage of time a virtual CPU waits for acpu steal time - LinuxQuestions.org
Cores by the system and user processes.The percentage of CPU used for interrupt requests. ('irq')The next value is the idle percentage for all the cores combined.The following value denotes the waiting each CPU core had to do.Next up is the percentage for the steal time.'guest' denotes the guest-percentage, which is the CPU time spent on other virtual machines.The last two values indicate the current frequency of the CPU.Now, the 'atop' displays the above statistics for each core independently.CPL - refers to as CPU Load.The first three values are the average loads with different periods: 1, 5, and 15 minutes.This is followed by the number of context switches ('csw')Next up is the number of interrupts ('intr')The last value is number of available CPUs.MEM - Memory UtilizationThe total physical memory supported.The memory currently free.The current cache memory.'buff' as in “buffer” is the amount of memory consumed in filesystem meta-data.The sum of memory for kernel’s memory allocation shown as 'slab'.The amount of shared memory.SWP - Swap Memory.DSK - Disk usageThe first value denotes the percentage of time the system is busy handling requests.The reading requests issued.The writing requests issued.The rate at which data (in KB) is read per reading request.The rate at which data (in KB) is written per writing request.The next two values are time rates for reading and writing on the disk in Megabytes.The last value is the average number of milliseconds spent in handling requests.NET - Network Statistics at the Transport Layer'transport' signifies the Transport layer in Networking, which deals with the data protocols.The number of segments received by the system following the TCP protocol. ('tcpi')The number of segments transmitted. ('tcpo')The similar statistics for UCP protocol. ('udpi' for UDP in) and ('udpo' for UDP out).'tcpao' is the number of active TCP open connections.Opposite to previous 'tcppo' is the number ofWhat is CPU steal time? - Site24x7
KVM下steal_time源代码分析代码版本: branch v4.3刚好有人在其他文章评论下问到steal_time机制,顺便看了一下,总结如下。steal_time原意是指在虚拟化环境下,hypervisor窃取的vm中的时间,严格讲就是VCPU没有运行的时间。在guest中执行top选项,就可以看到一个st数据[email protected] ~$ toptop - 21:04:12 up 1:24, 2 users, load average: 0.45, 0.31, 0.22Tasks: 268 total, 1 running, 267 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.5 us, 0.2 sy, 0.3 ni, 98.0 id, 0.9 wa, 0.0 hi, 0.0 si,0.0 stst数据的意义是给guest看到了自己真正占用CPU的时间比例,让guest根据st调整自己的行为,以免影响业务,如果st值比较高,则说明hostvm的CPU比例太小,整个hypervisor的任务比较繁重,有些高计算任务可以跟着自我限制。同时KVM的doc文件描述如下:MSR_KVM_STEAL_TIME: 0x4b564d03data: 64-byte alignment physical address of a memory area which must be in guest RAM, plus an enable bit in bit 0. This memory is expected to hold a copy of the following structure:struct kvm_steal_time { __u64 steal;__u32 version;__u32 flags;__u32 pad[12]; }whose data will be filled in by the hypervisor periodically. Only one write, or registration, is needed for each VCPU. The interval between updates of this structure is arbitrary and implementation-dependent.The hypervisor may update this structure at any time it sees fit until anything with bit0 == 0 is written to it. Guest is required to make sure this structure is initialized to zero.Fields have the following meanings:version: a sequence counter. In other words, guest has to check this field before and after grabbing time information and make sure they are both equal and even. An odd version indicates an in-progress update.flags: At this point, always zero. May be used to indicate changes in this structure in the future.steal: the amount of time in which this vCPU did not run, in nanoseconds. Time during which the vcpu is idle, will not be reported as steal time.下面看一下具体的源代码实现:先说guest端的代码,steal_time本身是一个PV实现,这个应该是在AWS(XEN)开发出来后又搬到KVM上的,因为本身kernel不存在这个功能,算是修改kernel,归到PV里面了,所有一般编译内核的时候要保证CONFIG_PARAVIRT=y即开关打开。cat /boot/config-4.2.6 | grep CONFIG_PARAVIRTCONFIG_PARAVIRT=y在guest kernel启动的过程中,内核初始化调用setup_arch,然后是kvm_guest_init,先调用kvm_para_available判断是否是KVM虚拟化环境,原理就是根据CPUID查询的字符串是否有"KVMKVMKVM",然后又将kvm_steal_clock注册到steal_clock,if (kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {has_steal_clock = 1;pv_time_ops.steal_clock = kvm_steal_clock;}在CONFIG_SMP不同的情况下分叉,但最后都是调用kvm_guest_cpu_init,进入kvm_register_steal_time函数,kvm_register_steal_time做了一件事,即把steal_time的每CPU变量的物理地址注册到MSR_KVM_STEAL_TIME中,如下static DEFINE_PER_CPU(struct kvm_steal_time, steal_time) __aligned(64);static void kvm_register_steal_time(void){int cpu = smp_processor_id();struct kvm_steal_timecpu steal - Proxmox Support Forum
This was posted 4 years ago. Post ID: 15024 Page permalink.WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.These cookies expire two weeks after they are set. Logging CPU usage over a certain period of time is very easy.The command below will print 24 lines of CPU statistics, printing a line every 4 seconds.┌──[[email protected]]─[~]└──╼ ╼ $ sar -u 4 24 --humanLinux 5.8.0-41-generic (jason-desktop) 12/04/21 _x86_64_ (4 CPU) 09:05:33 CPU %user %nice %system %iowait %steal %idle09:05:37 all 20.6% 0.0% 8.5% 0.3% 0.0% 70.6%09:05:41 all 21.4% 0.0% 8.2% 0.0% 0.0% 70.4%09:05:45 all 24.3% 0.0% 9.6% 0.9% 0.0% 65.1%09:05:49 all 32.9% 0.0% 8.4% 6.1% 0.0% 52.7%09:05:53 all 23.1% 0.0% 8.3% 2.7% 0.0% 65.9%09:05:57 all 22.0% 0.0% 8.4% 0.2% 0.0% 69.4%09:06:01 all 21.6% 0.0% 7.8% 2.8% 0.0% 67.9%09:06:05 all 20.6% 0.0% 8.4% 3.6% 0.0% 67.4%09:06:09 all 21.4% 0.0% 8.7% 0.3% 0.0% 69.6%09:06:13 all 21.3% 0.0% 7.9% 1.4% 0.0% 69.4%09:06:17 all 21.1% 0.0% 7.9% 1.9% 0.0% 69.1%09:06:21 all 20.9% 0.0% 8.8% 1.7% 0.0% 68.5%09:06:25 all 22.2% 0.0% 7.6% 0.1% 0.0% 70.2%09:06:29 all 19.6% 0.0% 8.6% 2.5% 0.0% 69.3%09:06:33 all 19.4% 0.0% 8.8% 1.5% 0.0% 70.4%09:06:37 all 20.2% 0.0% 8.8% 0.2% 0.0% 70.7%09:06:41 all 21.0% 0.0% 9.6% 0.6% 0.0% 68.9%09:06:45 all 20.4% 0.0% 9.0% 3.8% 0.0% 66.9%09:06:49 all 28.2% 0.0% 10.8% 1.9% 0.0% 59.2%09:06:53 all 23.0% 0.0% 10.6% 0.0% 0.0% 66.3%09:06:57 all 21.4% 0.0% 9.2% 0.1% 0.0% 69.3%09:07:01 all 26.5% 0.0% 9.8% 0.0% 0.0% 63.8%09:07:05 all 19.6% 0.0% 8.8% 0.3% 0.0% 71.3%09:07:09 all 20.5% 0.0% 7.4% 0.4% 0.0% 71.8%Average: all 22.2% 0.0% 8.7% 1.4% 0.0% 67.6%A nice way to create a set of graphs is with the sargrapher.pl script.Use this command to generate a sar output file.┌──[[email protected]]─[~]└──╼ ╼ $ sar -u 4 24 -p -A > my.sarThen upload it on this website to create a set of very nice graphs. works very well for getting an idea of the CPU usage over a certain time.cpu-steal GitHub Topics GitHub
--> --> --> Stay away from fake Afterburner sites Lately, we heard about many phishing Afterburner sites that will steal your data for improper purposes. Please be noted that the correct Afterburner site only exists on msi.com and Guru3D, any other is a fake site. Be careful and stay away from those sites to protect your digital assets. Protection for PC gaming Multiple layers of protection for your devices, game accounts and digital assets. Norton 360 provides powerful layers of protection for your devices and online privacy. It helps guard against malware, and other online threats as you bank, browse and shop online. Password Manager tools help you manage your passwords and online credentials, and PC Cloud Backup,3 helps prevent data loss due to hard drive failures and ransomware. Plus, with our 100% Virus Protection Promise you get your money back if your device gets a virus we can’t remove!2 Maximize your gaming performance with Norton Game Optimizer Level-up your protection without compromising your game. Game Optimizer dedicates the CPU power needed for optimal performance in your game by isolating non-essential apps to a single CPU core. Boost performance and strengthen your PC’s security at the same time. Try Game Optimizer and Norton 360 for Gamers for 30 days free. Game Optimizer Automatically Optimize -Detects full-screen games and feeds them maximum CPU power. Smooth Performance -Helps eliminate FPS lags and slowdowns from your other apps for smooth visuals. Maximize Resources -Free your PC from power-hungry programs running in the background that eat up your system’s resources. Get more performance out of your rig! The MSI trial offer is not available if you have already had another existing cyber security software installed. If you have another cyber security software installed, you will not be able to use our product. Please uninstall. This was interesting, as %st was representing the Cpu Steal Time. Here is IBM's definition of Cpu Steal Time - Steal time is the percentage of time a virtual CPU waits for a
CPU steal times with various providersLowEndTalk
In Rome. The AI is a lot better as well. (Although in Agincourt the French were pretty stupid anyway so that's not saying much. I have yet to see the full power of the AI in combat) The combos are really apparent as well, as I saw one being executed on Henry V (which was pretty devestating, but impressive) the dying of soldiers is a lot more realistic in my view, and the blood effects are awesome! Haven't tried Pavia yet but I will soon.P.S. To any of those who are experincing choppiness even with all grapics settings on low, try turning the shadows off from the options menu via the main menu, that should make thegame a lot smoother, it did with mine. [This message has been edited by Marcus Orentius (edited 10-12-2006 @ 01:53 PM).] Brock88 Legionary posted 12 October 2006 15:02 EDT (US) 87 / 172 Quote:Hi Brock, been some time since I dropped by. I've been green for about a month now (I think).Wow, almost everyone I know has turned green. Come back to OD once in a while k?About this SSE2 thing. M2 is the first game that I heard of that requires this. What exactly is it? It's pretty shitty if people have to buy a new processor to play a game. I mean a top of the line graphic card is about $500, a low end processor will cost you $1000+.Never lie, steal, cheat, or drink. But if you must lie, lie in the arms of the one you love. If you must steal, steal away from bad company. If you must cheat, cheat death. And if you must drink, drink in the moments that take your breath away. Winner of 2005 OD : Best Ownage, Funniest Newbie, and Dinoman Award "Mastering Others is Strength, Mastering yourself makes you fearless -Lao Tzu" Mechstra Banned posted 12 October 2006 15:40 EDT (US) 88 / 172 It's an evolution of MMX, which you may have heard of - back in 1997 it was the coming thing, and some games required it and so on.It then turned out that MMX wasn't all that great and although it's been a part of processors since it hasn't really had any focus placed on it. dsmi1 Legionary posted 13 October 2006 03:13 EDT (US) 89 / 172 hey guys with the CPU-Z thing, which part will tell me ifCan CPU steal be the guest's faultLowEndTalk
PC, My Player mode.The Teammate Grade engine this year is horrible. Absolutely horrible. First of all, "bad steal attempts". Basically every time you try to steal the ball, it's a bad steal attempt. Sometimes even if I actually do tip the pass, the game will have already decided that it was a bad steal attempt.Next, "shot selection". Pretty often I find myself getting a "bad shot selection" on close, easy, open shots and "good shot selection" for pulling up in my man's face. I keep the jumpshot feedback on all the time and I figure it has something to do with your release timing. Almost always when I take a good, open shot but screw up the release I get a bad shot selection, but if I take pretty much the same shot and get the release right, it will be a good shot selection. And of course, the switch on defense logic. I'm just out of words for it. I have no idea how many times exactly I've been charged for not my man scoring so far, but it happens a lot every game. Countless times I'm guarding a guy, my teammate gets lost guarding his man, he gets wide open and while he's taking the open shot the game switches me to him so I can take the hit for him scoring. Often someone from the opposing team gets the rebound, throws a very unrealistic full court pass (hell yeah, for the CPU they always connect, for me never, and it doesn't matter who's passing) to his teammate on the break for an open dunk and I get charged with "allow man to score" (even though he wasn't my man) and "bad transition defense" (even though by the time the pass was thrown I hadn't even gotten out of the paint yet after fighting for a rebound). The most extreme situation I've had so far: four players in the paint fighting for a rebound - me, my teammate and 2 bigmen from the other team. One of them grabbed the offensive rebound, passed to the other and he dunked the ball. I got charged with BOTH "allow offensive rebound" and "allow man to score" even though it was done by 2 different players and there was my teammate in the paint who should be responsible for one of them. The switch on defense logic in this game is so terrible that it would be really hard to make it any worse. Of course it's needed in the game and the concept is good, but the way it's done is completely unacceptable and I feel I'd be a lot better off without it as well as all the other "revolutionary changes" made to the Teammate Grade this year. Yeah, I definitely prefer occasionally get "allow man to score" when I'm not guarding my man because of a switch than be made responsible for half of the freaking team scoring.The "hold ball too long" comes way too fast, for a. This was interesting, as %st was representing the Cpu Steal Time. Here is IBM's definition of Cpu Steal Time - Steal time is the percentage of time a virtual CPU waits for aCPU Steal and IO Wait - LowEndSpirit
Battery Alarm v.1. 2. 2002Battery Alarm is battery protection solution for windows laptop, it is designed to protect laptop battery from deep-discharge, the laptop battery may last for 3 years or more after using this software.the windows default power alarm setting ...Category: System ManagementDeveloper: Pwqsoft| Download | Price: $25.50Battery Guard for Notebooks v.0.04Battery Guard for Notebooks is a program to display the notebook battery charge as colored bar. The bar is situated on the edge of the screen, always on top, always in sight. It does not interfere with work, but allows to notice the reduction of ...Category: Personal and HomeDeveloper: Alex Konuhoff| Download | FreeAdvertisementLAlarm - Free Laptop Alarm v.5 7LAlarm is a free laptop alarm. LAlarm emits a loud alarm sound when a thief tries to steal a laptop and it recovers and destroys sensitive data if the laptop is stolen. Besides, it alarms when the battery is under stress in order to preserve the battery ...Category: Misc ToolsDeveloper: LAlarm Systems| Download | FreeBattery4Life v.2.0A convenient battery management tool that plays an alert when your battery is running low. Battery4Life is a useful tool designed for laptops to let the user know when their battery is running low by display a big red image on your screen and / or One ...Category: System ManagementDeveloper: battery4life.webs.com| Download | FreeNotebook Hardware Control v.2.0The program monitors CPU clock, CPU load, CPU temperature, HD temperature, battery charge, battery charge rate, and RAM status. You can set the monitoring time interval from 1 second to 1 day. The program shows the monitored information in three ways: ...Category: UtilitiesDeveloper: Manfred Jaider| Download | FreeBattery Optimizer v.3.0.5.18Everyone wants more laptop battery life without having to plug it in all the time. That's where Battery Optimizer comes in. Through our advanced scan, battery life can be managed through simple optimization techniques. Battery Optimizer also saves and ...Category: Tweaking & DiagnosticsDeveloper: ReviverSoft| Download | FreeSofodroid Battery Level v.1.0.1Sofodroid Battery Level provides the battery level status in Percentage.It also predicts the time in which the Battery will fully charge/discharge.This makes it easier to determine how much batteryComments
*st = &per_cpu(steal_time, cpu);if (!has_steal_clock)return;memset(st, 0, sizeof(*st));wrmsrl(MSR_KVM_STEAL_TIME, (slow_virt_to_phys(st) | KVM_MSR_ENABLED));}此时steal_time的内存地址写入到MSR_KVM_STEAL_TIME中,guest中初始化部分完成。继续,前面提到kvm_steal_clock被注册到了steal_clock中,kvm_steal_clock本质就是计算出指定CPU的steal time,从代码上可以明显看出steal time来自每CPU变量,此处假设每CPU变量赋值正常,再看,调用注册点steal_clock则是paravirt_steal_clock,往上走有steal_account_process_tick函数,top看到的st值就是它计算出来的,account_process_tick和irqtime_account_process_tick中都有调用steal_account_process_tick,即是steal_time的更新已经集成到kenrel的定时器更新中,在steal_account_process_tick函数中,paravirt_steal_clock获取steal clock,paravirt_steal_clock的返回值是一个累积值,减去this_rq()->prev_steal_time即得出当前的steal time,然后累加到kcpustat_this_cpu->cpustat[CPUTIME_STEAL],同时刷新this_rq()->prev_steal_time,而kcpustat_this_cpu则是top命令看到的st数据的来源。static __always_inline bool steal_account_process_tick(void){#ifdef CONFIG_PARAVIRTif (static_key_false(¶virt_steal_enabled)) {u64 steal;cputime_t steal_ct;//获取steal timesteal = paravirt_steal_clock(smp_processor_id());//减去上次更新的steal time就得到这次时间片(伪概念)内的steal timesteal -= this_rq()->prev_steal_time;/* * cputime_t may be less precise than nsecs (eg: if it's * based on jiffies). Lets cast the result to cputime * granularity and account the rest on the next rounds. */steal_ct = nsecs_to_cputime(steal);//再次刷新prev_steal_time,其实就是第一次的steal直接赋值更快this_rq()->prev_steal_time += cputime_to_nsecs(steal_ct);//将结果赋值到kcpustat_this_cpuaccount_steal_time(steal_ct);return steal_ct;}#endifreturn false;}另外一个调用paravirt_steal_clock是update_rq_clock_task,用来更新队列中的clock_task,先看调用它的update_rq_clock,update_rq_clock_task的入参delta来自sched_clock_cpu(cpu_of(rq)) - rq->clock,如果config中CONFIG_PARAVIRT_TIME_ACCOUNTING=y,update_rq_clock_task则会在delta中减去steal time,赋值给clock_task。void update_rq_clock(struct rq *rq){s64 delta;lockdep_assert_held(&rq->lock);if (rq->clock_skip_update & RQCF_ACT_SKIP)return;delta = sched_clock_cpu(cpu_of(rq)) - rq->clock;if (delta clock += delta;update_rq_clock_task(rq, delta);}static void update_rq_clock_task(struct rq *rq, s64 delta){#if defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)s64 steal = 0, irq_delta = 0;#endif#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTINGif (static_key_false((¶virt_steal_rq_enabled))) {steal = paravirt_steal_clock(cpu_of(rq));steal -= rq->prev_steal_time_rq;if (unlikely(steal > delta))steal = delta;rq->prev_steal_time_rq += steal;delta -= steal;}#endifrq->clock_task += delta;}通过观察clock_task的调用者就可以发现,clock_task则是进程调度中rq计算task运行时间的重要数据,如此看就是steal time是被guest可以意识到的时间,但这个时间不被计算到具体的调度队列的运行时间中,虚拟化下guest中的task调度正常。最后留下的疑问就是steal_time的每CPU变量是如何刷新的,在kvm_vcpu_arch下有下面的一个结构体struct {u64 msr_val;u64 last_steal;u64 accum_steal;struct gfn_to_hva_cache stime;struct kvm_steal_time steal;} st;在vcpu_enter_guest函数中,有record_steal_time,其他地方还有另外一个函数,accumulate_steal_time,它们的调用关系如下kvm_vcpu_ioctl->vcpu_load->kvm_arch_vcpu_load->accumulate_steal_timekvm_vcpu_ioctl->kvm_arch_vcpu_ioctl_run->vcpu_run->vcpu_enter_guest->record_steal_time也就是说accumulate_steal_time必然在record_steal_time之前执行,最新的4.4代码直接把accumulate_steal_time放到了record_steal_time函数的最前面。accumulate_steal_time函数顾名思义,计算steal time,只有3行重点delta = current->sched_info.run_delay - vcpu->arch.st.last_steal;vcpu->arch.st.last_steal = current->sched_info.run_delay;vcpu->arch.st.accum_steal = delta;先理解run_delay是什么,"在运行队列上等待的时间"?#ifdef CONFIG_SCHED_INFOstruct sched_info {/* cumulative counters */unsigned long pcount; /* # of times run on this cpu */unsigned long long run_delay; /* time spent waiting on a runqueue *//* timestamps */unsigned long long last_arrival,/* when we last ran on a cpu */ last_queued;/* when we were last queued to run */};#endif /* CONFIG_SCHED_INFO */那么,current->sched_info.run_delay就是qemu的run_delay,也就是陷入到guest中的时间,那么在t5时刻(每次enter到guest中的时候),current->sched_info.run_delay=t2-t1+t4-t3,而vcpu->arch.st.last_steal则是上次enter guest时(t3时刻)的run_delay,即t2-t1,那么本次时间段的steal time则是vcpu->arch.st.accum_steal=t4-t3。这样就将当前时间段内的steal time存储到accum_steal中。再看record_steal_time函数,此处使用了kvm_read_guest_cached和kvm_write_guest_cached,本质就是直接读取或写入guest的某段内存,涉及到gfn_to_hva_cache结构体,因为写入的gfn2hva映射关系一般是不变的,所以不需要在guest重复转换浪费计算能力,vcpu->arch.st.stime的gfn_to_hva_cache结构体是在kvm_set_msr_common函数下MSR_KVM_STEAL_TIME case下初始化的,函数是case MSR_KVM_STEAL_TIME:if (unlikely(!sched_info_on()))return 1;if (data & KVM_STEAL_RESERVED_MASK)return 1;//下面的kvm_gfn_to_hva_cache_init中第三个入参是gpa,前面提到把steal_time//的每CPU变量的物理地址注册到MSR_KVM_STEAL_TIME中,此处则data则是//MSR_KVM_STEAL_TIME索引的msr的值,即每CPU变量的物理地址if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.st.stime,data & KVM_STEAL_VALID_BITS,sizeof(struct kvm_steal_time)))return 1;vcpu->arch.st.msr_val = data;vcpu->arch.st.last_steal = current->sched_info.run_delay;break;kvm_gfn_to_hva_cache_init就是纯粹的转换,不提。回到record_steal_time,kvm_read_guest_cached本质就是__copy_from_user,拷贝到vcpu->arch.st.stime,然后加上vcpu->arch.st.accum_steal,赋值给vcpu->arch.st.steal.steal,然后再通过kvm_write_guest_cached函数写入到guest中的映射地址中,这样就和steal_time每CPU变量对应起来了。if (unlikely(kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,&vcpu->arch.st.steal, sizeof(struct kvm_steal_time))))return;vcpu->arch.st.steal.steal += vcpu->arch.st.accum_steal;vcpu->arch.st.steal.version += 2;vcpu->arch.st.accum_steal = 0;kvm_write_guest_cached(vcpu->kvm, &vcpu->arch.st.stime,&vcpu->arch.st.steal, sizeof(struct kvm_steal_time));KVM下steal_time源代码分析来自于OenHan链接为:
2025-04-09Priority of a given thread arbitrarily, as long as it is equal to or greater than the BasePriority value for that thread.On Windows NT, numeric priority values range between 0 and 31 , although the value 0 is reserved by the OS. Thus, no threads, except specially designated OS threads, may use this priority. This range is divided into two categories: dynamic priorities and real-time priorities.Dynamic priorities are values between 1 and 15. They are referred to as "dynamic" because the OS varies the priority of threads in this range. Thus, for example, it is not possible for a thread in this range to steal the CPU and cause starvation of other threads that are waiting to run.Real-time priorities are values between 16 and 31 . They are referred to as real-time because the OS does not vary the priority of threads in this range. Real-time range threads can continue to control the CPU, as long as no other threads of equal or higher priority are scheduled. Thus, it is possible for a real-time thread to steal the CPU and cause starvation of other threads that are waiting to run.For either dynamic or real-time priorities, the BasePriority is established when the thread is first created and may be programmatically adjusted via such calls as KeSetBasePriorityThread().For dynamic threads, the Priority starts out equal to the BasePriority , but may be adjusted by the OS. For example during I/O completion IoCompleteRequest(), KeSetEvent(), Quantum exhaustion.For real-time threads, the OS never adjusts the Priority
2025-04-07Cores by the system and user processes.The percentage of CPU used for interrupt requests. ('irq')The next value is the idle percentage for all the cores combined.The following value denotes the waiting each CPU core had to do.Next up is the percentage for the steal time.'guest' denotes the guest-percentage, which is the CPU time spent on other virtual machines.The last two values indicate the current frequency of the CPU.Now, the 'atop' displays the above statistics for each core independently.CPL - refers to as CPU Load.The first three values are the average loads with different periods: 1, 5, and 15 minutes.This is followed by the number of context switches ('csw')Next up is the number of interrupts ('intr')The last value is number of available CPUs.MEM - Memory UtilizationThe total physical memory supported.The memory currently free.The current cache memory.'buff' as in “buffer” is the amount of memory consumed in filesystem meta-data.The sum of memory for kernel’s memory allocation shown as 'slab'.The amount of shared memory.SWP - Swap Memory.DSK - Disk usageThe first value denotes the percentage of time the system is busy handling requests.The reading requests issued.The writing requests issued.The rate at which data (in KB) is read per reading request.The rate at which data (in KB) is written per writing request.The next two values are time rates for reading and writing on the disk in Megabytes.The last value is the average number of milliseconds spent in handling requests.NET - Network Statistics at the Transport Layer'transport' signifies the Transport layer in Networking, which deals with the data protocols.The number of segments received by the system following the TCP protocol. ('tcpi')The number of segments transmitted. ('tcpo')The similar statistics for UCP protocol. ('udpi' for UDP in) and ('udpo' for UDP out).'tcpao' is the number of active TCP open connections.Opposite to previous 'tcppo' is the number of
2025-03-25KVM下steal_time源代码分析代码版本: branch v4.3刚好有人在其他文章评论下问到steal_time机制,顺便看了一下,总结如下。steal_time原意是指在虚拟化环境下,hypervisor窃取的vm中的时间,严格讲就是VCPU没有运行的时间。在guest中执行top选项,就可以看到一个st数据[email protected] ~$ toptop - 21:04:12 up 1:24, 2 users, load average: 0.45, 0.31, 0.22Tasks: 268 total, 1 running, 267 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.5 us, 0.2 sy, 0.3 ni, 98.0 id, 0.9 wa, 0.0 hi, 0.0 si,0.0 stst数据的意义是给guest看到了自己真正占用CPU的时间比例,让guest根据st调整自己的行为,以免影响业务,如果st值比较高,则说明hostvm的CPU比例太小,整个hypervisor的任务比较繁重,有些高计算任务可以跟着自我限制。同时KVM的doc文件描述如下:MSR_KVM_STEAL_TIME: 0x4b564d03data: 64-byte alignment physical address of a memory area which must be in guest RAM, plus an enable bit in bit 0. This memory is expected to hold a copy of the following structure:struct kvm_steal_time { __u64 steal;__u32 version;__u32 flags;__u32 pad[12]; }whose data will be filled in by the hypervisor periodically. Only one write, or registration, is needed for each VCPU. The interval between updates of this structure is arbitrary and implementation-dependent.The hypervisor may update this structure at any time it sees fit until anything with bit0 == 0 is written to it. Guest is required to make sure this structure is initialized to zero.Fields have the following meanings:version: a sequence counter. In other words, guest has to check this field before and after grabbing time information and make sure they are both equal and even. An odd version indicates an in-progress update.flags: At this point, always zero. May be used to indicate changes in this structure in the future.steal: the amount of time in which this vCPU did not run, in nanoseconds. Time during which the vcpu is idle, will not be reported as steal time.下面看一下具体的源代码实现:先说guest端的代码,steal_time本身是一个PV实现,这个应该是在AWS(XEN)开发出来后又搬到KVM上的,因为本身kernel不存在这个功能,算是修改kernel,归到PV里面了,所有一般编译内核的时候要保证CONFIG_PARAVIRT=y即开关打开。cat /boot/config-4.2.6 | grep CONFIG_PARAVIRTCONFIG_PARAVIRT=y在guest kernel启动的过程中,内核初始化调用setup_arch,然后是kvm_guest_init,先调用kvm_para_available判断是否是KVM虚拟化环境,原理就是根据CPUID查询的字符串是否有"KVMKVMKVM",然后又将kvm_steal_clock注册到steal_clock,if (kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {has_steal_clock = 1;pv_time_ops.steal_clock = kvm_steal_clock;}在CONFIG_SMP不同的情况下分叉,但最后都是调用kvm_guest_cpu_init,进入kvm_register_steal_time函数,kvm_register_steal_time做了一件事,即把steal_time的每CPU变量的物理地址注册到MSR_KVM_STEAL_TIME中,如下static DEFINE_PER_CPU(struct kvm_steal_time, steal_time) __aligned(64);static void kvm_register_steal_time(void){int cpu = smp_processor_id();struct kvm_steal_time
2025-04-13--> --> --> Stay away from fake Afterburner sites Lately, we heard about many phishing Afterburner sites that will steal your data for improper purposes. Please be noted that the correct Afterburner site only exists on msi.com and Guru3D, any other is a fake site. Be careful and stay away from those sites to protect your digital assets. Protection for PC gaming Multiple layers of protection for your devices, game accounts and digital assets. Norton 360 provides powerful layers of protection for your devices and online privacy. It helps guard against malware, and other online threats as you bank, browse and shop online. Password Manager tools help you manage your passwords and online credentials, and PC Cloud Backup,3 helps prevent data loss due to hard drive failures and ransomware. Plus, with our 100% Virus Protection Promise you get your money back if your device gets a virus we can’t remove!2 Maximize your gaming performance with Norton Game Optimizer Level-up your protection without compromising your game. Game Optimizer dedicates the CPU power needed for optimal performance in your game by isolating non-essential apps to a single CPU core. Boost performance and strengthen your PC’s security at the same time. Try Game Optimizer and Norton 360 for Gamers for 30 days free. Game Optimizer Automatically Optimize -Detects full-screen games and feeds them maximum CPU power. Smooth Performance -Helps eliminate FPS lags and slowdowns from your other apps for smooth visuals. Maximize Resources -Free your PC from power-hungry programs running in the background that eat up your system’s resources. Get more performance out of your rig! The MSI trial offer is not available if you have already had another existing cyber security software installed. If you have another cyber security software installed, you will not be able to use our product. Please uninstall
2025-04-17In Rome. The AI is a lot better as well. (Although in Agincourt the French were pretty stupid anyway so that's not saying much. I have yet to see the full power of the AI in combat) The combos are really apparent as well, as I saw one being executed on Henry V (which was pretty devestating, but impressive) the dying of soldiers is a lot more realistic in my view, and the blood effects are awesome! Haven't tried Pavia yet but I will soon.P.S. To any of those who are experincing choppiness even with all grapics settings on low, try turning the shadows off from the options menu via the main menu, that should make thegame a lot smoother, it did with mine. [This message has been edited by Marcus Orentius (edited 10-12-2006 @ 01:53 PM).] Brock88 Legionary posted 12 October 2006 15:02 EDT (US) 87 / 172 Quote:Hi Brock, been some time since I dropped by. I've been green for about a month now (I think).Wow, almost everyone I know has turned green. Come back to OD once in a while k?About this SSE2 thing. M2 is the first game that I heard of that requires this. What exactly is it? It's pretty shitty if people have to buy a new processor to play a game. I mean a top of the line graphic card is about $500, a low end processor will cost you $1000+.Never lie, steal, cheat, or drink. But if you must lie, lie in the arms of the one you love. If you must steal, steal away from bad company. If you must cheat, cheat death. And if you must drink, drink in the moments that take your breath away. Winner of 2005 OD : Best Ownage, Funniest Newbie, and Dinoman Award "Mastering Others is Strength, Mastering yourself makes you fearless -Lao Tzu" Mechstra Banned posted 12 October 2006 15:40 EDT (US) 88 / 172 It's an evolution of MMX, which you may have heard of - back in 1997 it was the coming thing, and some games required it and so on.It then turned out that MMX wasn't all that great and although it's been a part of processors since it hasn't really had any focus placed on it. dsmi1 Legionary posted 13 October 2006 03:13 EDT (US) 89 / 172 hey guys with the CPU-Z thing, which part will tell me if
2025-04-18