Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3829600ima; Mon, 4 Feb 2019 05:59:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IYfzTu+z9q2+IX7nCTbKFvw7HmDSJgRzM7feP/18Wmfu1YScfyFUC3hWQcZwpyhLGw0YwwS X-Received: by 2002:a63:ec13:: with SMTP id j19mr12896295pgh.6.1549288771898; Mon, 04 Feb 2019 05:59:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549288771; cv=none; d=google.com; s=arc-20160816; b=tg+wAvsZk7HbE5x84tSVWlh9iM8BA+dqukmUpVptI8Ciy8ta+des3DxLqoacJ4qJQ4 97+pnfBQ0gmfrAPrxGt9rKh99RTrOZtUGwxo7IXnlElHZ+QGY1tQSF14t3F674VTERHt mkQoJgRsK6BpaH+Sve6o7awf2gLGo6jsnobXEWqEnuVl+qu0kPp53SWh6mt1/mOWLL0I qIu3m5tZNOpf/GZ3QUN9xOl2fVcw9BcZXRijZXlvv7cfgNfzRi3wlrC5lLSGCr89GZOZ QEfAjVMIdHWRaP5QH/7zX5FDRi37laSEDIYirV/80ckSnG020fKqWhqbM9uGHqB10pg0 /8sw== 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=GhvTsFLYofmgeINI75oa5Qls+opwoBacFh/w5+ck3k8=; b=PRGtCvKXo1AF2OD6b3xyKUZ0cNm045ukHpf/GsUrQDG0UQwub19XnluFesOo+uCcKY nUkt44CQ21Zx0Z6MMl/6DVmSw8mNQUISwaBAXXHfg9cxpNwXvfGRuJukcRLoGasGs3Nz 8iyu/cZB0+gAyMnAbGAsi+L79zo/vh0fxvzZDjK+cHbg+3+/4O7qI9CIWLi/R7LgExmG oBmLBhcaNrN8IwJUMqUNImalQjXtYYXeeFHHYqjQaKQWutgt204D0lauLR4Wpu4/n2AC HpD1wwUGRkMJOdYHg8AwXiZUPvY/PRJDgzVKUvO3ChEIyHEhRo4JUAi8fZqhGebRd6tU AeXQ== 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 a18si128339pgj.77.2019.02.04.05.59.16; Mon, 04 Feb 2019 05:59:31 -0800 (PST) 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 S1728594AbfBDL1n (ORCPT + 99 others); Mon, 4 Feb 2019 06:27:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbfBDL1m (ORCPT ); Mon, 4 Feb 2019 06:27:42 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56D052D2BD3; Mon, 4 Feb 2019 11:27:42 +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 9726E809EA; Mon, 4 Feb 2019 11:27:36 +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 x14BRark000838; Mon, 4 Feb 2019 06:27:36 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id x14BRYfJ000829; Mon, 4 Feb 2019 06:27:34 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Mon, 4 Feb 2019 06:27:34 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Huaisheng Ye cc: snitzer@redhat.com, agk@redhat.com, dan.j.williams@intel.com, hch@lst.de, jack@suse.cz, corbet@lwn.net, dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-doc@vger.kernel.org, Huaisheng Ye Subject: Re: [PATCH v3 0/5] Optimize writecache when using pmem as cache In-Reply-To: <20190131022955.9920-1-yehs2007@zoho.com> Message-ID: References: <20190131022955.9920-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 04 Feb 2019 11:27:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 31 Jan 2019, Huaisheng Ye wrote: > From: Huaisheng Ye > > This patch set could be used for dm-writecache when use persistent > memory as cache data device. > > Patch 1 and 2 go towards removing unused parameter and codes which > actually doesn't really work. I agree that there is some unused variables and code, but I would let it be as it is. The processors can write data to persistent memory either by using non-temporal stores (the movnti instruction) or by normal stores followed by the clwb instruction. Currently, the movnti instruction is faster - however, it may be possible that with some newer processors, the clwb instruction could be faster - and in that case, we need the code that you have removed. I would like to keep both flush strategies around (movnti and clwb), so that we can test how do they perform on various processors. Unfortunatelly, some upstream developers hate code with #ifdefs :-( Note that compiler optimizations already remove the unused parameter and the impossible code behind "if (WC_MODE_PMEM(wc)) if (!WC_MODE_PMEM(wc))". > Patch 3 and 4 are targeted at solving problem fn ctr failed to work > due to invalid magic or version, which is caused by the super block > of pmem has messy data stored. LVM zeros the beginning of new logical volumes, so there should be no problem with it. If the user wants to use the writecache target without LVM, he should zero the superblock with dd if=/dev/zero of=/dev/pmem0 bs=4k count=1 Note that other device mapper targets also follow this policy - for example see drivers/md/dm-snap-persistent.c: if (le32_to_cpu(dh->magic) == 0) { *new_snapshot = 1; return 0; } if (le32_to_cpu(dh->magic) != SNAP_MAGIC) { DMWARN("Invalid or corrupt snapshot"); r = -ENXIO; goto bad; } So, I think there is no need for these patches - dm-writecache just does what others targets do. > Patch 5 is used for getting the status of seq_count. It may be accepted if other LVM team members find some use for this value. Mikulas > Changes Since v2: > - seq_count is important for flush operations, output it within status > for debugging and analyzing code behavior. > [1]: https://lkml.org/lkml/2019/1/3/43 > [2]: https://lkml.org/lkml/2019/1/9/6 > > Huaisheng Ye (5): > dm-writecache: remove unused size to writecache_flush_region > dm-writecache: get rid of memory_data flush to writecache_flush_entry > dm-writecache: expand pmem_reinit for struct dm_writecache > Documentation/device-mapper: add optional parameter reinit > dm-writecache: output seq_count within status > > Documentation/device-mapper/writecache.txt | 4 ++++ > drivers/md/dm-writecache.c | 23 +++++++++++++---------- > 2 files changed, 17 insertions(+), 10 deletions(-) > > -- > 1.8.3.1 > >