[PATCH v8 2/3] ndctl, monitor: add main ndctl monitor configuration file

2018-06-26 Thread QI Fuli
This patch adds the main configuration file(/etc/ndctl/monitor.conf) of ndctl monitor. It contains the configuration directives that give ndctl monitor instructions. Users can change the configuration by editing this file or using [--config-file] option to override this file. The changed value

[PATCH v8 1/3] ndctl, monitor: add ndctl monitor

2018-06-26 Thread QI Fuli
Ndctl monitor is used for monitoring the smart events of nvdimm DIMMs. When a smart event fires, monitor will output the notifications which include dimm health status and evnet informations to syslog or a logfile by setting [--logfile] option. The notifications follow json format and can be

[PATCH v8 3/3] ndctl, monitor: add the unit file of systemd for ndctl-monitor service

2018-06-26 Thread QI Fuli
This patch adds the systemd unit file for ndctl-monitor service. The systemd unit directory can be configured by setting environment variable "--with-systemd-unit-dir[=DIR]". A monitor daemon can be started as a system service: # systemctl start ndctl-monitor.service Signed-off-by: QI Fuli

[PATCH v8 0/3] ndctl, monitor: add ndctl monitor daemon

2018-06-26 Thread QI Fuli
This is the v8 patch for ndctl monitor, a tiny daemon to monitor the smart events of nvdimm DIMMs. Since NVDIMM does not have a feature like mirroring, if it breaks down, the data will be impossible to restore. Ndctl monitor daemon will catch the smart events notify from firmware and outputs

Re: [ndctl PATCH 2/2] ndctl: Add 'list' verbose documentation

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 3:59 PM, Verma, Vishal L wrote: > On Tue, 2018-06-26 at 14:46 -0600, Keith Busch wrote: >> Signed-off-by: Keith Busch >> --- >> Documentation/ndctl/ndctl-list.txt | 12 >> 1 file changed, 12 insertions(+) >> > > I think this can all just go in the first

[ndctl PATCH] ndctl, test: check availability of MAP_SYNC for poison test

2018-06-26 Thread Dan Williams
The poison handling test requires the systems that have both MAP_SYNC and BUS_MCEERR_AR definitions. Add the missing MAP_SYNC gate for this test to detect this functionality at build time. Signed-off-by: Dan Williams --- configure.ac |9 ++--- 1 file changed, 6 insertions(+), 3

[ndctl PATCH] ndctl, test: check availability of MAP_SYNC for poison test

2018-06-26 Thread Dan Williams
The poison handling test requires the systems that have both MAP_SYNC and BUS_MCEERR_AR definitions. Add the missing MAP_SYNC gate for this test to detect this functionality at build time. Signed-off-by: Dan Williams --- configure.ac |9 ++--- 1 file changed, 6 insertions(+), 3

Re: [ndctl PATCH 2/2] ndctl: Add 'list' verbose documentation

2018-06-26 Thread Verma, Vishal L
On Tue, 2018-06-26 at 14:46 -0600, Keith Busch wrote: > Signed-off-by: Keith Busch > --- > Documentation/ndctl/ndctl-list.txt | 12 > 1 file changed, 12 insertions(+) > I think this can all just go in the first patch? > diff --git a/Documentation/ndctl/ndctl-list.txt >

Re: [PATCH v5 0/3] Fix DM DAX handling

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 3:30 PM, Ross Zwisler wrote: > This series fixes a few issues that I found with DM's handling of DAX > devices. Here are some of the issues I found: > > * We can create a dm-stripe or dm-linear device which is made up of an >fsdax PMEM namespace and a raw PMEM

Re: [ndctl PATCH 1/2] ndctl: Add 'list' verbose options

2018-06-26 Thread Keith Busch
On Tue, Jun 26, 2018 at 02:11:30PM -0700, Dan Williams wrote: > This turns on listing DIMMs even if --dimms was not specified on the > command line. I was thinking not until level 2 do we start turning on > more device objects beyond what is specified. For example "ndctl list > -v" is the same as

[PATCH v5 2/3] dax: bdev_dax_supported() check for QUEUE_FLAG_DAX

