linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	boris.ostrovsky@oracle.com, david.vrabel@citrix.com
Subject: Re: [PATCH v3] xen: add steal_clock support on x86
Date: Fri, 20 May 2016 09:17:55 +0200	[thread overview]
Message-ID: <573EBA23.50302@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1605191804480.2452@sstabellini-ThinkPad-X260>

On 19/05/16 19:15, Stefano Stabellini wrote:
> On Thu, 19 May 2016, Juergen Gross wrote:
>> The pv_time_ops structure contains a function pointer for the
>> "steal_clock" functionality used only by KVM and Xen on ARM. Xen on x86
>> uses its own mechanism to account for the "stolen" time a thread wasn't
>> able to run due to hypervisor scheduling.
>>
>> Add support in Xen arch independent time handling for this feature by
>> moving it out of the arm arch into drivers/xen and remove the x86 Xen
>> hack.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> V3: add #include <asm/paravirt.h> to avoid build error on arm
>> V2: remove the x86 do_stolen_accounting() hack
>> ---
>>  arch/arm/xen/enlighten.c    | 17 ++---------------
>>  arch/x86/xen/time.c         | 44 ++------------------------------------------
>>  drivers/xen/time.c          | 20 ++++++++++++++++++++
>>  include/linux/kernel_stat.h |  1 -
>>  include/xen/xen-ops.h       |  1 +
>>  kernel/sched/cputime.c      | 10 ----------
>>  6 files changed, 25 insertions(+), 68 deletions(-)
>>
>> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
>> index 75cd734..9163b94 100644
>> --- a/arch/arm/xen/enlighten.c
>> +++ b/arch/arm/xen/enlighten.c
>> @@ -84,19 +84,6 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
>>  }
>>  EXPORT_SYMBOL_GPL(xen_unmap_domain_gfn_range);
>>  
>> -static unsigned long long xen_stolen_accounting(int cpu)
>> -{
>> -	struct vcpu_runstate_info state;
>> -
>> -	BUG_ON(cpu != smp_processor_id());
>> -
>> -	xen_get_runstate_snapshot(&state);
>> -
>> -	WARN_ON(state.state != RUNSTATE_running);
>> -
>> -	return state.time[RUNSTATE_runnable] + state.time[RUNSTATE_offline];
>> -}
>> -
>>  static void xen_read_wallclock(struct timespec64 *ts)
>>  {
>>  	u32 version;
>> @@ -355,8 +342,8 @@ static int __init xen_guest_init(void)
>>  
>>  	register_cpu_notifier(&xen_cpu_notifier);
>>  
>> -	pv_time_ops.steal_clock = xen_stolen_accounting;
>> -	static_key_slow_inc(&paravirt_steal_enabled);
>> +	xen_time_setup_guest();
> 
> You can remove
> 
> #include <asm/paravirt.h>
> 
> from headers now I believe

Correct. Done.

>> diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
>> index 25a822f..44fda64 100644
>> --- a/include/linux/kernel_stat.h
>> +++ b/include/linux/kernel_stat.h
>> @@ -92,7 +92,6 @@ static inline void account_process_tick(struct task_struct *tsk, int user)
>>  extern void account_process_tick(struct task_struct *, int user);
>>  #endif
>>  
>> -extern void account_steal_ticks(unsigned long ticks);
>>  extern void account_idle_ticks(unsigned long ticks);
>>  
>>  #endif /* _LINUX_KERNEL_STAT_H */
>> diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
>> index 86abe07..5ce51c2 100644
>> --- a/include/xen/xen-ops.h
>> +++ b/include/xen/xen-ops.h
>> @@ -21,6 +21,7 @@ void xen_resume_notifier_unregister(struct notifier_block *nb);
>>  
>>  bool xen_vcpu_stolen(int vcpu);
>>  void xen_setup_runstate_info(int cpu);
>> +void __init xen_time_setup_guest(void);
> 
> please avoid __init in headers

Okay.


Juergen

      parent reply	other threads:[~2016-05-20  7:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 13:26 [PATCH v3] xen: add steal_clock support on x86 Juergen Gross
2016-05-19 13:43 ` Boris Ostrovsky
2016-05-19 13:55 ` Juergen Gross
2016-05-19 17:15 ` Stefano Stabellini
2016-05-19 17:17   ` Stefano Stabellini
2016-05-20  7:17   ` Juergen Gross [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573EBA23.50302@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).