bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] Add last processor to process stat


From: Samuel Thibault
Subject: Re: [PATCH] Add last processor to process stat
Date: Sun, 27 Oct 2019 20:26:34 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Almudena Garcia, le dim. 27 oct. 2019 20:13:40 +0100, a ecrit:
> > Please really add it to thread_sched_info_t.
> 
> Fixed. Now working in Hurd patch



> --- gnumach/kern/thread.c     2019-09-03 01:22:10.932747830 +0200
> +++ GNUMach_SMP/kern/thread.c 2019-10-27 20:09:10.515836242 +0100
> @@ -1609,6 +1609,18 @@
>           sched_info->depressed = (thread->depress_priority >= 0);
>           sched_info->depress_priority = thread->depress_priority;
>  
> +
> +             /* Check if the sched_info includes all new members (including 
> last_processor) */
> +             if (*thread_info_count >= THREAD_SCHED_INFO_COUNT) {

You'd rather use 8 here, so that if somebody else adds yet another
field things work correctly. Actually, looking at what is done for
THREAD_BASIC_INFO, there is no check there. AIUI that's because the
output message is allocated by the caller to the largest RPC size, so we
can just fill there without having to care actually, drop that if.

You however do need to allow for *thread_info_count ==
THREAD_SCHED_INFO_COUNT-1 above, just similarly to how it is done for
the THREAD_BASIC_INFO case.

> +
> +             #if NCPUS > 1
> +             sched_info->last_processor = thread->last_processor;
> +             #else
> +             sched_info->last_processor = 0;
> +             #endif
> +
> +             }
> +



reply via email to

[Prev in Thread] Current Thread [Next in Thread]