|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v4] plat/*: Make timer interrupt frequency selectable
On 11/7/18 11:11 AM, Costin Lupu wrote: Hi Yuri, Thanks for your review. Please see my comments inline. On 11/5/18 7:47 PM, Yuri Volchkov wrote:Hi Florian, generally looks good to me, just a couple of comments inline. - Yuri. Florian Schmidt <florian.schmidt@xxxxxxxxx> writes:Add new configuration options for choosing a timer interrupt frequency. The configured frequency is converted to the timer tick length which can be of use for other modules (e.g., preemptive schedulers). Previously, the tick was 100 Hz on KVM and 1000 Hz on Xen. The default value is now 100 Hz across both platforms. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx> --- include/uk/arch/time.h | 2 ++ include/uk/plat/time.h | 4 ++++ plat/Config.uk | 7 +++++++ plat/kvm/x86/tscclock.c | 10 ++++------ plat/linuxu/include/linuxu/time.h | 3 ++- plat/linuxu/time.c | 2 -- plat/xen/x86/arch_time.c | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/uk/arch/time.h b/include/uk/arch/time.h index 262fd3b..5a5aa22 100644 --- a/include/uk/arch/time.h +++ b/include/uk/arch/time.h @@ -57,6 +57,8 @@ typedef __s64 __snsec; #define __SNSEC_MAX (__S64_MAX) #define __SNSEC_MIN (__S64_MIN)+#define NSEC_PER_SEC 1000000000ULLNow, since it is in the public header, should we add a prefix to the define to avoid possible conflicts?I'd rather revert this change and keep it for a next patch because: - It's also defined in plat/common/arm/time.c - In deed it needs a prefix, but it shouldn't have anything to do with arch since it's just an utility definition, just like the ukarch_time_nsec_to_* macros. I'd rather move all these time related definitions into a time library. And since we have uktimeconv, I would even rename that to uktime and use it as the library for all time functions in Unikraft. The idea here was that it's not really a unikraft-specific definition, in that it's a fundamental physical variable. A second will always have exactly 1000000000 nanoseconds, no more, no less, nowhere. (Yes, there's adjtime and clock slewing, but that's just silly. ;-) and not my point.) Honestly, any definition of NSEC_PER_SEC that is NOT that value should raise all alarms and transform your computer into a flowerpot. And an equivalent definition in another piece of code would be silently ignored, because it's not really a redefinition, as far as the preprocessor is concerned. Then again, I guess all of those arguments also go for the following macros of ukarch_time_nsec_to_sec etc., so... I'll conform to that and make it UKARCH_TIME_NSEC_TO_SEC if you prefer. The reason I don't want to keep this change outside is that this patch relies on having this definition in several places, so I'd rather leave the definition in include/uk/arch/time.h and make a unified uktime later. Especially considering this patch has been sitting around for what's frankly an embarrassingly long time (not the least due to me letting it fall off my desk), and the treading patch series waits for this patch to go forward. @Simon, what do you think?+ #define ukarch_time_nsec_to_sec(ns) ((ns) / 1000000000ULL) #define ukarch_time_nsec_to_msec(ns) ((ns) / 1000000ULL) #define ukarch_time_nsec_to_usec(ns) ((ns) / 1000UL) diff --git a/include/uk/plat/time.h b/include/uk/plat/time.h index 202e0f9..d38e3c6 100644 --- a/include/uk/plat/time.h +++ b/include/uk/plat/time.h @@ -47,6 +47,10 @@ void ukplat_time_fini(void);__nsec ukplat_monotonic_clock(void); +/* Time tick length */ I'll add that. diff --git a/plat/kvm/x86/tscclock.c b/plat/kvm/x86/tscclock.c index f3fa55a..d3cdb16 100644 --- a/plat/kvm/x86/tscclock.c +++ b/plat/kvm/x86/tscclock.c @@ -60,8 +60,6 @@ #include <uk/assert.h> #include <uk/bitops.h>-#define NSEC_PER_SEC 1000000000ULL OK, gonna add a preprocessor check. I agree it doesn't hurt and works as a sanity check, though we'll be in deep deep troubles WAY before our tick frequency goes beyond 1193182 Hz. ;-) initial_tick = i8254_gettick(); @@ -211,10 +209,10 @@ int tscclock_init(void) -- Dr. Florian Schmidt フローリアン・シュミット Research Scientist, Systems and Machine Learning Group NEC Laboratories Europe Kurfürsten-Anlage 36, D-69115 Heidelberg Tel. +49 (0)6221 4342-265 Fax: +49 (0)6221 4342-155 e-mail: florian.schmidt@xxxxxxxxx ============================================================ Registered at Amtsgericht Mannheim, Germany, HRB728558 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |