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 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 BCD12C10F28 for ; Mon, 9 Mar 2020 09:54:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7260720674 for ; Mon, 9 Mar 2020 09:54:19 +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="R5tqW9+V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7260720674 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 0E2316B0003; Mon, 9 Mar 2020 05:54:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06A246B0006; Mon, 9 Mar 2020 05:54:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E50426B0007; Mon, 9 Mar 2020 05:54:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id C69556B0003 for ; Mon, 9 Mar 2020 05:54:18 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7CB97181AC9C6 for ; Mon, 9 Mar 2020 09:54:18 +0000 (UTC) X-FDA: 76575363396.02.cloud41_5fb8d06e8a11e X-HE-Tag: cloud41_5fb8d06e8a11e X-Filterd-Recvd-Size: 6809 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Mar 2020 09:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1583747658; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=zNNy4OU4z799DFnGrpM43KDZz+dFPqGX2kfMxUq+JC4=; b=R5tqW9+Vl4wvfB1UwuMLs1deDiqDEUhyaznG6wJpuUMNQ9MMcveTGi5n rbsjdqhUxPteYCvZjScD7/U9HATSCTy8OPUgL5I7Mxl33kFhV1DIKETW0 /R7tKwi0amXYm6p4Byk8zwjt7mo/sHw+sdzIo07pY9ECX2tjsMFLMNHXg E=; Authentication-Results: esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.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=esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: do3ZdpTCHyvaP5/SysNyQ6OvX1Aj0Ge4f7a/KYeItfaoREnOoclQ+3UyK3UmAERmfHfgoT/FiQ LR9MObLUIfhV2BPRhBPXshsMWzuwO3v4tN81Aoi937geQXN+15Jjn0MKQSjxZacs9yopW4nPAZ uDUMrTz2AwTvII9JUzZilZZKcERwlF4UumWQAdnHNAvCe+/bSVdDDablLPGbDI7n3on4l9R4+J +es1+SHgHi13FosRMxuLOY1+8VoFhR3maY5sz1tdbvfoZ26Su//Y7lr5QmSGj1zs92DuWGF43J BJY= X-SBRS: 2.7 X-MesageID: 13805261 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,532,1574139600"; d="scan'208";a="13805261" Date: Mon, 9 Mar 2020 10:54:07 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Anchal Agarwal CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [RFC PATCH v3 06/12] xen-blkfront: add callbacks for PM suspend and hibernation Message-ID: <20200309095245.GY24458@Air-de-Roger.citrite.net> References: <890c404c585d7790514527f0c021056a7be6e748.1581721799.git.anchalag@amazon.com> <20200221142445.GZ4679@Air-de-Roger> <20200306184033.GA25358@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20200306184033.GA25358@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.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, Mar 06, 2020 at 06:40:33PM +0000, Anchal Agarwal wrote: > On Fri, Feb 21, 2020 at 03:24:45PM +0100, Roger Pau Monn=C3=A9 wrote: > > On Fri, Feb 14, 2020 at 11:25:34PM +0000, Anchal Agarwal wrote: > > > blkfront_gather_backend_features(info); > > > /* Reset limits changed by blk_mq_update_nr_hw_queues(). */ > > > blkif_set_queue_limits(info); > > > @@ -2046,6 +2063,9 @@ static int blkif_recover(struct blkfront_info= *info) > > > kick_pending_request_queues(rinfo); > > > } > > > =20 > > > + if (frozen) > > > + return 0; > >=20 > > I have to admit my memory is fuzzy here, but don't you need to > > re-queue requests in case the backend has different limits of indirec= t > > descriptors per request for example? > >=20 > > Or do we expect that the frontend is always going to be resumed on th= e > > same backend, and thus features won't change? > >=20 > So to understand your question better here, AFAIU the maximum number o= f indirect=20 > grefs is fixed by the backend, but the frontend can issue requests with= any=20 > number of indirect segments as long as it's less than the number provid= ed by=20 > the backend. So by your question you mean this max number of MAX_INDIRE= CT_SEGMENTS=20 > 256 on backend can change ? Yes, number of indirect descriptors supported by the backend can change, because you moved to a different backend, or because the maximum supported by the backend has changed. It's also possible to resume on a backend that has no indirect descriptors support at all. > > > @@ -2625,6 +2671,62 @@ static void blkif_release(struct gendisk *di= sk, fmode_t mode) > > > mutex_unlock(&blkfront_mutex); > > > } > > > =20 > > > +static int blkfront_freeze(struct xenbus_device *dev) > > > +{ > > > + unsigned int i; > > > + struct blkfront_info *info =3D dev_get_drvdata(&dev->dev); > > > + struct blkfront_ring_info *rinfo; > > > + /* This would be reasonable timeout as used in xenbus_dev_shutdow= n() */ > > > + unsigned int timeout =3D 5 * HZ; > > > + int err =3D 0; > > > + > > > + info->connected =3D BLKIF_STATE_FREEZING; > > > + > > > + blk_mq_freeze_queue(info->rq); > > > + blk_mq_quiesce_queue(info->rq); > >=20 > > Don't you need to also drain the queue and make sure it's empty? > >=20 > blk_mq_freeze_queue and blk_mq_quiesce_queue should take care of runnin= g HW queues synchronously > and making sure all the ongoing dispatches have finished. Did I underst= and your question right? Can you please add some check to that end? (ie: that there are no pending requests on any queue?) Thanks, Roger.