Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp501038ybz; Wed, 22 Apr 2020 02:26:15 -0700 (PDT) X-Google-Smtp-Source: APiQypICsxvcScHcAiYfxxXbjMmWJOPV441fQbOJBMjYOirD/awUEc61iuV7EvJI1tyn3kF15UKc X-Received: by 2002:a50:b263:: with SMTP id o90mr21327103edd.326.1587547575199; Wed, 22 Apr 2020 02:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587547575; cv=none; d=google.com; s=arc-20160816; b=d3SUvjCxm3rfQstGMhCETwcynEaKDAQ4DH/RMcOR1UNkHuz+V54749pM+GPFFoN7r+ B281JodQ+BS6nsQHRLPzhJAUbtzH3ReBBCvCsLYp3gXhYJjDoMhwyqipHj1zSIv9GrFq kFmAADCT/6MgpA4syBBCgYj1eDasFd/3ygvWnN33pVkKul3BPIgqTqAau8aEyg/q9/UM JtNJvNU8sZ5lIXZ3Mo6WHQDx45FKiYkWje1P3k5QcH1V4Ydf/zlfdr3f/qs/fOah+Amn B9pmSMEvGfz6pHR/nYQxgZxc4/KapEfgkDH+w0w7NlQ+uG1lcd3brHkFyRQSzVp2mot/ dtBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=DMhA18q5o54p19fFpaLKF4OTjlHgtCkpRiehNkdmtk0=; b=NHO6cOgIeZ68n1xMt0gJN50b6wjLEVRB1BV+uiKz60st6/ngpS/wFm7LFiAcyFQnNm 0eI8QrC7eeqHn18mW05Rg2bts4oU8dgPL8uzy2nTnRmJNYN1NhM8c6Emhi/kGsbqfENd 3+kDKnIWiFp5SIoWkx26rxbHoGJVKOOLuJBo7lnxaqVQSnjLCZod3zpnOIYBocEoDOOM nV3B8APYwJEzrFjBcJAVjX2YbixBtv1Djxj8VjgatiUmqxJHFAcQbkjZivaBNvVGBPqU 7b1y+5qmhFjDlUdhQXoZlMTAhMpxWmmK3hFS4Wg2jobetygZEYVMTPx773KvxrN3+x4i 2nSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=grApRieN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch19si2987592ejb.240.2020.04.22.02.25.51; Wed, 22 Apr 2020 02:26:15 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=grApRieN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726285AbgDVJYR (ORCPT + 99 others); Wed, 22 Apr 2020 05:24:17 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:20545 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726224AbgDVJYQ (ORCPT ); Wed, 22 Apr 2020 05:24:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587547454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DMhA18q5o54p19fFpaLKF4OTjlHgtCkpRiehNkdmtk0=; b=grApRieNK+OmW+Ph9h2tR9zU0uKExcWmmISzc/RrgOUdVjDeysh8DaWsu+FczjWWILTAPj WIzMeEmSv0ZlCUw1vFqJ3GxVNUuoG4yjZ7fkrmNMYqjutoOIvIUTxPBxLB0L7SPmoT9jIe BuntuwErSvNNbVZzI/ZjHmqtDlZ+J5g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-bYl2gzczORKSGHhwjavuQw-1; Wed, 22 Apr 2020 05:24:10 -0400 X-MC-Unique: bYl2gzczORKSGHhwjavuQw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1503B8017FC; Wed, 22 Apr 2020 09:24:08 +0000 (UTC) Received: from T590 (ovpn-8-28.pek2.redhat.com [10.72.8.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B2FFB3A8F; Wed, 22 Apr 2020 09:23:56 +0000 (UTC) Date: Wed, 22 Apr 2020 17:23:51 +0800 From: Ming Lei To: Dexuan Cui Cc: "Paul E. McKenney" , Josh Triplett , "Rafael J. Wysocki" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "hch@lst.de" , "bvanassche@acm.org" , "hare@suse.de" , Michael Kelley , Long Li , "linux-hyperv@vger.kernel.org" , "wei.liu@kernel.org" , Stephen Hemminger , Haiyang Zhang , KY Srinivasan , "linux-pm@vger.kernel.org" Subject: Re: [PATCH] scsi: storvsc: Fix a panic in the hibernation procedure Message-ID: <20200422092351.GF299948@T590> References: <1587514644-47058-1-git-send-email-decui@microsoft.com> <20200422012814.GB299948@T590> <20200422020134.GC299948@T590> <20200422030807.GK17661@paulmck-ThinkPad-P72> <20200422041629.GE299948@T590> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 04:58:14AM +0000, Dexuan Cui wrote: > > From: Ming Lei > > Sent: Tuesday, April 21, 2020 9:16 PM > > ... > > > > > When we're in storvsc_suspend(), all the userspace processes have been > > > > > frozen and all the file systems have been flushed, and there should not > > > > > be too much I/O from the kernel space, so IMO scsi_host_block() should > > be > > > > > pretty fast here. > > > > > > > > I guess it depends on RCU's implementation, so CC RCU guys. > > > > > > > > Hello Paul & Josh, > > > > > > > > Could you clarify that if sysnchronize_rcu becomes quickly during > > > > system suspend? > > > > > > Once you have all but one CPU offlined, it becomes extremely fast, as > > > in roughly a no-op (which is an idea of Josh's from back in the day). > > > But if there is more than one CPU online, then synchronize_rcu() still > > > takes on the order of several to several tens of jiffies. > > > > > > So, yes, in some portions of system suspend, synchronize_rcu() becomes > > > very fast indeed. > > > > Hi Paul, > > > > Thanks for your clarification. > > > > In system suspend path, device is suspended before > > suspend_disable_secondary_cpus(), > > so I guess synchronize_rcu() is not quick enough even though user space > > processes and some kernel threads are frozen. > > > > Thanks, > > Ming > > storvsc_suspend() -> scsi_host_block() is only called in the hibernation > path, which is not a hot path at all, so IMHO we don't really care if it > takes 10ms or 100ms or even 1s. :-) BTW, in my test, typically the Are you sure the 'we' can cover all users? > scsi_host_block() here takes about 3ms in my 40-vCPU VM. If more LUNs are added, the time should be increased proportionallly, that is why I think scsi_host_block() is bad. Thanks, Ming