Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-09-11 Thread Mikulas Patocka
On Fri, 25 Aug 2017, Tom Yan wrote: > On 20 August 2017 at 01:34, Mikulas Patocka wrote: > > > > If you issue a single ioctl that takes extreme amount of time - the kernel > > warns about being blocked for extreme amount of time - what else should it > > do? > > > > But

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-25 Thread Tom Yan
On 20 August 2017 at 01:34, Mikulas Patocka wrote: > > If you issue a single ioctl that takes extreme amount of time - the kernel > warns about being blocked for extreme amount of time - what else should it > do? > But as I said, it does NOT warn about being blocked if the

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-21 Thread John Stoffel
> "Mikulas" == Mikulas Patocka writes: Mikulas> On Fri, 18 Aug 2017, John Stoffel wrote: Mikulas> The limit can't be changed. I expect that no one will run a system with Mikulas> such a tight requirements that the memory is used up to the last 2%. >> Mikulas> If the

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-19 Thread Mikulas Patocka
On Wed, 16 Aug 2017, Tom Yan wrote: > What I find suspicious is `blkdiscard -z` the underlying device does > not lead to those warning (while it takes the same amount of time), it > makes me wonder if it's like, the dm layer is not doing certain thing > it should do to inform the block layer or

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-18 Thread Bart Van Assche
On Fri, 2017-08-18 at 20:18 -0400, Mikulas Patocka wrote: > Some times ago I made a patch that limits the number of in-flight bios in > device mapper - see this: > http://people.redhat.com/~mpatocka/patches/kernel/dm-limit-outstanding-bios/ It would be great to have this functionality upstream

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-18 Thread Mikulas Patocka
On Fri, 18 Aug 2017, John Stoffel wrote: > Mikulas> The limit can't be changed. I expect that no one will run a system > with > Mikulas> such a tight requirements that the memory is used up to the last 2%. > > Mikulas> If the user is near hitting the memory limit, he can just add swap >

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-18 Thread Mikulas Patocka
On Thu, 17 Aug 2017, John Stoffel wrote: > > "Mikulas" == Mikulas Patocka writes: > > Mikulas> On Mon, 14 Aug 2017, John Stoffel wrote: > > >> > "Mikulas" == Mikulas Patocka writes: > >> > Mikulas> dm-crypt consumes excessive amount memory

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-17 Thread John Stoffel
> "Mikulas" == Mikulas Patocka writes: Mikulas> On Mon, 14 Aug 2017, John Stoffel wrote: >> > "Mikulas" == Mikulas Patocka writes: >> Mikulas> dm-crypt consumes excessive amount memory when the user attempts to zero Mikulas> a dm-crypt device

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-16 Thread Tom Yan
On 15 August 2017 at 08:20, Mikulas Patocka wrote: > > It happens because encryption is too slow, it takes more than 120 seconds > to clear the device. I don't know what else it should do. It is not easy > to interrupt the operation because you would then have to deal with >

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-15 Thread Tom Yan
Just tested the patch with kernel 4.12.6. Well it sort of worked. No more OOM or kernel panic. Memory takeup is around ~250M on a machine with 8G RAM. However I keep getting this: Aug 15 04:04:10 archlinux kernel: INFO: task blkdiscard:538 blocked for more than 120 seconds. Aug 15 04:04:10

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-14 Thread Mikulas Patocka
On Tue, 15 Aug 2017, Tom Yan wrote: > Just tested the patch with kernel 4.12.6. Well it sort of worked. No > more OOM or kernel panic. Memory takeup is around ~250M on a machine > with 8G RAM. However I keep getting this: > > Aug 15 04:04:10 archlinux kernel: INFO: task blkdiscard:538 blocked

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-14 Thread Mikulas Patocka
On Mon, 14 Aug 2017, John Stoffel wrote: > > "Mikulas" == Mikulas Patocka writes: > > Mikulas> dm-crypt consumes excessive amount memory when the user attempts to > zero > Mikulas> a dm-crypt device with "blkdiscard -z". The command "blkdiscard -z" > calls >

Re: [dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-14 Thread John Stoffel
> "Mikulas" == Mikulas Patocka writes: Mikulas> dm-crypt consumes excessive amount memory when the user attempts to zero Mikulas> a dm-crypt device with "blkdiscard -z". The command "blkdiscard -z" calls Mikulas> the BLKZEROOUT ioctl, it goes to the function

[dm-devel] [PATCH] dm-crypt: limit the number of allocated pages

2017-08-13 Thread Mikulas Patocka
dm-crypt consumes excessive amount memory when the user attempts to zero a dm-crypt device with "blkdiscard -z". The command "blkdiscard -z" calls the BLKZEROOUT ioctl, it goes to the function __blkdev_issue_zeroout, __blkdev_issue_zeroout sends large amount of write bios that contain the zero