lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74cac066-e3e8-7bbf-fb9c-b3709fb7ee0b@de.ibm.com>
Date:   Wed, 21 Apr 2021 09:02:41 +0200
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     Sean Christopherson <seanjc@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Cc:     Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Michael Tokarev <mjt@....msk.ru>
Subject: Re: [PATCH v3 4/9] sched/vtime: Move vtime accounting external
 declarations above inlines



On 16.04.21 00:21, Sean Christopherson wrote:
> Move the blob of external declarations (and their stubs) above the set of
> inline definitions (and their stubs) for vtime accounting.  This will
> allow a future patch to bring in more inline definitions without also
> having to shuffle large chunks of code.
> 
> No functional change intended.
> 
> Signed-off-by: Sean Christopherson<seanjc@...gle.com>

Reviewed-by: Christian Borntraeger <borntraeger@...ibm.com>

> ---
>   include/linux/vtime.h | 94 +++++++++++++++++++++----------------------
>   1 file changed, 47 insertions(+), 47 deletions(-)
> 
> diff --git a/include/linux/vtime.h b/include/linux/vtime.h
> index 041d6524d144..6a4317560539 100644
> --- a/include/linux/vtime.h
> +++ b/include/linux/vtime.h
> @@ -10,53 +10,6 @@
>   
>   struct task_struct;
>   
> -/*
> - * vtime_accounting_enabled_this_cpu() definitions/declarations
> - */
> -#if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE)
> -
> -static inline bool vtime_accounting_enabled_this_cpu(void) { return true; }
> -extern void vtime_task_switch(struct task_struct *prev);
> -
> -#elif defined(CONFIG_VIRT_CPU_ACCOUNTING_GEN)
> -
> -/*
> - * Checks if vtime is enabled on some CPU. Cputime readers want to be careful
> - * in that case and compute the tickless cputime.
> - * For now vtime state is tied to context tracking. We might want to decouple
> - * those later if necessary.
> - */
> -static inline bool vtime_accounting_enabled(void)
> -{
> -	return context_tracking_enabled();
> -}
> -
> -static inline bool vtime_accounting_enabled_cpu(int cpu)
> -{
> -	return context_tracking_enabled_cpu(cpu);
> -}
> -
> -static inline bool vtime_accounting_enabled_this_cpu(void)
> -{
> -	return context_tracking_enabled_this_cpu();
> -}
> -
> -extern void vtime_task_switch_generic(struct task_struct *prev);
> -
> -static inline void vtime_task_switch(struct task_struct *prev)
> -{
> -	if (vtime_accounting_enabled_this_cpu())
> -		vtime_task_switch_generic(prev);
> -}
> -
> -#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
> -
> -static inline bool vtime_accounting_enabled_cpu(int cpu) {return false; }
> -static inline bool vtime_accounting_enabled_this_cpu(void) { return false; }
> -static inline void vtime_task_switch(struct task_struct *prev) { }
> -
> -#endif
> -
>   /*
>    * Common vtime APIs
>    */
> @@ -94,6 +47,53 @@ static inline void vtime_account_hardirq(struct task_struct *tsk) { }
>   static inline void vtime_flush(struct task_struct *tsk) { }
>   #endif
>   
> +/*
> + * vtime_accounting_enabled_this_cpu() definitions/declarations
> + */
> +#if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE)
> +
> +static inline bool vtime_accounting_enabled_this_cpu(void) { return true; }
> +extern void vtime_task_switch(struct task_struct *prev);
> +
> +#elif defined(CONFIG_VIRT_CPU_ACCOUNTING_GEN)
> +
> +/*
> + * Checks if vtime is enabled on some CPU. Cputime readers want to be careful
> + * in that case and compute the tickless cputime.
> + * For now vtime state is tied to context tracking. We might want to decouple
> + * those later if necessary.
> + */
> +static inline bool vtime_accounting_enabled(void)
> +{
> +	return context_tracking_enabled();
> +}
> +
> +static inline bool vtime_accounting_enabled_cpu(int cpu)
> +{
> +	return context_tracking_enabled_cpu(cpu);
> +}
> +
> +static inline bool vtime_accounting_enabled_this_cpu(void)
> +{
> +	return context_tracking_enabled_this_cpu();
> +}
> +
> +extern void vtime_task_switch_generic(struct task_struct *prev);
> +
> +static inline void vtime_task_switch(struct task_struct *prev)
> +{
> +	if (vtime_accounting_enabled_this_cpu())
> +		vtime_task_switch_generic(prev);
> +}
> +
> +#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
> +
> +static inline bool vtime_accounting_enabled_cpu(int cpu) {return false; }
> +static inline bool vtime_accounting_enabled_this_cpu(void) { return false; }
> +static inline void vtime_task_switch(struct task_struct *prev) { }
> +
> +#endif
> +
>   
>   #ifdef CONFIG_IRQ_TIME_ACCOUNTING
>   extern void irqtime_account_irq(struct task_struct *tsk, unsigned int offset);
> -- 2.31.1.368.gbe11c130af-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