Re: [dm-devel] [PATCH 0/6] Overhaul memalloc_no*

2020-06-26 Thread Dave Chinner
On Fri, Jun 26, 2020 at 11:02:19AM -0400, Mikulas Patocka wrote: > Hi > > I suggest to join memalloc_noio and memalloc_nofs into just one flag that > prevents both filesystem recursion and i/o recursion. > > Note that any I/O can recurse into a filesystem via the loop device, thus > it doesn't

[dm-devel] [git pull] device mapper fixes for 5.8-rc3

2020-06-26 Thread Mike Snitzer
Hi Linus, The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407: Linux 5.8-rc1 (2020-06-14 12:45:04 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git tags/for-5.8/dm-fixes for you to fetch changes

Re: [dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Eric Biggers
On Fri, Jun 26, 2020 at 09:46:17AM -0700, Eric Biggers wrote: > On Fri, Jun 26, 2020 at 12:16:33PM -0400, Mikulas Patocka wrote: > > +/* > > + * Pass these flags down through the crypto API. > > + */ > > +#define CRYPTO_ALG_INHERITED_FLAGS (CRYPTO_ALG_ASYNC | > > CRYPTO_ALG_ALLOCATES_MEMORY) > >

Re: [dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Eric Biggers
On Fri, Jun 26, 2020 at 12:16:33PM -0400, Mikulas Patocka wrote: > +/* > + * Pass these flags down through the crypto API. > + */ > +#define CRYPTO_ALG_INHERITED_FLAGS (CRYPTO_ALG_ASYNC | > CRYPTO_ALG_ALLOCATES_MEMORY) This comment is useless. How about: /* * When an algorithm uses another a

[dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Mikulas Patocka
Introduce a new flag CRYPTO_ALG_ALLOCATES_MEMORY and pass it down the crypto stack. If the flag is set, then the crypto driver allocates memory in its request routine. Such drivers are not suitable for disk encryption because GFP_ATOMIC allocation can fail anytime (causing random I/O errors) and G

Re: [dm-devel] [PATCH 1/3] crypto: pass the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Mikulas Patocka
On Fri, 26 Jun 2020, Herbert Xu wrote: > On Wed, Jun 17, 2020 at 11:09:28AM -0400, Mikulas Patocka wrote: > > > > Index: linux-2.6/include/linux/crypto.h > > === > > --- linux-2.6.orig/include/linux/crypto.h > > +++ linux-2.6/inclu

Re: [dm-devel] [PATCH 0/6] Overhaul memalloc_no*

2020-06-26 Thread Mikulas Patocka
Hi I suggest to join memalloc_noio and memalloc_nofs into just one flag that prevents both filesystem recursion and i/o recursion. Note that any I/O can recurse into a filesystem via the loop device, thus it doesn't make much sense to have a context where PF_MEMALLOC_NOFS is set and PF_MEMALLO

[dm-devel] dm-crypt hard lockup

2020-06-26 Thread Artur Paszkiewicz
Hi, I'm getting regular lockups which seem to be caused by dm-crypt. I reproduced it on vanilla v5.8-rc2, but I started regularly seeing this some time ago on openSUSE Tumbleweed kernels. It's easily reproducible (every time, after about a minute) when I run "make -j" on the linux kernel sources,

Re: [dm-devel] [RFC v2] Reed-Solomon Code: Update no_eras to the actual number of errors

2020-06-26 Thread Aiden Leong
Hi, You are right. I forgot the return value is number of errors rather than status code. Sorry to bother you. On 6/25/20 6:06 AM, Ferdinand Blomqvist wrote: Hi! On 2020-06-25 00:36:01, Aiden Leong wrote: Corr and eras_pos are updated to actual correction pattern and erasure positions, but

[dm-devel] [PATCH 6/6] mm: Add memalloc_nowait

2020-06-26 Thread Matthew Wilcox (Oracle)
Similar to memalloc_noio() and memalloc_nofs(), memalloc_nowait() guarantees we will not sleep to reclaim memory. Use it to simplify dm-bufio's allocations. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/md/dm-bufio.c| 30 -- include/linux/sched.h| 1 +

Re: [dm-devel] [RFC] Reed-Solomon Code: Update no_eras to the actual number of errors

2020-06-26 Thread Ferdinand Blomqvist
Hi, On 2020-06-25 14:46:11, Aiden Leong wrote: BTW: I do believe these functions should be split into a function family. It's really hard to call them correctly and hard to debug as well. I don't think the functions should be split up. Most probably it is the documentation that should be im

Re: [dm-devel] [PATCH 0/6] Overhaul memalloc_no*

2020-06-26 Thread Matthew Wilcox
On Thu, Jun 25, 2020 at 11:48:32AM -0700, Darrick J. Wong wrote: > On Thu, Jun 25, 2020 at 12:31:16PM +0100, Matthew Wilcox (Oracle) wrote: > > I want a memalloc_nowait like we have memalloc_noio and memalloc_nofs > > for an upcoming patch series, and Jens also wants it for non-blocking > > io_urin

Re: [dm-devel] [PATCH 0/6] Overhaul memalloc_no*

2020-06-26 Thread Matthew Wilcox
On Thu, Jun 25, 2020 at 10:36:11PM +0200, Michal Hocko wrote: > On Thu 25-06-20 11:48:32, Darrick J. Wong wrote: > > On Thu, Jun 25, 2020 at 12:31:16PM +0100, Matthew Wilcox (Oracle) wrote: > > > I want a memalloc_nowait like we have memalloc_noio and memalloc_nofs > > > for an upcoming patch serie

[dm-devel] [PATCH 0/6] Overhaul memalloc_no*

2020-06-26 Thread Matthew Wilcox (Oracle)
I want a memalloc_nowait like we have memalloc_noio and memalloc_nofs for an upcoming patch series, and Jens also wants it for non-blocking io_uring. It turns out we already have dm-bufio which could benefit from memalloc_nowait, so it may as well go into the tree now. The biggest problem is that

Re: [dm-devel] [PATCH 6/6] mm: Add memalloc_nowait

2020-06-26 Thread Matthew Wilcox
On Thu, Jun 25, 2020 at 02:40:17PM +0200, Michal Hocko wrote: > On Thu 25-06-20 12:31:22, Matthew Wilcox wrote: > > Similar to memalloc_noio() and memalloc_nofs(), memalloc_nowait() > > guarantees we will not sleep to reclaim memory. Use it to simplify > > dm-bufio's allocations. > > memalloc_now

Re: [dm-devel] [RFC v2] Reed-Solomon Code: Update no_eras to the actual number of errors

2020-06-26 Thread Ferdinand Blomqvist
Hi! On 2020-06-25 00:36:01, Aiden Leong wrote: Corr and eras_pos are updated to actual correction pattern and erasure positions, but no_eras is not. When this library is used to recover lost bytes, we normally memset the lost trunk of bytes to zero as a placeholder. Unfortunately, if the lost b

Re: [dm-devel] [PATCH 1/6] mm: Replace PF_MEMALLOC_NOIO with memalloc_noio

2020-06-26 Thread Matthew Wilcox
On Thu, Jun 25, 2020 at 02:22:39PM +0200, Michal Hocko wrote: > On Thu 25-06-20 12:31:17, Matthew Wilcox wrote: > > We're short on PF_* flags, so make memalloc_noio its own bit where we > > have plenty of space. > > I do not mind moving that outside of the PF_* space. Unless I > misremember all fl

[dm-devel] [PATCH 3/6] xfs: Convert to memalloc_nofs_save

2020-06-26 Thread Matthew Wilcox (Oracle)
Instead of using custom macros to set/restore PF_MEMALLOC_NOFS, use memalloc_nofs_save() like the rest of the kernel. Signed-off-by: Matthew Wilcox (Oracle) --- fs/xfs/kmem.c | 2 +- fs/xfs/xfs_aops.c | 4 ++-- fs/xfs/xfs_buf.c | 2 +- fs/xfs/xfs_linux.h | 6 -- fs/xfs/xfs_trans.

[dm-devel] [PATCH 4/6] mm: Replace PF_MEMALLOC_NOFS with memalloc_nofs

2020-06-26 Thread Matthew Wilcox (Oracle)
We're short on PF_* flags, so make memalloc_nofs its own bit where we have plenty of space. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 2 +- include/linux/sched.h| 2 +- include/linux/sched/mm.h | 13 ++--- 3 files changed, 8 insertions(+), 9 deletions(-)

[dm-devel] [PATCH 5/6] mm: Replace PF_MEMALLOC_NOIO with memalloc_nocma

2020-06-26 Thread Matthew Wilcox (Oracle)
We're short on PF_* flags, so make memalloc_nocma its own bit where we have plenty of space. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/sched.h| 2 +- include/linux/sched/mm.h | 15 +++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/linux/sc

[dm-devel] [PATCH 1/6] mm: Replace PF_MEMALLOC_NOIO with memalloc_noio

2020-06-26 Thread Matthew Wilcox (Oracle)
We're short on PF_* flags, so make memalloc_noio its own bit where we have plenty of space. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/block/loop.c | 3 ++- drivers/md/dm-zoned-metadata.c | 5 ++--- include/linux/sched.h | 2 +- include/linux/sched/mm.h | 30 +

[dm-devel] [PATCH 2/6] mm: Add become_kswapd and restore_kswapd

2020-06-26 Thread Matthew Wilcox (Oracle)
Since XFS needs to pretend to be kswapd in some of its worker threads, create methods to save & restore kswapd state. Don't bother restoring kswapd state in kswapd -- the only time we reach this code is when we're exiting and the task_struct is about to be destroyed anyway. Signed-off-by: Matthew