/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #ifndef DIE_H #define DIE_H #include #include #include #include #include #include #include #include "built_in.h" static inline void panic(const char *format, ...) __check_format_printf(1, 2); static inline void syslog_panic(const char *format, ...) __check_format_printf(1, 2); static inline void syslog_maybe(int may, int priority, const char *format, ...) __check_format_printf(3, 4); static inline void __noreturn die(void) { exit(EXIT_FAILURE); } static inline void __noreturn _die(void) { _exit(EXIT_FAILURE); } static inline void __noreturn panic(const char *format, ...) { va_list vl; va_start(vl, format); vfprintf(stderr, format, vl); va_end(vl); die(); } static inline void __noreturn syslog_panic(const char *format, ...) { va_list vl; va_start(vl, format); vsyslog(LOG_ERR, format, vl); va_end(vl); die(); } static inline void syslog_maybe(int maybe, int priority, const char *format, ...) { if (!!maybe) { va_list vl; va_start(vl, format); vsyslog(priority, format, vl); va_end(vl); } } #endif /* DIE_H */ on> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@hotmail.com>2016-08-17 10:05:46 +0800
committerIngo Molnar <mingo@kernel.org>2016-08-18 11:19:48 +0200
commit03cbc732639ddcad15218c4b2046d255851ff1e3 (patch)
tree6120b4b2a074f3e212e08ea661baa43b7936ed2c
parent173be9a14f7b2e901cf77c18b1aafd4d672e9d9e (diff)
sched/cputime: Resync steal time when guest & host lose sync
Commit: 57430218317e ("sched/cputime: Count actually elapsed irq & softirq time") ... fixed a bug but also triggered a regression: On an i5 laptop, 4 pCPUs, 4vCPUs for one full dynticks guest, there are four CPU hog processes(for loop) running in the guest, I hot-unplug the pCPUs on host one by one until there is only one left, then observe CPU utilization via 'top' in the guest, it shows: 100% st for cpu0(housekeeping) 75% st for other CPUs (nohz full mode) However, w/o this commit it shows the correct 75% for all four CPUs. When a guest is interrupted for a longer amount of time, missed clock ticks are not redelivered later. Because of that, we should not limit the amount of steal time accounted to the amount of time that the calling functions think have passed. However, the interval returned by account_other_time() is NOT rounded down to the nearest jiffy, while the base interval in get_vtime_delta() it is subtracted from is, so the max cputime limit is required to avoid underflow. This patch fixes the regression by limiting the account_other_time() from get_vtime_delta() to avoid underflow, and lets the other three call sites (in account_other_time() and steal_account_process_time()) account however much steal time the host told us elapsed. Suggested-by: Rik van Riel <riel@redhat.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Radim Krcmar <rkrcmar@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: kvm@vger.kernel.org Link: http://lkml.kernel.org/r/1471399546-4069-1-git-send-email-wanpeng.li@hotmail.com [ Improved the changelog. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>