Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1005621ybh; Mon, 13 Jul 2020 07:05:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzycCarGfM9uSFkd7h5GjX8/AdsDJlQuK5qbbbrtgofB8ILxKRKO5t1u8E0KdK3yk0EwGVi X-Received: by 2002:a05:6402:1507:: with SMTP id f7mr33260011edw.37.1594649128707; Mon, 13 Jul 2020 07:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594649128; cv=none; d=google.com; s=arc-20160816; b=Gy1DEPGEn/xQBcWEQoIN3XVi8bw2rPEvnQWAYx1aTdh1prHT8AevvMU0vW1b9gIfxT B5fXdP18wsHeOw8/j6BbBsiX6VZpJpl52Tf/8J+e4D8PBIVDt9JehZnqHiTn/iyqccpE sAS2goAbYTsDpps+VUyBHzUV9X309xq4DIO1Y0cAkT8I/n4KFs1a6oFJHzQrkNv05urg Kb9sCkfTVVNCb4RmfKhSM2u5YzOkV76etJH9h0wqHlLCIMlzqBLawJa3O6j0XVJp3kh1 VJ/3HuH2Pus6QuRQU7TyW5F2IntOT1grzmx5hRZ+M74DdXCK7qvQjR9j6lWTppbHSJx7 GYUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=e/JYAQvdUMLUsPNXyrLDiYLzTwZo/fVkdUuZFhMlWuM=; b=HuzsTBJZ08zfpAqYZL98oZ8VORHmVxHGrUixbKoozxYfngfJDB8iLHyORusG7hUT6C 9Ne9ytH1ONufr49pf08elccS7EaIDzA0lk/11UpDGPw3tIPYjsByX7nzI5ZYrpVcgwGo HHq5UCgs3FL/unYFOin16tmBYmRRS5+YtVncFzrXJ+yeatgzuJleHkAQ85sFrTias/5m AEJ9+tWK5hW/Zko/BjVImY2FeqZt3m/y/hWFOEgI+EPsH8c9G9ZRvf6yFwQI0LzCgQsC 3q/ZzOb84cvWW7TBXVzoZPJGo6spnpjiBfPK3lUkKd/Ck577BwT1GDhxoxXxzhmvl4oR rYjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl28si9060929ejb.353.2020.07.13.07.05.03; Mon, 13 Jul 2020 07:05:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729828AbgGMODl (ORCPT + 99 others); Mon, 13 Jul 2020 10:03:41 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:60886 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729722AbgGMODk (ORCPT ); Mon, 13 Jul 2020 10:03:40 -0400 Received: from 89-64-85-181.dynamic.chello.pl (89.64.85.181) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id c54b7b5dd9a458f8; Mon, 13 Jul 2020 16:03:38 +0200 From: "Rafael J. Wysocki" To: Dan Williams Cc: linux-nvdimm , Greg Kroah-Hartman , "Rafael J. Wysocki" , Vishal Verma , Doug Ledford , Jason Gunthorpe , Dave Jiang , Ira Weiny , Pavel Machek , Len Brown , Linux ACPI , Linux Kernel Mailing List Subject: Re: [PATCH v2 11/12] PM, libnvdimm: Add 'mem-quiet' state and callback for firmware activation Date: Mon, 13 Jul 2020 16:03:36 +0200 Message-ID: <9508531.urFA0jK61m@kreacher> In-Reply-To: References: <159408711335.2385045.2567600405906448375.stgit@dwillia2-desk3.amr.corp.intel.com> <23449996.3uVv1d17cZ@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, July 9, 2020 9:04:30 PM CEST Dan Williams wrote: > On Thu, Jul 9, 2020 at 7:57 AM Rafael J. Wysocki wrote: > > > > On Tuesday, July 7, 2020 3:59:32 AM CEST Dan Williams wrote: > > > The runtime firmware activation capability of Intel NVDIMM devices > > > requires memory transactions to be disabled for 100s of microseconds. > > > This timeout is large enough to cause in-flight DMA to fail and other > > > application detectable timeouts. Arrange for firmware activation to be > > > executed while the system is "quiesced", all processes and device-DMA > > > frozen. > > > > > > It is already required that invoking device ->freeze() callbacks is > > > sufficient to cease DMA. A device that continues memory writes outside > > > of user-direction violates expectations of the PM core to be to > > > establish a coherent hibernation image. > > > > > > That said, RDMA devices are an example of a device that access memory > > > outside of user process direction. RDMA drivers also typically assume > > > the system they are operating in will never be hibernated. A solution > > > for RDMA collisions with firmware activation is outside the scope of > > > this change and may need to rely on being able to survive the platform > > > imposed memory controller quiesce period. > > > > Thanks for following my suggestion to use the hibernation infrastructure > > rather than the suspend one, but I think it would be better to go a bit > > further with that. > > > > Namely, after thinking about this a bit more I have come to the conclusion > > that what is needed is an ability to execute a function, inside of the > > kernel, in a "quiet" environment in which memory updates are unlikely. > > > > While the hibernation infrastructure as is can be used for that, kind of, IMO > > it would be cleaner to introduce a helper for that, like in the (untested) > > patch below, so if the "quiet execution environment" is needed, whoever > > needs it may simply pass a function to hibernate_quiet_exec() and provide > > whatever user-space I/F is suitable on top of that. > > > > Please let me know what you think. > > This looks good to me in concept. > > Would you expect that I trigger this from libnvdimm sysfs, or any > future users of this functionality to trigger it through their own > subsystem specific mechanisms? Yes, I would. > I have a place for it in libvdimm and could specify the activation > method directly as "suspend" vs "live" activation. Sounds good to me. Cheers!