Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp425730ybe; Wed, 4 Sep 2019 01:49:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzf0zTs/ENfojFZw4NvVkCbjqVf9fqFy2uDyvtVHx1jlMfYVbFoJ4SxWgxxLa5nDMVlUWc X-Received: by 2002:a62:e403:: with SMTP id r3mr19236223pfh.251.1567586984803; Wed, 04 Sep 2019 01:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567586984; cv=none; d=google.com; s=arc-20160816; b=HTrPRJ99+HL1P9lB9VH6pqTHanJBPJ3QChuskCQSSVoV/GC2c9UyAl8Y6Bm4B8WyL5 ZpThGjbI9OC08edwteXq8IF2zmAAPl43QYrTYzNw9x3GDl5U3ChsOguDhUQ2fl4J/pj2 MJ+zD+9Wg5hq+zD036HYF5kbGJg2PrKopocBcGgDK9ggZqH8vFrXRvh6g2beTmbAyMGt GktrPPLkmIeguXRJFfUD2r5vtbY4miV4su4GDRwQ2pO3L9A0+UBywW3B0uNK3WIvRWS2 vCcIZg3HBApThKy6ma8G8TvA5ZEzfhK+CgnW4/excjlWqeGLR5/wL6fZxs4keu+2W+Fl EDwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=pGNOdWiXe/1KJGme6dRzgyQrTpas4ViUyDr+kQBV4/0=; b=M/PejJyOWVNP92RagzvHW8LrvdJ3Ff/0xAFjUCtqWUMsKH5nC2CU58DLqAIjQD/LMg PJGc78UsRNHFaESJjSNcDWbqDIe9uE6jW9V8TVHxG3fRrRHaoV+HFgOFYc01Ee0IMTyu +clekJ+JHhuWKyaHj7jtzl3nrboy2smUlBPmZXsaELVaoWx4+XOv8vHF5ufil0oXsdDR bvxkSOllN/zGjXo6RJHQmP3KF3r4gOEAJ/XvztA4TT67iWEGqUXC2yR0jy0usX2dZ3mg afli/EP7V5R8wkA7Dz25VD0aIqJC4+7ZI2YuD41WlfAnlSiUwR6EVxGU4R4O2wKvMg1l 6fQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a65si20361548pfb.153.2019.09.04.01.49.29; Wed, 04 Sep 2019 01:49:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728448AbfIDIsh (ORCPT + 99 others); Wed, 4 Sep 2019 04:48:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60530 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfIDIsg (ORCPT ); Wed, 4 Sep 2019 04:48:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 577BD875222; Wed, 4 Sep 2019 08:48:36 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9AD560BFB; Wed, 4 Sep 2019 08:48:30 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id x848mUBu011879; Wed, 4 Sep 2019 04:48:30 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id x848mUGT011875; Wed, 4 Sep 2019 04:48:30 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Wed, 4 Sep 2019 04:48:30 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Huaisheng Ye cc: snitzer@redhat.com, agk@redhat.com, prarit@redhat.com, tyu1@lenovo.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, Huaisheng Ye Subject: Re: [PATCH] dm writecache: skip writecache_wait for pmem mode In-Reply-To: <20190902100450.10600-1-yehs2007@zoho.com> Message-ID: References: <20190902100450.10600-1-yehs2007@zoho.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 04 Sep 2019 08:48:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Sep 2019, Huaisheng Ye wrote: > From: Huaisheng Ye > > The array bio_in_progress[2] only have chance to be increased and > decreased with ssd mode. For pmem mode, they are not involved at all. > So skip writecache_wait_for_ios in writecache_flush for pmem. > > Suggested-by: Doris Yu > Signed-off-by: Huaisheng Ye > --- > drivers/md/dm-writecache.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c > index c481947..d06b8aa 100644 > --- a/drivers/md/dm-writecache.c > +++ b/drivers/md/dm-writecache.c > @@ -726,7 +726,8 @@ static void writecache_flush(struct dm_writecache *wc) > } > writecache_commit_flushed(wc); > > - writecache_wait_for_ios(wc, WRITE); > + if (!WC_MODE_PMEM(wc)) > + writecache_wait_for_ios(wc, WRITE); > > wc->seq_count++; > pmem_assign(sb(wc)->seq_count, cpu_to_le64(wc->seq_count)); > -- > 1.8.3.1 I think this is not needed - wait_event in writecache_wait_for_ios exits immediatelly if the condition is true. This code path is not so hot that we would need microoptimizations like this to avoid function calls. Mikulas