2018-06-26 Thread Ross Zwisler
Add an explicit check for QUEUE_FLAG_DAX to __bdev_dax_supported(). This is needed for DM configurations where the first element in the dm-linear or dm-stripe target supports DAX, but other elements do not. Without this check __bdev_dax_supported() will pass for such devices, letting a

[PATCH v5 0/3] Fix DM DAX handling

2018-06-26 Thread Ross Zwisler
This series fixes a few issues that I found with DM's handling of DAX devices. Here are some of the issues I found: * We can create a dm-stripe or dm-linear device which is made up of an fsdax PMEM namespace and a raw PMEM namespace but which can hold a filesystem mounted with the -o dax

[PATCH v5 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Ross Zwisler
QUEUE_FLAG_DAX is an indication that a given block device supports filesystem DAX and should not be set for PMEM namespaces which are in "raw" mode. These namespaces lack struct page and are prevented from participating in filesystem DAX as of commit 569d0365f571 "dax: require 'struct page' by

[PATCH v5 3/3] dm: prevent DAX mounts if not supported

2018-06-26 Thread Ross Zwisler
Currently device_supports_dax() just checks to see if the QUEUE_FLAG_DAX flag is set on the device's request queue to decide whether or not the device supports filesystem DAX. Really we should be using bdev_dax_supported() like filesystems do at mount time. This performs other tests like

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Ross Zwisler
On Tue, Jun 26, 2018 at 02:51:52PM -0700, Dan Williams wrote: > On Tue, Jun 26, 2018 at 2:31 PM, Kani, Toshi wrote: > > On Tue, 2018-06-26 at 14:28 -0700, Dan Williams wrote: > >> On Tue, Jun 26, 2018 at 2:23 PM, Kani, Toshi wrote: > >> > On Tue, 2018-06-26 at 14:02 -0700, Dan Williams wrote: >

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 2:31 PM, Kani, Toshi wrote: > On Tue, 2018-06-26 at 14:28 -0700, Dan Williams wrote: >> On Tue, Jun 26, 2018 at 2:23 PM, Kani, Toshi wrote: >> > On Tue, 2018-06-26 at 14:02 -0700, Dan Williams wrote: >> > > On Tue, Jun 26, 2018 at 1:54 PM, Kani, Toshi wrote: >> >> [..]

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Kani, Toshi
On Tue, 2018-06-26 at 14:28 -0700, Dan Williams wrote: > On Tue, Jun 26, 2018 at 2:23 PM, Kani, Toshi wrote: > > On Tue, 2018-06-26 at 14:02 -0700, Dan Williams wrote: > > > On Tue, Jun 26, 2018 at 1:54 PM, Kani, Toshi wrote: > > [..] > > > > When this dm change was made, the pmem driver

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 2:23 PM, Kani, Toshi wrote: > On Tue, 2018-06-26 at 14:02 -0700, Dan Williams wrote: >> On Tue, Jun 26, 2018 at 1:54 PM, Kani, Toshi wrote: [..] >> > When this dm change was made, the pmem driver supported DAX for both raw >> > and memory modes (note: sector mode does not

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Kani, Toshi
On Tue, 2018-06-26 at 14:02 -0700, Dan Williams wrote: > On Tue, Jun 26, 2018 at 1:54 PM, Kani, Toshi wrote: > > On Tue, 2018-06-26 at 15:13 -0400, Mike Snitzer wrote: > > > On Tue, Jun 26 2018 at 3:07pm -0400, > > > Dan Williams wrote: > > > > > > > On Tue, Jun 26, 2018 at 11:58 AM, Mike

Re: [ndctl PATCH 1/2] ndctl: Add 'list' verbose options

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 1:46 PM, Keith Busch wrote: > The informational and miscellaneous flag options are becoming more > numerous, and can be difficult to remember what can be listed. Rather > than add more flags to suppress and show some of the less pertinent > information, this patch adds a

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 1:54 PM, Kani, Toshi wrote: > On Tue, 2018-06-26 at 15:13 -0400, Mike Snitzer wrote: >> On Tue, Jun 26 2018 at 3:07pm -0400, >> Dan Williams wrote: >> >> > On Tue, Jun 26, 2018 at 11:58 AM, Mike Snitzer wrote: >> > > On Tue, Jun 26 2018 at 2:52pm -0400, >> > > Dan

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Kani, Toshi
On Tue, 2018-06-26 at 15:13 -0400, Mike Snitzer wrote: > On Tue, Jun 26 2018 at 3:07pm -0400, > Dan Williams wrote: > > > On Tue, Jun 26, 2018 at 11:58 AM, Mike Snitzer wrote: > > > On Tue, Jun 26 2018 at 2:52pm -0400, > > > Dan Williams wrote: > > > > > > > On Tue, Jun 26, 2018 at 10:59

[ndctl PATCH 2/2] ndctl: Add 'list' verbose documentation

2018-06-26 Thread Keith Busch
Signed-off-by: Keith Busch --- Documentation/ndctl/ndctl-list.txt | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/ndctl/ndctl-list.txt b/Documentation/ndctl/ndctl-list.txt index 13ebdcd..791638c 100644 --- a/Documentation/ndctl/ndctl-list.txt +++

[ndctl PATCH 1/2] ndctl: Add 'list' verbose options

2018-06-26 Thread Keith Busch
The informational and miscellaneous flag options are becoming more numerous, and can be difficult to remember what can be listed. Rather than add more flags to suppress and show some of the less pertinent information, this patch adds a 'verbose' option that increases the detail of information

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 12:13 PM, Mike Snitzer wrote: > On Tue, Jun 26 2018 at 3:07pm -0400, > Dan Williams wrote: > >> On Tue, Jun 26, 2018 at 11:58 AM, Mike Snitzer wrote: >> > On Tue, Jun 26 2018 at 2:52pm -0400, >> > Dan Williams wrote: >> > >> >> On Tue, Jun 26, 2018 at 10:59 AM, Ross

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Mike Snitzer
On Tue, Jun 26 2018 at 3:07pm -0400, Dan Williams wrote: > On Tue, Jun 26, 2018 at 11:58 AM, Mike Snitzer wrote: > > On Tue, Jun 26 2018 at 2:52pm -0400, > > Dan Williams wrote: > > > >> On Tue, Jun 26, 2018 at 10:59 AM, Ross Zwisler > >> wrote: > >> > QUEUE_FLAG_DAX is an indication that a

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Ross Zwisler
On Tue, Jun 26, 2018 at 12:07:40PM -0700, Dan Williams wrote: > On Tue, Jun 26, 2018 at 11:58 AM, Mike Snitzer wrote: > > On Tue, Jun 26 2018 at 2:52pm -0400, > > Dan Williams wrote: > > > >> On Tue, Jun 26, 2018 at 10:59 AM, Ross Zwisler > >> wrote: > >> > QUEUE_FLAG_DAX is an indication that

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Ross Zwisler
On Tue, Jun 26, 2018 at 02:58:30PM -0400, Mike Snitzer wrote: > On Tue, Jun 26 2018 at 2:52pm -0400, > Dan Williams wrote: > > > On Tue, Jun 26, 2018 at 10:59 AM, Ross Zwisler > > wrote: > > > QUEUE_FLAG_DAX is an indication that a given block device supports > > > filesystem DAX and should

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 11:58 AM, Mike Snitzer wrote: > On Tue, Jun 26 2018 at 2:52pm -0400, > Dan Williams wrote: > >> On Tue, Jun 26, 2018 at 10:59 AM, Ross Zwisler >> wrote: >> > QUEUE_FLAG_DAX is an indication that a given block device supports >> > filesystem DAX and should not be set for

[PATCH v4 3/3] dm: prevent DAX mounts if not supported

2018-06-26 Thread Ross Zwisler
Currently device_supports_dax() just checks to see if the QUEUE_FLAG_DAX flag is set on the device's request queue to decide whether or not the device supports filesystem DAX. Really we should be using bdev_dax_supported() like filesystems do at mount time. This performs other tests like

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Mike Snitzer
On Tue, Jun 26 2018 at 2:52pm -0400, Dan Williams wrote: > On Tue, Jun 26, 2018 at 10:59 AM, Ross Zwisler > wrote: > > QUEUE_FLAG_DAX is an indication that a given block device supports > > filesystem DAX and should not be set for PMEM namespaces which are in "raw" > > or "sector" modes.

Re: [PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 10:59 AM, Ross Zwisler wrote: > QUEUE_FLAG_DAX is an indication that a given block device supports > filesystem DAX and should not be set for PMEM namespaces which are in "raw" > or "sector" modes. These namespaces lack struct page and are prevented > from participating

Re: [PATCH v3 0/3] Fix DM DAX handling

2018-06-26 Thread Mike Snitzer
On Tue, Jun 26 2018 at 1:59pm -0400, Ross Zwisler wrote: > This series fixes a few issues that I found with DM's handling of DAX > devices. Here are some of the issues I found: > > * We can create a dm-stripe or dm-linear device which is made up of an >fsdax PMEM namespace and a raw PMEM

[ndctl PATCHv3] ndctl: Use max_available_extent for namespace

2018-06-26 Thread Keith Busch
The available_size attribute returns all the unused regions, but a namespace has to use contiguous free regions. This patch uses the attribute returning the largest capacity that can be created for determining if the namespace can be created. Signed-off-by: Keith Busch --- v2 -> v3: Added

Re: [PATCH v3 3/3] dm: prevent DAX mounts if not supported

2018-06-26 Thread Mike Snitzer
On Tue, Jun 26 2018 at 1:59pm -0400, Ross Zwisler wrote: > Currently device_supports_dax() just checks to see if the QUEUE_FLAG_DAX > flag is set on the device's request queue to decide whether or not the > device supports filesystem DAX. Really we should be using > bdev_dax_supported() like

[PATCH v3 3/3] dm: prevent DAX mounts if not supported

2018-06-26 Thread Ross Zwisler
Currently device_supports_dax() just checks to see if the QUEUE_FLAG_DAX flag is set on the device's request queue to decide whether or not the device supports filesystem DAX. Really we should be using bdev_dax_supported() like filesystems do at mount time. This performs other tests like

[PATCH v3 0/3] Fix DM DAX handling

2018-06-26 Thread Ross Zwisler
This series fixes a few issues that I found with DM's handling of DAX devices. Here are some of the issues I found: * We can create a dm-stripe or dm-linear device which is made up of an fsdax PMEM namespace and a raw PMEM namespace but which can hold a filesystem mounted with the -o dax

[PATCH v3 2/3] dax: bdev_dax_supported() check for QUEUE_FLAG_DAX

2018-06-26 Thread Ross Zwisler
Add an explicit check for QUEUE_FLAG_DAX to __bdev_dax_supported(). This is needed for DM configurations where the first element in the dm-linear or dm-stripe target supports DAX, but other elements do not. Without this check __bdev_dax_supported() will pass for such devices, letting a

[PATCH v3 1/3] pmem: only set QUEUE_FLAG_DAX for fsdax mode

2018-06-26 Thread Ross Zwisler
QUEUE_FLAG_DAX is an indication that a given block device supports filesystem DAX and should not be set for PMEM namespaces which are in "raw" or "sector" modes. These namespaces lack struct page and are prevented from participating in filesystem DAX. Signed-off-by: Ross Zwisler Suggested-by:

[ANNOUNCE] ndctl v61

2018-06-26 Thread Verma, Vishal L
https://github.com/pmem/ndctl/releases/tag/v61 This release incorporates functionality up to the 4.18 kernel, and a number of bug fixes and improvements. Highlights include a fix to the error injection APIs to inject fewer bytes of errors per sector, support for building documentation with

Re: [ndctl PATCHv2] ndctl: Use max_available_extent for namespaces

2018-06-26 Thread Verma, Vishal L
On Tue, 2018-06-26 at 11:00 -0600, Keith Busch wrote: > The available_size attribute returns all the unused regions, but a > namespace has to use contiguous free regions. This patch uses the > attribute returning the largest capacity that can be created for > determining if the namespace can be

[ndctl PATCHv2] ndctl: Use max_available_extent for namespaces

2018-06-26 Thread Keith Busch
The available_size attribute returns all the unused regions, but a namespace has to use contiguous free regions. This patch uses the attribute returning the largest capacity that can be created for determining if the namespace can be created. If this is used on a kernel that predates the new

Re: [PATCH] ndctl: Use max_available_extent for creating namespaces

2018-06-26 Thread Verma, Vishal L
On Tue, 2018-06-26 at 09:32 -0700, Dan Williams wrote: > On Tue, Jun 26, 2018 at 9:27 AM, Verma, Vishal L > wrote: > > On Tue, 2018-06-26 at 10:29 -0600, Keith Busch wrote: > > > On Tue, Jun 26, 2018 at 09:19:28AM -0700, Verma, Vishal L wrote: > > > > On Tue, 2018-06-26 at 09:37 -0600, Keith

Re: [PATCH] ndctl: Use max_available_extent for creating namespaces

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 9:27 AM, Verma, Vishal L wrote: > On Tue, 2018-06-26 at 10:29 -0600, Keith Busch wrote: >> On Tue, Jun 26, 2018 at 09:19:28AM -0700, Verma, Vishal L wrote: >> > On Tue, 2018-06-26 at 09:37 -0600, Keith Busch wrote: >> > > The available_size attribute returns all the unused

Re: [PATCH] ndctl: Use max_available_extent for creating namespaces

2018-06-26 Thread Keith Busch
On Tue, Jun 26, 2018 at 09:19:28AM -0700, Verma, Vishal L wrote: > On Tue, 2018-06-26 at 09:37 -0600, Keith Busch wrote: > > The available_size attribute returns all the unused regions, but a > > namespace has to use contiguous free regions. This patch uses the > > attribute returning the largest

Re: [PATCH] ndctl: Use max_available_extent for creating namespaces

2018-06-26 Thread Verma, Vishal L
On Tue, 2018-06-26 at 09:37 -0600, Keith Busch wrote: > The available_size attribute returns all the unused regions, but a > namespace has to use contiguous free regions. This patch uses the > attribute returning the largest capacity that can be created for > determining if the namespace can be

Re: [PATCH v7 2/3] ndctl, monitor: add main ndctl monitor configuration file

2018-06-26 Thread Dan Williams
On Tue, Jun 26, 2018 at 8:15 AM, Qi, Fuli wrote: > Hi Dan, > Thanks for your comments. > [..] >> > + if (strcmp(buf, "bus") == 0) { >> > + set_config((const char **), value); >> >> The cast is unnecessary, and I think we can clean this up further by having >>

[PATCH 2/2] libnvdimm: Export max available extent

2018-06-26 Thread Keith Busch
The 'available_size' attribute showing the combined total of all unallocated space isn't always useful to know how large of a namespace a user may be able to allocate if the region is fragmented. This patch will export the largest extent of contiguous unallocated space that may be allocated to

[PATCH 0/2] Namespace creation fixups

2018-06-26 Thread Keith Busch
This is a three-part fixup to the warning that occurs when the available capacity is fragmented. When this occurs, the user may believe they can create a larger namespace than is actually possible. This was resulting in the following kernel warning: nd_region region0: allocation underrun: 0x0

[PATCH] ndctl: Use max_available_extent for creating namespaces

2018-06-26 Thread Keith Busch
The available_size attribute returns all the unused regions, but a namespace has to use contiguous free regions. This patch uses the attribute returning the largest capacity that can be created for determining if the namespace can be created. Signed-off-by: Keith Busch --- ndctl/lib/libndctl.c

RE: [PATCH v7 2/3] ndctl, monitor: add main ndctl monitor configuration file

2018-06-26 Thread Qi, Fuli
Hi Dan, Thanks for your comments. > -Original Message- > From: Dan Williams [mailto:dan.j.willi...@intel.com] > Sent: Tuesday, June 26, 2018 1:43 PM > To: Qi, Fuli/斉 福利 > Cc: linux-nvdimm > Subject: Re: [PATCH v7 2/3] ndctl, monitor: add main ndctl monitor > configuration > file > >