From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B9B1C433E2 for ; Thu, 4 Jun 2020 18:34:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6578C2087D for ; Thu, 4 Jun 2020 18:34:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="SAaXs7po" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6578C2087D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C9EA480007; Thu, 4 Jun 2020 14:34:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4F128E0006; Thu, 4 Jun 2020 14:34:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B640C80007; Thu, 4 Jun 2020 14:34:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 9CD3C8E0006 for ; Thu, 4 Jun 2020 14:34:01 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3DA221808281C for ; Thu, 4 Jun 2020 18:34:01 +0000 (UTC) X-FDA: 76892378682.02.snake16_5f0be0026d99 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 1EFB91A27EA for ; Thu, 4 Jun 2020 18:34:01 +0000 (UTC) X-HE-Tag: snake16_5f0be0026d99 X-Filterd-Recvd-Size: 6517 Received: from smtp-fw-9101.amazon.com (smtp-fw-9101.amazon.com [207.171.184.25]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 18:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591295641; x=1622831641; h=date:from:to:cc:message-id:references:mime-version: in-reply-to:subject; bh=HTqcTU628wYZT8oBd+ArbsC8bAoTC8fUsqm9xVXgmro=; b=SAaXs7pokykunMTWUj65jwQyokdkFbwc0cGtac2kn5UVn3+HVsvG+gWi RCIQdqIQ0E9upBydp+072qA8IL/Qyn/Uqng4kYlpJGNhu+yOsquCbXQvv EURfAnvUNJHdqggaImjBcUiZo70kqda3l4ioZlU0JL71TlhMJOChO1hNS o=; IronPort-SDR: Bp9sXjz5OL6Qmgdn1t2NjI2Ij78oRPs1ANk1UfVNxYHuSJrPGMGuWQ5o01KOARrU4ThWIT/DpG g10L4tLv3oVA== X-IronPort-AV: E=Sophos;i="5.73,472,1583193600"; d="scan'208";a="41639696" Subject: Re: [PATCH 09/12] x86/xen: save and restore steal clock Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 04 Jun 2020 18:33:58 +0000 Received: from EX13MTAUEB002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com (Postfix) with ESMTPS id 2AEAAA22B6; Thu, 4 Jun 2020 18:33:56 +0000 (UTC) Received: from EX13D08UEB004.ant.amazon.com (10.43.60.142) by EX13MTAUEB002.ant.amazon.com (10.43.60.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Jun 2020 18:33:36 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D08UEB004.ant.amazon.com (10.43.60.142) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Jun 2020 18:33:36 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 4 Jun 2020 18:33:36 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 5663D403BB; Thu, 4 Jun 2020 18:33:36 +0000 (UTC) Date: Thu, 4 Jun 2020 18:33:36 +0000 From: Anchal Agarwal To: Boris Ostrovsky CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Message-ID: <20200604183336.GA25251@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> References: <6f39a1594a25ab5325f34e1e297900d699cd92bf.1589926004.git.anchalag@amazon.com> <5edb4147-af12-3a0e-e8f7-5b72650209ac@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5edb4147-af12-3a0e-e8f7-5b72650209ac@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 1EFB91A27EA X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, May 30, 2020 at 07:44:06PM -0400, Boris Ostrovsky wrote: > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. > > > > On 5/19/20 7:28 PM, Anchal Agarwal wrote: > > From: Munehisa Kamata > > > > Save steal clock values of all present CPUs in the system core ops > > suspend callbacks. Also, restore a boot CPU's steal clock in the system > > core resume callback. For non-boot CPUs, restore after they're brought > > up, because runstate info for non-boot CPUs are not active until then. > > > > Signed-off-by: Munehisa Kamata > > Signed-off-by: Anchal Agarwal > > --- > > arch/x86/xen/suspend.c | 13 ++++++++++++- > > arch/x86/xen/time.c | 3 +++ > > 2 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c > > index 784c4484100b..dae0f74f5390 100644 > > --- a/arch/x86/xen/suspend.c > > +++ b/arch/x86/xen/suspend.c > > @@ -91,12 +91,20 @@ void xen_arch_suspend(void) > > static int xen_syscore_suspend(void) > > { > > struct xen_remove_from_physmap xrfp; > > - int ret; > > + int cpu, ret; > > > > /* Xen suspend does similar stuffs in its own logic */ > > if (xen_suspend_mode_is_xen_suspend()) > > return 0; > > > > + for_each_present_cpu(cpu) { > > + /* > > + * Nonboot CPUs are already offline, but the last copy of > > + * runstate info is still accessible. > > + */ > > + xen_save_steal_clock(cpu); > > + } > > + > > xrfp.domid = DOMID_SELF; > > xrfp.gpfn = __pa(HYPERVISOR_shared_info) >> PAGE_SHIFT; > > > > @@ -118,6 +126,9 @@ static void xen_syscore_resume(void) > > > > pvclock_resume(); > > > Doesn't make any difference but I think since this patch is where you > are dealing with clock then pvclock_resume() should be added here and > not in the earlier patch. > > > -boris I think the reason it may be in previous patch because it was a part of syscore_resume and steal clock fix came in later. It could me moved to this patch that deals with all clock stuff. -Anchal > > > > > > + /* Nonboot CPUs will be resumed when they're brought up */ > > + xen_restore_steal_clock(smp_processor_id()); > > + > > gnttab_resume(); > > } > > > > diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c > > index c8897aad13cd..33d754564b09 100644 > > --- a/arch/x86/xen/time.c > > +++ b/arch/x86/xen/time.c > > @@ -545,6 +545,9 @@ static void xen_hvm_setup_cpu_clockevents(void) > > { > > int cpu = smp_processor_id(); > > xen_setup_runstate_info(cpu); > > + if (cpu) > > + xen_restore_steal_clock(cpu); > > + > > /* > > * xen_setup_timer(cpu) - snprintf is bad in atomic context. Hence > > * doing it xen_hvm_cpu_notify (which gets called by smp_init during > > >