Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Jan Kara
On Wed 10-05-23 02:18:45, Kent Overstreet wrote: > On Wed, May 10, 2023 at 03:07:37AM +0200, Jan Kara wrote: > > On Tue 09-05-23 12:56:31, Kent Overstreet wrote: > > > From: Kent Overstreet > > > > > > This is used by bcachefs to fix a page cache coherency issue with > > > O_DIRECT writes. > > >

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Kent Overstreet
On Tue, May 23, 2023 at 09:21:56AM -0700, Christoph Hellwig wrote: > On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote: > > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > > remembered that GFS2 has dealt with the same deadlocks - b01b2d72da25 > > ("gfs2: Fix mmap

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Kent Overstreet
> > No, that's definitely handled (and you can see it in the code I linked), > > and I wrote a torture test for fstests as well. > > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > remembered that GFS2 has dealt with the same deadlocks - b01b2d72da25 > ("gfs2: Fix mmap +

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Christoph Hellwig
On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote: > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > remembered that GFS2 has dealt with the same deadlocks - b01b2d72da25 > ("gfs2: Fix mmap + page fault deadlocks for direct I/O") - in a different > way (by prefault

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Christoph Hellwig
On Tue, May 23, 2023 at 12:35:35PM -0400, Kent Overstreet wrote: > No, this is fundamentally because userspace controls the ordering of > locking because the buffer passed to dio can point into any address > space. You can't solve this by changing the locking heirarchy. > > If you want to be able

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-24 Thread Kent Overstreet
On Tue, May 23, 2023 at 11:43:32PM -0700, Christoph Hellwig wrote: > On Tue, May 23, 2023 at 12:35:35PM -0400, Kent Overstreet wrote: > > No, this is fundamentally because userspace controls the ordering of > > locking because the buffer passed to dio can point into any address > > space. You can't

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Jan Kara
On Tue 23-05-23 12:49:06, Kent Overstreet wrote: > > > No, that's definitely handled (and you can see it in the code I linked), > > > and I wrote a torture test for fstests as well. > > > > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > > remembered that GFS2 has dealt

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Christoph Hellwig
On Wed, May 24, 2023 at 04:09:02AM -0400, Kent Overstreet wrote: > > Well, it seems like you are talking about something else than the > > existing cases in gfs2 and btrfs, that is you want full consistency > > between direct I/O and buffered I/O. That's something nothing in the > > kernel has eve

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Kent Overstreet
On Thu, May 25, 2023 at 01:58:13AM -0700, Christoph Hellwig wrote: > On Wed, May 24, 2023 at 04:09:02AM -0400, Kent Overstreet wrote: > > > Well, it seems like you are talking about something else than the > > > existing cases in gfs2 and btrfs, that is you want full consistency > > > between direc

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Kent Overstreet
On Thu, May 25, 2023 at 10:47:31AM +0200, Jan Kara wrote: > If we submit direct IO that uses mapped file F at offset O as a buffer for > direct IO from file F, offset O, it will currently livelock in an > indefinite retry loop. It should rather return error or fall back to > buffered IO. But that s

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Kent Overstreet
On Thu, May 25, 2023 at 01:58:13AM -0700, Christoph Hellwig wrote: > On Wed, May 24, 2023 at 04:09:02AM -0400, Kent Overstreet wrote: > > > Well, it seems like you are talking about something else than the > > > existing cases in gfs2 and btrfs, that is you want full consistency > > > between direc

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Andreas Grünbacher
Am Di., 23. Mai 2023 um 15:37 Uhr schrieb Jan Kara : > On Wed 10-05-23 02:18:45, Kent Overstreet wrote: > > On Wed, May 10, 2023 at 03:07:37AM +0200, Jan Kara wrote: > > > On Tue 09-05-23 12:56:31, Kent Overstreet wrote: > > > > From: Kent Overstreet > > > > > > > > This is used by bcachefs to fix

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Andreas Grünbacher
Am Di., 23. Mai 2023 um 18:28 Uhr schrieb Christoph Hellwig : > On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote: > > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > > remembered that GFS2 has dealt with the same deadlocks - b01b2d72da25 > > ("gfs2: Fix mmap + pa

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Andreas Grünbacher
Am Do., 25. Mai 2023 um 10:56 Uhr schrieb Jan Kara : > On Tue 23-05-23 12:49:06, Kent Overstreet wrote: > > > > No, that's definitely handled (and you can see it in the code I linked), > > > > and I wrote a torture test for fstests as well. > > > > > > I've checked the code and AFAICT it is all ind

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Kent Overstreet
On Fri, May 26, 2023 at 12:25:31AM +0200, Andreas Grünbacher wrote: > Am Di., 23. Mai 2023 um 18:28 Uhr schrieb Christoph Hellwig > : > > On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote: > > > I've checked the code and AFAICT it is all indeed handled. BTW, I've now > > > remembered that G

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Andreas Grünbacher
Am Fr., 26. Mai 2023 um 01:20 Uhr schrieb Kent Overstreet : > On Fri, May 26, 2023 at 12:25:31AM +0200, Andreas Grünbacher wrote: > > Am Di., 23. Mai 2023 um 18:28 Uhr schrieb Christoph Hellwig > > : > > > On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote: > > > > I've checked the code and

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Kent Overstreet
On Fri, May 26, 2023 at 02:05:26AM +0200, Andreas Grünbacher wrote: > Oh, it's just that gfs2 uses one dlm lock per inode to control access > to that inode. In the code, this is called the "inode glock" --- > glocks being an abstraction above dlm locks --- but it boils down to > dlm locks in the en

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-26 Thread Christoph Hellwig
On Thu, May 25, 2023 at 07:20:46PM -0400, Kent Overstreet wrote: > > > I'm absolutely not in favour to add workarounds for thes kind of locking > > > problems to the core kernel. I already feel bad for allowing the > > > small workaround in iomap for btrfs, as just fixing the locking back > > > th

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-26 Thread Kent Overstreet
On Fri, May 26, 2023 at 01:06:46AM -0700, Christoph Hellwig wrote: > On Thu, May 25, 2023 at 04:50:39PM -0400, Kent Overstreet wrote: > > A cache that isn't actually consistent is a _bug_. You're being > > Obsequious. And any time this has come up in previous discussions > > (including at LSF), tha

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-26 Thread Kent Overstreet
On Fri, May 26, 2023 at 01:10:43AM -0700, Christoph Hellwig wrote: > On Thu, May 25, 2023 at 07:20:46PM -0400, Kent Overstreet wrote: > > > > I'm absolutely not in favour to add workarounds for thes kind of locking > > > > problems to the core kernel. I already feel bad for allowing the > > > > sm

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-26 Thread Christoph Hellwig
On Thu, May 25, 2023 at 04:50:39PM -0400, Kent Overstreet wrote: > A cache that isn't actually consistent is a _bug_. You're being > Obsequious. And any time this has come up in previous discussions > (including at LSF), that was never up for debate, the only question has > been whether it was even