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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 13CECC35654 for ; Fri, 21 Feb 2020 10:21:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC14A207FD for ; Fri, 21 Feb 2020 10:21:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="RWP5If6b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC14A207FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 69AAE6B0003; Fri, 21 Feb 2020 05:21:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 675A26B0006; Fri, 21 Feb 2020 05:21:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55F936B0007; Fri, 21 Feb 2020 05:21:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 3F45B6B0003 for ; Fri, 21 Feb 2020 05:21:42 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D7866181AEF1A for ; Fri, 21 Feb 2020 10:21:41 +0000 (UTC) X-FDA: 76513742802.21.coat52_48eba70a32b3d X-HE-Tag: coat52_48eba70a32b3d X-Filterd-Recvd-Size: 9010 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Feb 2020 10:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1582280501; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=szw5kUCBwfMR4Umcye1UsaTnnWME1Rw3d5ErMmAgp5Q=; b=RWP5If6bDszdL2u4zJW+07sV680phpbBMaET8vWqndJLacCf/7RXxazu YSSYX+324nweleImwaQ4LNzjrR7QQx2CjlC++ldVIuLCp+gRfDucCmpLR LqndQ0f6MASAoCQhrqDMjMhypI6EAanGmDPk4x0hHyCKpga2CQY5UC0t5 k=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: QEFBJckE/MYkvO2flXPlpJQt4Otkt0cu31Hi8oseCOIldyuYhI4sG/WgtjoU3dqM8aobRm4cza BxgWJnLKK6ZDvkNxA2rHcJKaR9vO6P7KJs3kG9lY1MfghynCwXfmNppiLeicgubrKuiqo1Fp/3 pT0BMg+orHucSFRXhRTwIVHLS35iD+RLBJkiXqk4tRcaujIhh9XTXNUi/k+EbebNfX3kzbj8BJ L/ofjVQpTcO38wip8DTDbTm9fbWxG9KrnTUIm30Odti4icb8IAzr0zDY/JpPQYsftQMCxbG/61 qk0= X-SBRS: 2.7 X-MesageID: 12791624 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,467,1574139600"; d="scan'208";a="12791624" Date: Fri, 21 Feb 2020 11:21:30 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: "Durrant, Paul" CC: "Agarwal, Anchal" , "Valentin, Eduardo" , "len.brown@intel.com" , "peterz@infradead.org" , "benh@kernel.crashing.org" , "x86@kernel.org" , "linux-mm@kvack.org" , "pavel@ucw.cz" , "hpa@zytor.com" , "tglx@linutronix.de" , "sstabellini@kernel.org" , "fllinden@amaozn.com" , "Kamata, Munehisa" , "mingo@redhat.com" , "xen-devel@lists.xenproject.org" , "Singh, Balbir" , "axboe@kernel.dk" , "konrad.wilk@oracle.com" , "bp@alien8.de" , "boris.ostrovsky@oracle.com" , "jgross@suse.com" , "netdev@vger.kernel.org" , "linux-pm@vger.kernel.org" , "rjw@rjwysocki.net" , "linux-kernel@vger.kernel.org" , "vkuznets@redhat.com" , "davem@davemloft.net" , "Woodhouse, David" Subject: Re: [Xen-devel] [RFC PATCH v3 06/12] xen-blkfront: add callbacks for PM suspend and hibernation Message-ID: <20200221102130.GW4679@Air-de-Roger> References: <20200218091611.GN4679@Air-de-Roger> <20200219180424.GA17584@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> <20200220083904.GI4679@Air-de-Roger> <20200220154507.GO4679@Air-de-Roger> <20200220164839.GR4679@Air-de-Roger> <20200221092219.GU4679@Air-de-Roger> <5ddf980a3fba4fb39571184e688cefc5@EX13D32EUC003.ant.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <5ddf980a3fba4fb39571184e688cefc5@EX13D32EUC003.ant.amazon.com> X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL01.citrite.net (10.69.22.125) Content-Transfer-Encoding: quoted-printable 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 Fri, Feb 21, 2020 at 09:56:54AM +0000, Durrant, Paul wrote: > > -----Original Message----- > > From: Roger Pau Monn=C3=A9 > > Sent: 21 February 2020 09:22 > > To: Durrant, Paul > > Cc: Agarwal, Anchal ; Valentin, Eduardo > > ; len.brown@intel.com; peterz@infradead.org; > > benh@kernel.crashing.org; x86@kernel.org; linux-mm@kvack.org; > > pavel@ucw.cz; hpa@zytor.com; tglx@linutronix.de; sstabellini@kernel.o= rg; > > fllinden@amaozn.com; Kamata, Munehisa ; > > mingo@redhat.com; xen-devel@lists.xenproject.org; Singh, Balbir > > ; axboe@kernel.dk; konrad.wilk@oracle.com; > > bp@alien8.de; boris.ostrovsky@oracle.com; jgross@suse.com; > > netdev@vger.kernel.org; linux-pm@vger.kernel.org; rjw@rjwysocki.net; > > linux-kernel@vger.kernel.org; vkuznets@redhat.com; davem@davemloft.ne= t; > > Woodhouse, David > > Subject: Re: [Xen-devel] [RFC PATCH v3 06/12] xen-blkfront: add callb= acks > > for PM suspend and hibernation > >=20 > > On Thu, Feb 20, 2020 at 05:01:52PM +0000, Durrant, Paul wrote: > > > > > Hopefully what I said above illustrates why it may not be 100% > > common. > > > > > > > > Yes, that's fine. I don't expect it to be 100% common (as I guess > > > > that the hooks will have different prototypes), but I expect > > > > that routines can be shared, and that the approach taken can be t= he > > > > same. > > > > > > > > For example one necessary difference will be that xenbus initiate= d > > > > suspend won't close the PV connection, in case suspension fails. = On PM > > > > suspend you seem to always close the connection beforehand, so yo= u > > > > will always have to re-negotiate on resume even if suspension fai= led. > > > > > > > > What I'm mostly worried about is the different approach to ring > > > > draining. Ie: either xenbus is changed to freeze the queues and d= rain > > > > the shared rings, or PM uses the already existing logic of not > > > > flushing the rings an re-issuing in-flight requests on resume. > > > > > > > > > > Yes, that's needs consideration. I don=E2=80=99t think the same sem= antic can be > > suitable for both. E.g. in a xen-suspend we need to freeze with as li= ttle > > processing as possible to avoid dirtying RAM late in the migration cy= cle, > > and we know that in-flight data can wait. But in a transition to S4 w= e > > need to make sure that at least all the in-flight blkif requests get > > completed, since they probably contain bits of the guest's memory ima= ge > > and that's not going to get saved any other way. > >=20 > > Thanks, that makes sense and something along this lines should be > > added to the commit message IMO. > >=20 > > Wondering about S4, shouldn't we expect the queues to already be > > empty? As any subsystem that wanted to store something to disk should > > make sure requests have been successfully completed before > > suspending. >=20 > What about writing the suspend image itself? Normal filesystem I/O > will have been flushed of course, but whatever vestigial kernel > actually writes out the hibernation file may well expect a final > D0->D3 on the storage device to cause a flush. Hm, I have no idea really. I think whatever writes to the disk before suspend should actually make sure requests have completed, but what you suggest might also be a possibility. Can you figure out whether there are requests on the ring or in the queue before suspending? > Again, I don't know the specifics for Linux (and Windows actually > uses an incarnation of the crash kernel to do the job, which brings > with it a whole other set of complexity as far as PV drivers go). That seems extremely complex, I'm sure there's a reason for it :). Thanks, Roger.