Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-12 Thread Jane Chu
On 11/12/2021 7:36 AM, Mike Snitzer wrote: > On Wed, Nov 10 2021 at 1:26P -0500, > Jane Chu wrote: > >> On 11/9/2021 1:02 PM, Dan Williams wrote: >>> On Tue, Nov 9, 2021 at 11:59 AM Jane Chu wrote: On 11/9/2021 10:48 AM, Dan Williams wrote: > On Mon, Nov 8, 2021 at 11:27 PM

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-12 Thread Mike Snitzer
On Wed, Nov 10 2021 at 1:26P -0500, Jane Chu wrote: > On 11/9/2021 1:02 PM, Dan Williams wrote: > > On Tue, Nov 9, 2021 at 11:59 AM Jane Chu wrote: > >> > >> On 11/9/2021 10:48 AM, Dan Williams wrote: > >>> On Mon, Nov 8, 2021 at 11:27 PM Christoph Hellwig > >>> wrote: > > On Fri,

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-10 Thread Jane Chu
On 11/9/2021 1:02 PM, Dan Williams wrote: > On Tue, Nov 9, 2021 at 11:59 AM Jane Chu wrote: >> >> On 11/9/2021 10:48 AM, Dan Williams wrote: >>> On Mon, Nov 8, 2021 at 11:27 PM Christoph Hellwig >>> wrote: On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: >static

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-09 Thread Dan Williams
On Tue, Nov 9, 2021 at 11:59 AM Jane Chu wrote: > > On 11/9/2021 10:48 AM, Dan Williams wrote: > > On Mon, Nov 8, 2021 at 11:27 PM Christoph Hellwig > > wrote: > >> > >> On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: > >>> static size_t pmem_copy_from_iter(struct dax_device

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-09 Thread Jane Chu
On 11/9/2021 10:48 AM, Dan Williams wrote: > On Mon, Nov 8, 2021 at 11:27 PM Christoph Hellwig wrote: >> >> On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: >>> static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t >>> pgoff, >>>void *addr, size_t

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-09 Thread Christoph Hellwig
On Tue, Nov 09, 2021 at 10:48:51AM -0800, Dan Williams wrote: > I think we just make error management a first class citizen of a > dax-device and stop abstracting it behind a driver callback. That way > the driver that registers the dax-device can optionally register error > management as well.

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-09 Thread Jane Chu
On 11/8/2021 11:27 PM, Christoph Hellwig wrote: > On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: >> static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t >> pgoff, >> void *addr, size_t bytes, struct iov_iter *i, int mode) >> { >> +phys_addr_t

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-09 Thread Dan Williams
On Mon, Nov 8, 2021 at 11:27 PM Christoph Hellwig wrote: > > On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: > > static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t > > pgoff, > > void *addr, size_t bytes, struct iov_iter *i, int mode) > > { > > +

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-08 Thread Christoph Hellwig
On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: > static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, > void *addr, size_t bytes, struct iov_iter *i, int mode) > { > + phys_addr_t pmem_off; > + size_t len, lead_off; > + struct

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-08 Thread Jane Chu
On 11/5/2021 7:04 PM, Darrick J. Wong wrote: >> @@ -303,20 +303,85 @@ static long pmem_dax_direct_access(struct dax_device >> *dax_dev, >> } >> >> /* >> - * Use the 'no check' versions of copy_from_iter_flushcache() and >> - * copy_mc_to_iter() to bypass HARDENED_USERCOPY overhead. Bounds

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-08 Thread Jane Chu
On 11/5/2021 7:04 PM, Darrick J. Wong wrote: >> >> diff --git a/drivers/md/dm.c b/drivers/md/dm.c >> index dc354db22ef9..9b3dac916f22 100644 >> --- a/drivers/md/dm.c >> +++ b/drivers/md/dm.c >> @@ -1043,6 +1043,7 @@ static size_t dm_dax_copy_from_iter(struct dax_device >> *dax_dev, pgoff_t

Re: [PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-05 Thread Darrick J. Wong
On Fri, Nov 05, 2021 at 07:16:38PM -0600, Jane Chu wrote: > For /dev/pmem based dax, enable DAX_OP_RECOVERY mode for > dax_direct_access to translate 'kaddr' over a range that > may contain poison(s); and enable dax_copy_to_iter to > read as much data as possible up till a poisoned page is >

[PATCH v2 2/2] dax,pmem: Implement pmem based dax data recovery

2021-11-05 Thread Jane Chu
For /dev/pmem based dax, enable DAX_OP_RECOVERY mode for dax_direct_access to translate 'kaddr' over a range that may contain poison(s); and enable dax_copy_to_iter to read as much data as possible up till a poisoned page is encountered; and enable dax_copy_from_iter to clear poison among a