Re: [dm-devel] Snapshot origin table as P/PO snapshot with /dev/null

2016-05-26 Thread Mikulas Patocka
On Thu, 26 May 2016, Navin P.S wrote: > Hi, Can you please help me with the below query that i posted to dm-devel ? > > On Thu, May 26, 2016 at 5:07 AM, Navin P.S wrote: > Hi,  If i have a snapshot origin created using dmsetup create table > with a mapping  real

Re: [dm-devel] [PATCH] dm-log-writes: fix bug with too large bios

2016-06-01 Thread Mikulas Patocka
; > so we must do atomic_inc(>io_blocks) before invoking the error path to > > avoid underflow of lc->io_blocks. > > > > Signed-off-by: Mikulas Patocka <mpato...@redhat.com> > > Cc: sta...@vger.kernel.org # v4.1+ > > How does this relate to the previo

[dm-devel] [PATCH] dm: fix tio leak if clone_bio fails

2016-04-09 Thread Mikulas Patocka
dm: fix tio leak if clone_bio fails The patch c80914e81ec5b08fec0bae531e3445268c8820f4 ("dm: return error if bio_integrity_clone() fails in clone_bio()") changed the function clone_bio so that it can return an error. However, when the error happens, the structure dm_target_io is not freed.

Re: [dm-devel] [PATCH] md: simplify free_params for kmalloc vs vmalloc fallback

2016-04-28 Thread Mikulas Patocka
On Thu, 28 Apr 2016, Michal Hocko wrote: > On Thu 28-04-16 11:04:05, Mikulas Patocka wrote: > > Acked-by: Mikulas Patocka <mpato...@redhat.com> > > Thanks! > > > BTW. we could also use kvmalloc to complement kvfree, proposed here: > > https://www.re

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-25 Thread Mikulas Patocka
On Sat, 23 Jul 2016, NeilBrown wrote: > "dirtying ... from the reclaim context" ??? What does that mean? > According to > Commit: 26eecbf3543b ("[PATCH] vm: pageout throttling") > From the history tree, the purpose of throttle_vm_writeout() is to > limit the amount of memory that is

Re: [dm-devel] System freezes after OOM

2016-07-13 Thread Mikulas Patocka
On Wed, 13 Jul 2016, Michal Hocko wrote: > [CC David] > > > > It is caused by the commit f9054c70d28bc214b2857cf8db8269f4f45a5e23. > > > Prior to this commit, mempool allocations set __GFP_NOMEMALLOC, so > > > they never exhausted reserved memory. With this commit, mempool > > > allocations

Re: [dm-devel] System freezes after OOM

2016-07-13 Thread Mikulas Patocka
On Wed, 13 Jul 2016, Michal Hocko wrote: > On Wed 13-07-16 10:18:35, Mikulas Patocka wrote: > > > > > > On Wed, 13 Jul 2016, Michal Hocko wrote: > > > > > [CC David] > > > > > > > > It is caused by the commit f9054c70d28bc214b2857c

Re: [dm-devel] System freezes after OOM

2016-07-14 Thread Mikulas Patocka
On Thu, 14 Jul 2016, Michal Hocko wrote: > On Wed 13-07-16 11:02:15, Mikulas Patocka wrote: > > > diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c > > > index 4f3cb3554944..0b806810efab 100644 > > > --- a/drivers/md/dm-crypt.c > > > +++ b/

Re: [dm-devel] System freezes after OOM

2016-07-14 Thread Mikulas Patocka
On Thu, 14 Jul 2016, Michal Hocko wrote: > On Thu 14-07-16 10:00:16, Mikulas Patocka wrote: > > > > > > On Thu, 14 Jul 2016, Michal Hocko wrote: > > > > > On Wed 13-07-16 11:02:15, Mikulas Patocka wrote: > > > > > > > d

Re: [dm-devel] System freezes after OOM

2016-07-14 Thread Mikulas Patocka
On Wed, 13 Jul 2016, David Rientjes wrote: > On Wed, 13 Jul 2016, Mikulas Patocka wrote: > > > What are the real problems that f9054c70d28bc214b2857cf8db8269f4f45a5e23 > > tries to fix? > > > > It prevents the whole system from livelocking due to an oom kill

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-27 Thread Mikulas Patocka
On Wed, 27 Jul 2016, NeilBrown wrote: > On Tue, Jul 26 2016, Mikulas Patocka wrote: > > > On Sat, 23 Jul 2016, NeilBrown wrote: > > > >> "dirtying ... from the reclaim context" ??? What does that mean? > >> According to > >> Commit: 26

Re: [dm-devel] write directly to device mapper snapshot origin device ?

2016-07-15 Thread Mikulas Patocka
On Fri, 15 Jul 2016, Navin P.S wrote: > Resend .. > > On Thu, Jul 14, 2016 at 7:55 PM, Navin P.S wrote: > > Hi, > > Can i do dd if=/dev/zero of=/dev/mapper/dmo count=20 ? where dmo is > > a dm snapshot origin created through dmsetup command. Instead of > > /dev/zero i

Re: [dm-devel] System freezes after OOM

2016-07-15 Thread Mikulas Patocka
On Thu, 14 Jul 2016, David Rientjes wrote: > There is no guarantee that _anything_ can return memory to the mempool, You misunderstand mempools if you make such claims. There is in fact guarantee that objects will be returned to mempool. In the past I reviewed device mapper thoroughly to

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-07-19 Thread Mikulas Patocka
ongested which sounds like a > proper reaction. > > Please note that the bonus given by domain_dirty_limits() alone is not > sufficient because at least dm-crypt has to double buffer each page > under writeback so this won't be sufficient to prevent from being > throttled. > >

Re: [dm-devel] [RFC PATCH 1/2] mempool: do not consume memory reserves from the reclaim path

2016-07-19 Thread Mikulas Patocka
deal with them so it is reasonable to rely on the same mechanism > rather inventing a different one which has negative side effects. > > Fixes: f9054c70d28b ("mm, mempool: only set __GFP_NOMEMALLOC if there are > free elements") > Bisected-by: Mikulas Patocka <mpat

Re: [dm-devel] write directly to device mapper snapshot origin device ?

2016-07-15 Thread Mikulas Patocka
> Are origin devices readonly ? > > When i do dd if=/dev/zero of=/dev/mapper/ff count=10, it kills all the > process says OOM. > > How do you go about debugging this ? I'm running 4.7.0-rc7+ . Find some older kernel where this worked. Use the git bisect tool on the kernel tree to find out

Re: [dm-devel] System freezes after OOM

2016-07-15 Thread Mikulas Patocka
On Fri, 15 Jul 2016, Michal Hocko wrote: > On Thu 14-07-16 13:35:35, Mikulas Patocka wrote: > > On Thu, 14 Jul 2016, Michal Hocko wrote: > > > On Thu 14-07-16 10:00:16, Mikulas Patocka wrote: > > > > But it needs other changes to honor the PF_LESS_THROTTLE fla

Re: [dm-devel] System freezes after OOM

2016-07-15 Thread Mikulas Patocka
On Fri, 15 Jul 2016, Michal Hocko wrote: > On Fri 15-07-16 08:11:22, Mikulas Patocka wrote: > > > > The stacktraces showed that the kcryptd process was throttled when it > > tried to do mempool allocation. Mempool adds the __GFP_NORETRY flag to the > > all

Re: [dm-devel] System freezes after OOM

2016-07-15 Thread Mikulas Patocka
On Fri, 15 Jul 2016, David Rientjes wrote: > On Fri, 15 Jul 2016, Mikulas Patocka wrote: > > > > There is no guarantee that _anything_ can return memory to the mempool, > > > > You misunderstand mempools if you make such claims. > > > >

[dm-devel] [PATCH] dm-crypt: increase mempool size

2016-07-15 Thread Mikulas Patocka
Increase mempool size from 16 to 64 entries. When swapping to dm-crypt, all available memory is temporarily exhausted and dm-crypt is only using the mempool reserve. Increasing mempool reserve improves swapping performance. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> Index: lin

Re: [dm-devel] System freezes after OOM

2016-07-13 Thread Mikulas Patocka
is in progress, the free memory is below the limit (because the swapping activity itself consumes any memory over the limit). And that triggered the OOM killer prematurely. On Tue, 12 Jul 2016, Michal Hocko wrote: > On Mon 11-07-16 11:43:02, Mikulas Patocka wrote: > [...] > > The gen

Re: [dm-devel] System freezes after OOM

2016-07-13 Thread Mikulas Patocka
On Mon, 11 Jul 2016, Ondrej Kozina wrote: > On 07/11/2016 01:55 PM, Jerome Marchand wrote: > > On 07/11/2016 01:03 PM, Stanislav Kozina wrote: > > > Hi Jerome, > > > > > > On upstream mailing lists there have been reports of freezing systems > > > due to OOM. Ondra (on CC) managed to reproduce

Re: [dm-devel] System freezes after OOM

2016-07-15 Thread Mikulas Patocka
On Fri, 15 Jul 2016, David Rientjes wrote: > Kworkers are processing writeback, ext4_writepages() relies on kmem that ext4_writepages is above device mapper, not below, so how it could block device mapper progress? Do you use device mapper on the top of block loop device? Writing to loop

[dm-devel] [PATCH 2/3] block: prepare for timed bio offload

2016-06-28 Thread Mikulas Patocka
Replace the pointer current->bio_list with structure queued_bios. It is a prerequisite for the following patch that will use the timer placed in this structure. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- block/bio.c |6 +++--- block/blk-core.c

[dm-devel] [PATCH 1/3] block: flush queued bios when process blocks to avoid deadlock

2016-06-28 Thread Mikulas Patocka
>From f126e182a053ef2e44a3e70b86df84d2b003530b Mon Sep 17 00:00:00 2001 From: Mikulas Patocka <mpato...@redhat.com> Date: Tue, 27 May 2014 11:03:36 -0400 Subject: block: flush queued bios when process blocks to avoid deadlock The block layer uses per-process bio list to avoid

[dm-devel] [PATCH 0/3] offload bios to a thread

2016-06-28 Thread Mikulas Patocka
Hi Here I'm sending three patches to fix the deadlocks in snapshot and snapshot-merge. The first patch fixes the deadlock, the following 2 patches introduce a timer, so that bios are not offloaded immediatelly, they are offloaded after a specified timeout, because immediate offloading can

[dm-devel] [PATCH 3/3] block: use timed offload

2016-06-28 Thread Mikulas Patocka
nge ordering of bios and it could theoretically cause performance regressions. So, we offload bios only if the process is blocked for a certain amount of time. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- block/bio.c | 45 + block/b

Re: [dm-devel] [PATCH 0/3] offload bios to a thread

2016-07-04 Thread Mikulas Patocka
On Mon, 4 Jul 2016, Lars Ellenberg wrote: > On Thu, Jun 30, 2016 at 07:15:18PM -0400, Mike Snitzer wrote: > > > Lars, please feel free to see if this set addresses the similar deadlock > > > you saw/fixed with drbd. > > I'm pretty sure it will help, but will confirm. > > > > We need to

Re: [dm-devel] [PATCH 0/3] offload bios to a thread

2016-07-04 Thread Mikulas Patocka
On Thu, 30 Jun 2016, Mike Snitzer wrote: > [cc'ing linux-block and drbd folks] > > On Tue, Jun 28 2016 at 8:16pm -0400, > Mikulas Patocka <mpato...@redhat.com> wrote: > > > Hi > > > > Here I'm sending three patches to fix the deadlocks in snapshot and

[dm-devel] [PATCH 1/3] block: flush queued bios when process blocks to avoid deadlock

2016-07-04 Thread Mikulas Patocka
_write(>lock) that is held by Process B (in step 5). Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1267650 Signed-off-by: Mikulas Patocka <mpato...@redhat.com> Signed-off-by: Mike Snitzer <snit...@redhat.com> Depends-on: df2cb6daa4 ("block: Avoid deadlocks with bio all

[dm-devel] [PATCH 0/3] offload bios to a thread

2016-07-04 Thread Mikulas Patocka
Hi This is the second version of patches that fix deadlocks by redirecting bios from current->bio_list to rescuer workqueues. I found out that the original patches caused deadlock with the loopback device. When the loopback device is used, both lower and upper filesystems use the same bio set

[dm-devel] [PATCH 2/3] block: prepare for timed bio offload

2016-07-04 Thread Mikulas Patocka
Replace the pointer current->bio_list with structure queued_bios. It is a prerequisite for the following patch that will use the timer placed in this structure. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- block/bio.c |6 +++--- block/blk-core.c

Re: [dm-devel] [PATCH 0/3] offload bios to a thread

2016-07-06 Thread Mikulas Patocka
On Wed, 6 Jul 2016, Mike Snitzer wrote: > On Mon, Jul 04 2016 at 6:53pm -0400, > Mikulas Patocka <mpato...@redhat.com> wrote: > > > Hi > > > > This is the second version of patches that fix deadlocks by redirecting > > bios from current->bio_list t

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-08-04 Thread Mikulas Patocka
On Wed, 3 Aug 2016, Michal Hocko wrote: > > > Even mempool allocations shouldn't allow reclaim to > > > scan pages too quickly even when LRU lists are full of dirty pages. But > > > as I've said that would restrict the success rates even under light page > > > cache load. Throttling on the

Re: [dm-devel] [RFC PATCH 2/2] mm, mempool: do not throttle PF_LESS_THROTTLE tasks

2016-08-03 Thread Mikulas Patocka
On Wed, 27 Jul 2016, Michal Hocko wrote: > On Wed 27-07-16 10:28:40, Mikulas Patocka wrote: > > > > > > On Wed, 27 Jul 2016, NeilBrown wrote: > > > > > On Tue, Jul 26 2016, Mikulas Patocka wrote: > > > > > > > On Sat, 23 Jul 2

Re: [dm-devel] dm-crypt: Fix error with too large bios

2016-08-15 Thread Mikulas Patocka
On Sat, 13 Aug 2016, Mike Snitzer wrote: > [top-posting just because others went wild with it] > > I don't have a strong opinion but I just assumed the local dm-crypt > workaround wasn't the way forward. I didn't stage it because Christoph > disagreed with it: >

Re: [dm-devel] [PATCH] dm-crypt: fix wrong use of RCU on key payload handling

2017-01-31 Thread Mikulas Patocka
Hi I think that touching the internals of the key structure and duplicating the function user_key_payload in dm-crypt is not quite right. Duplicating the code is bad and duplicating it in a different module is even worse - after long time it becomes problematic to find all the duplicates. I

Re: [dm-devel] [PATCH v2] dm-crypt: replace RCU read-side section with rwsem

2017-01-31 Thread Mikulas Patocka
Reviewed-by: Mikulas Patocka <mpato...@redhat.com> On Tue, 31 Jan 2017, Ondrej Kozina wrote: > The lockdep splat bellow hints a bug in RCU usage in dm-crypt > since kernel keyring fn user_key_payload() is in fact a wrapper > for rcu_dereference_protected() which must not be cal

Re: [dm-devel] v4.9, 4.4-final: 28 bioset threads on small notebook, 36 threads on cellphone

2017-02-14 Thread Mikulas Patocka
; > busy and this issue is "hard". > > Mike, it's not my job to debug DM code for you or sift through your bug > reports. > I don't read dm-devel, and I don't know why you think I that's my job. > > If there's something you think the block layer should be doing

[dm-devel] [PATCH] dm-crypt: rename crypt_setkey_allcpus to crypt_setkey

2016-08-25 Thread Mikulas Patocka
-by: Mikulas Patocka <mpato...@redhat.com> Index: linux-2.6/drivers/md/dm-crypt.c === --- linux-2.6.orig/drivers/md/dm-crypt.c +++ linux-2.6/drivers/md/dm-crypt.c @@ -1470,7 +1470,7 @@ static int crypt_alloc_tfms(struct crypt re

[dm-devel] [PATCH] Re: your dm patch for strace

2016-08-25 Thread Mikulas Patocka
On Wed, 24 Aug 2016, Masatake YAMATO wrote: > >> Are you talking about > >> https://sourceforge.net/p/strace/mailman/message/34370586/ ? > > > > Yes. > > > >> The thread has apparently died without any follow-up from your side. > > > > I didn't receive that last message, it was probably

Re: [dm-devel] dm-crypt: Fix error with too large bios

2016-08-29 Thread Mikulas Patocka
On Mon, 29 Aug 2016, Ming Lei wrote: > On Sat, Aug 27, 2016 at 11:09 PM, Mikulas Patocka <mpato...@redhat.com> wrote: > > > > > > On Fri, 26 Aug 2016, Mike Snitzer wrote: > > > >> On Thu, Aug 25 2016 at 4:13pm -0400, > >> Jens Axboe <ax..

Re: [dm-devel] dm-crypt: Fix error with too large bios

2016-08-30 Thread Mikulas Patocka
On Tue, 30 Aug 2016, Mike Snitzer wrote: > On Tue, Aug 30 2016 at 8:19P -0400, > Mikulas Patocka <mpato...@redhat.com> wrote: > > > > > > > On Tue, 30 Aug 2016, Ming Lei wrote: > > > > > On Tue, Aug 30, 2016 at 5:57 AM, Mi

Re: [dm-devel] dm-crypt: Fix error with too large bios

2016-08-30 Thread Mikulas Patocka
On Tue, 30 Aug 2016, Ming Lei wrote: > On Tue, Aug 30, 2016 at 5:57 AM, Mikulas Patocka <mpato...@redhat.com> wrote: > > > > > > On Mon, 29 Aug 2016, Ming Lei wrote: > > > >> On Sat, Aug 27, 2016 at 11:09 PM, Mikulas Patocka <mpato...@redhat.com>

Re: [dm-devel] [PATCH] dm crypt: fix crash on exit

2016-09-22 Thread Mikulas Patocka
Reviewed-by: Mikulas Patocka <mpato...@redhat.com> On Wed, 21 Sep 2016, Rabin Vincent wrote: > From: Rabin Vincent <rab...@axis.com> > > As the documentation for kthread_stop() says, "if threadfn() may call > do_exit() itself, the caller must ensure task_struct ca

Re: [dm-devel] [RFC][PATCH] dm: Remove dm_bufio_cond_resched()

2016-09-22 Thread Mikulas Patocka
radead.org> > Date: Tue, 13 Sep 2016 10:45:20 +0200 > > Remove pointless local wrappery. Use cond_resched() like everybody else. > > Cc: Ingo Molnar <mi...@kernel.org> > Cc: Mikulas Patocka <mpato...@redhat.com> > Cc: Mike Snitzer <snit...@redhat.com>

Re: [dm-devel] [RFC][PATCH] dm: Remove dm_bufio_cond_resched()

2016-09-19 Thread Mikulas Patocka
On Tue, 13 Sep 2016, Peter Zijlstra wrote: > Hi all, > > While grepping for PREEMPT_VOLUNTARY I ran into dm_bufio_cond_resched() > and wondered WTH it was about. cond_resched() calls _cond_resched() even if when we have a preemptive kernel - with preemptive kernel, calling cond_resched is

Re: [dm-devel] dm-crypt: Fix error with too large bios

2016-08-27 Thread Mikulas Patocka
On Fri, 26 Aug 2016, Mike Snitzer wrote: > On Thu, Aug 25 2016 at 4:13pm -0400, > Jens Axboe <ax...@kernel.dk> wrote: > > > On 08/25/2016 12:34 PM, Mikulas Patocka wrote: > > > > > >Device mapper can't split the bio in generic_make_request - it fre

Re: [dm-devel] [PATCH] Re: your dm patch for strace

2016-10-02 Thread Mikulas Patocka
On Mon, 12 Sep 2016, Dmitry V. Levin wrote: > > + tprintf("}"); > > + if (entering(tcp)) > > + offset = offset + s->next; > > + else > > + offset = ioc->data_start + s->next; > > This code

[dm-devel] [PATCH 2/4] brd: extend rcu read sections

2016-10-26 Thread Mikulas Patocka
is not supposed to race with discard. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- drivers/block/brd.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) Index: linux-2.6/drivers/block/brd.c === ---

[dm-devel] [PATCH 3/4] brd: implement discard

2016-10-26 Thread Mikulas Patocka
ould mount the filesystem without "-o discard". Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- drivers/block/brd.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) Index: lin

[dm-devel] [PATCH 4/4] brd: remove unused brd_zero_page

2016-10-26 Thread Mikulas Patocka
-by: Mikulas Patocka <mpato...@redhat.com> --- drivers/block/brd.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) Index: linux-2.6/drivers/block/brd.c === --- linux-2.6.orig/drivers/block/brd.c +++ lin

[dm-devel] [PATCH 1/4] brd: handle misaligned discard

2016-10-26 Thread Mikulas Patocka
The brd driver refuses misaligned discard requests with an error. However, this is suboptimal, misaligned requests could be handled by discarding a part of the request that is aligned on a page boundary. This patch changes the code so that it handles misaligned requests. Signed-off-by: Mikulas

[dm-devel] [PATCH 0/4] brd: support discard

2016-10-26 Thread Mikulas Patocka
On Tue, 25 Oct 2016, Jens Axboe wrote: > On 10/25/2016 08:37 AM, Mike Snitzer wrote: > > On Tue, Oct 25 2016 at 9:07P -0400, > > Christoph Hellwig wrote: > > > > > I think the right fix is to kill off the BLKFLSBUF special case in > > > brd. Yes, it break compatibility -

Re: [dm-devel] REQ_OP for zeroing, was Re: [PATCH 1/4] brd: handle misaligned discard

2016-10-30 Thread Mikulas Patocka
On Wed, 26 Oct 2016, Christoph Hellwig wrote: > On Wed, Oct 26, 2016 at 05:46:11PM -0400, Mikulas Patocka wrote: > > I think the proper thing would be to move "discard_zeroes_data" flag into > > the bio itself - there would be REQ_OP_DISCARD and REQ_OP_DISCARD_ZERO

[dm-devel] [PATCH] device mapper ioctl

2016-10-19 Thread Mikulas Patocka
On Wed, 12 Oct 2016, Eugene Syromyatnikov wrote: > Hello. > > Aside from additional checks themselves, this patchset also contains two > notable changes: > * Fix for the previous patchset - misplaced comma printing ("dm: Fix comma >printing for the case when dm_target_msg structure is

[dm-devel] dm-crypt accepts '+' in the key

2016-11-12 Thread Mikulas Patocka
Hi dm-crypt uses the function kstrtou8 to decode the encryption key. kstrtou8 calls kstrtoull and kstrtoull skips the first character if it is '+'. Consequently, it is possible to load keys with '+' in it. For example, this is possible: dmsetup create cr --table "0 131072 crypt

[dm-devel] [PATCH] RFC: dm: avoid the mutex lock in dm_bufio_shrink_count()

2016-11-23 Thread Mikulas Patocka
(!dm_bufio_trylock(c)) > > - return 0; > > > > - count = c->n_buffers[LIST_CLEAN] + c->n_buffers[LIST_DIRTY]; > > - dm_bufio_unlock(c); > > - return count; > > + return c->n_all_buffers; > > } > > > > /* > > Would b

Re: [dm-devel] dm-crypt accepts '+' in the key

2016-11-14 Thread Mikulas Patocka
On Mon, 14 Nov 2016, Alexey Dobriyan wrote: > On Sun, Nov 13, 2016 at 03:45:27PM +0100, Milan Broz wrote: > > On 11/12/2016 09:20 PM, Mikulas Patocka wrote: > > > Hi > > > > > > dm-crypt uses the function kstrtou8 to decode the encryption key. &

Re: [dm-devel] [PATCH 1/4] brd: handle misaligned discard

2016-10-31 Thread Mikulas Patocka
On Fri, 28 Oct 2016, Bart Van Assche wrote: > On 10/28/2016 04:39 AM, Mikulas Patocka wrote: > > On Wed, 26 Oct 2016, Bart Van Assche wrote: > > > On 10/26/2016 02:46 PM, Mikulas Patocka wrote: > > > > I think the proper thing would be to m

Re: [dm-devel] REQ_OP for zeroing, was Re: [PATCH 1/4] brd: handle misaligned discard

2016-10-31 Thread Mikulas Patocka
On Fri, 28 Oct 2016, Christoph Hellwig wrote: > [adding Chaitanya to Cc] > > On Fri, Oct 28, 2016 at 07:43:41AM -0400, Mikulas Patocka wrote: > > We could detect if the REQ_OP_WRITE_SAME command contains all zeroes and > > if it does, turn it into "Write Zeroes"

Re: [dm-devel] [PATCH 1/4] brd: handle misaligned discard

2016-10-28 Thread Mikulas Patocka
On Wed, 26 Oct 2016, Bart Van Assche wrote: > On 10/26/2016 02:46 PM, Mikulas Patocka wrote: > > I don't like the idea of complicating the code by turning discards into > > writes. > > That's not what my patch series does. The only writes added by my patch series &g

Re: [dm-devel] [PATCH] Re: your dm patch for strace

2016-10-10 Thread Mikulas Patocka
On Wed, 5 Oct 2016, Masatake YAMATO wrote: > I tested the patch and it works fine. > Could you add following patch if you approve? > > commit bae7528fa92283726caac1ec7a6c306274f8899d > Author: Masatake YAMATO > Date: Mon Aug 22 17:44:55 2016 +0900 > > dm-ioctl: add a

Re: [dm-devel] [PATCH] dm: Avoid sleeping while holding the dm_bufio lock

2016-12-08 Thread Mikulas Patocka
On Wed, 7 Dec 2016, Doug Anderson wrote: > Hi, > > On Wed, Nov 23, 2016 at 12:57 PM, Mikulas Patocka <mpato...@redhat.com> wrote: > > Hi > > > > The GFP_NOIO allocation frees clean cached pages. The GFP_NOWAIT > > allocation doesn't. You

Re: [dm-devel] [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2017-01-06 Thread Mikulas Patocka
On Fri, 6 Jan 2017, Mikulas Patocka wrote: > > > On Wed, 4 Jan 2017, Mike Snitzer wrote: > > > On Wed, Jan 04 2017 at 12:12am -0500, > > NeilBrown <ne...@suse.com> wrote: > > > > > > Suggested-by: NeilBrown <ne...@suse.com> > &g

Re: [dm-devel] [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2017-01-06 Thread Mikulas Patocka
On Wed, 4 Jan 2017, Mike Snitzer wrote: > On Wed, Jan 04 2017 at 12:12am -0500, > NeilBrown wrote: > > > On Tue, Jan 03 2017, Jack Wang wrote: > > > > > 2016-12-23 12:45 GMT+01:00 Lars Ellenberg : > > >> On Fri, Dec 23, 2016 at 09:49:53AM +0100,

[dm-devel] [PATCH] dm-raid: select the config option CONFIG_MD_RAID0

2017-03-28 Thread Mikulas Patocka
Since the commit 0cf4503174c1, the dm-raid subsystem can activate a RAID-0 array. Therefore, add MD_RAID0 to the dependencies of DM_RAID, so that MD_RAID0 will be selected when DM_RAID is selected. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> Fixes: 0cf4503174c1 ("dm raid:

Re: [dm-devel] [bug report] dm: add integrity target

2017-03-15 Thread Mikulas Patocka
On Mon, 13 Mar 2017, Dan Carpenter wrote: > Hello Mikulas Patocka, > > The patch dfab77c854fc: "dm: add integrity target" from Jan 4, 2017, > leads to the following static checker warning: Hi I already removed this condition in my code. It comes from an old version wh

[dm-devel] [PATCH 4.9, 4.10] dm: flush queued bios when process blocks to avoid deadlock

2017-03-15 Thread Mikulas Patocka
Hi This is upstream patch d67a5f4b5947aba4bfe9a80a2b86079c215ca755, it is suitable for stable branch 4.9 and 4.10. I will send modified patches for older stable branches. Mikulas commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755 Author: Mikulas Patocka <mpato...@redhat.com> Date: Wed

[dm-devel] [PATCH 3.16, 4.1] dm: flush queued bios when process blocks to avoid deadlock

2017-03-15 Thread Mikulas Patocka
Hi This is backport of the upstram patch d67a5f4b5947aba4bfe9a80a2b86079c215ca755 for stable branches 3.16 and 4.1. Mikulas commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755 Author: Mikulas Patocka <mpato...@redhat.com> Date: Wed Feb 15 11:26:10 2017 -0500 dm: flush queued bio

[dm-devel] [PATCH 3.10, 3.12] dm: flush queued bios when process blocks to avoid deadlock

2017-03-15 Thread Mikulas Patocka
Hi This is backport of upstream commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755. It is suitable for stable branches 3.10 and 3.12. Mikulas commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755 Author: Mikulas Patocka <mpato...@redhat.com> Date: Wed Feb 15 11:26:10 2017 -0500 dm:

[dm-devel] [PATCH 4.4] dm: flush queued bios when process blocks to avoid deadlock

2017-03-15 Thread Mikulas Patocka
Hi This is backport of the upstream patch d67a5f4b5947aba4bfe9a80a2b86079c215ca755 for the stable branch 4.4. Mikulas commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755 Author: Mikulas Patocka <mpato...@redhat.com> Date: Wed Feb 15 11:26:10 2017 -0500 dm: flush queued bios when p

Re: [dm-devel] [PATCH] dm-region-hash: fix strange usage of mempool_alloc.

2017-04-21 Thread Mikulas Patocka
On Mon, 10 Apr 2017, NeilBrown wrote: > mempool_alloc() should only be called with GFP_ATOMIC when > it is not safe to wait. Passing __GFP_NOFAIL to kmalloc() > says that it is safe to wait indefinitely. So this code is > inconsistent. > > Clearly it is OK to wait indefinitely in this code,

[dm-devel] [PATCH] Re: [Report] crash tool cannot resolve struct dm_table properly

2017-04-13 Thread Mikulas Patocka
On Thu, 13 Apr 2017, Eric Ren wrote: > Hi, > > > On 04/13/2017 07:28 PM, Mikulas Patocka wrote: > > > > On Thu, 13 Apr 2017, Eric Ren wrote: > > > > > Hi Mikulas, > > > > > > When inspecting on coredump with crash tool, I fin

Re: [dm-devel] [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Mikulas Patocka
On Fri, 10 Mar 2017, Mike Snitzer wrote: > On Fri, Mar 10 2017 at 7:34am -0500, > Lars Ellenberg wrote: > > > > --- a/block/blk-core.c > > > +++ b/block/blk-core.c > > > @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) > > > */ > > > blk_qc_t

Re: [dm-devel] [PATCH] dm-integrity: Do not check integrity for failed read operations

2017-08-01 Thread Mikulas Patocka
On Tue, 1 Aug 2017, Milan Broz wrote: > On 07/31/2017 09:22 AM, Hyunchul Lee wrote: > > From: Hyunchul Lee > > > > Even though read operations fail, dm_integrity_map_continue() > > calls integrity_metadata() to check integrity. In this case, > > just complete these. > >

[dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-03 Thread Mikulas Patocka
and it should be reworked for the next merge window, so that it calls bio_integrity_verify_fn only for the lowest level. Mikulas From: Mikulas Patocka <mpato...@redhat.co> The patch 7c20f11680a441df09de7235206f70115fbf6290 ("bio-integrity: stop abusing bi_end_io") changes th

[dm-devel] [PATCH] fix an integer overflow in __blkdev_sectors_to_bio_pages

2017-08-14 Thread Mikulas Patocka
On Mon, 14 Aug 2017, Damien Le Moal wrote: > On Sun, 2017-08-13 at 22:47 -0400, Mikulas Patocka wrote: > > > > On Wed, 9 Aug 2017, h...@lst.de wrote: > > > > > Does commit 615d22a51c04856efe62af6e1d5b450aaf5cc2c0 > > > "block: Fix __blkd

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

2017-08-14 Thread Mikulas Patocka
Another case where it blows the memory is when you create a device that has an odd number of sectors (so block size 512 is used), use dm-crypt on this device and write to the encrypted device using the block device's page cache. In this case, dm-crypt receives large amount of 512-byte bios, allocate

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 <mpato...@redhat.com> writes: > > Mikulas> dm-crypt consumes excessive amount memory when the user attempts to > zero > Mikulas> a dm-crypt device with "blkdi

Re: [dm-devel] [BUG] BLKZEROOUT on dm-crypt container cause OOM / kernel panic

2017-08-13 Thread Mikulas Patocka
On Wed, 9 Aug 2017, h...@lst.de wrote: > Does commit 615d22a51c04856efe62af6e1d5b450aaf5cc2c0 > "block: Fix __blkdev_issue_zeroout loop" fix the issue for you? > > -- > dm-devel mailing list > dm-devel@redhat.com > https://www.redhat.com/mailman/listinfo/dm-devel I think that patch is

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

2017-08-13 Thread Mikulas Patocka
ause system crash. This patch fixes the bug by limiting the amount of memory that dm-crypt allocates to 2% of total system memory. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> Cc: sta...@vger.kernel.org --- drivers/md/dm-crypt.c | 60 +-

[dm-devel] [PATCH] an optimization for dm-bufio and dm-integrity

2017-07-19 Thread Mikulas Patocka
-- Date: Sun, 30 Apr 2017 17:31:22 -0400 (EDT) From: Mikulas Patocka <mpato...@redhat.com> To: Mike Snitzer <msnit...@redhat.com> Subject: [PATCH] an optimization for dm-bufio and dm-integrity Hi This is an optimization for dm-bufio and dm-integrity, so that it can wri

Re: [dm-devel] an optimization for dm-bufio and dm-integrity

2017-07-19 Thread Mikulas Patocka
On Wed, 19 Jul 2017, Milan Broz wrote: > On 07/19/2017 05:39 PM, Mike Snitzer wrote: > > On Wed, Jul 19 2017 at 11:30P -0400, > > Mikulas Patocka <mpato...@redhat.com> wrote: > > > >> Hi Mike > >> > >> Some times ago, I sent this patch as

Re: [dm-devel] dm-integrity: fix inefficient allocation of stack space

2017-07-20 Thread Mikulas Patocka
On Wed, 19 Jul 2017, Mike Snitzer wrote: > On Wed, Jul 19 2017 at 2:39pm -0400, > John Stoffel <j...@stoffel.org> wrote: > > > >>>>> "Mikulas" == Mikulas Patocka <mpato...@redhat.com> writes: > > > > Mikulas> When us

Re: [dm-devel] dm-integrity: fix inefficient allocation of stack space

2017-07-20 Thread Mikulas Patocka
On Wed, 19 Jul 2017, John Stoffel wrote: > I'd like to argue that you should never use BUG_ON at all, esp since > if you have integrity running on just one critical device, but have > other devices that work just fine, bringing down the entire system > because you don't think things are ok is

Re: [dm-devel] [PATCH] dm-integrity: fix inefficient allocation of stack space

2017-07-20 Thread Mikulas Patocka
On Wed, 19 Jul 2017, John Stoffel wrote: > >>>>> "Mikulas" == Mikulas Patocka <mpato...@redhat.com> writes: > > Mikulas> When using block size greater than 512 bytes, the dm-integrity target > Mikulas> allocates journal space inefficiently,

Re: [dm-devel] dm-integrity: fix inefficient allocation of stack space

2017-07-20 Thread Mikulas Patocka
On Thu, 20 Jul 2017, Mikulas Patocka wrote: > > > On Wed, 19 Jul 2017, John Stoffel wrote: > > > I'd like to argue that you should never use BUG_ON at all, esp since > > if you have integrity running on just one critical device, but have > > other devices that

Re: [dm-devel] [PATCH] dm-zoned: Use GFP_NOIO in I/O path

2017-07-24 Thread Mikulas Patocka
ursion to the filesystem. GFP_NOIO prevents allocator recursion to the filesystem and I/O stack. With GFP_NOFS, it is still theoretically possible that the allocation recurses into the I/O layer (for example when swapping to a block device). Mikulas > Problem reported by Mikulas Patocka <mpato..

[dm-devel] [PATCH] dm-integrity: fix inefficient allocation of stack space

2017-07-19 Thread Mikulas Patocka
severe performance degradation. This patch fixes the journal allocation. As a safety it also adds BUG that fires if the variables representing journal usage get out of sync (it's better to crash than continue and corrupt data, so BUG is justified). Signed-off-by: Mikulas Patocka <mpato...@redhat.

[dm-devel] [PATCH] dm-integrity: plug I/Os when writing the journal

2017-07-19 Thread Mikulas Patocka
When copying data from the journal to the appropriate place, we submit many I/Os. Some of these I/Os could go to adjacent areas. This patch uses the plug mechanism, so that the adjacent I/Os could be merged. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- drivers/md/dm-integ

[dm-devel] [PATCH] dm-zoned: remove test for impossible conditions

2017-07-21 Thread Mikulas Patocka
). Regarding this "if (!nr_sectors && bio_op(bio) != REQ_OP_WRITE)" - could this be removed too? Does it really process some zero-sized requests that are not flushes? It doesn't seem so. Mikulas From: Mikulas Patocka <mpato...@redhat.com> The value REQ_OP_FLUSH i

[dm-devel] [PATCH] dm-integrity: count failures

2017-07-21 Thread Mikulas Patocka
This is a patch to count errors in dm-integrity - as Jon suggested. This patch changes dm-integrity so that it counts the number of checksum failures and reports the counter in the status line. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- drivers/md/dm-integrity.c

[dm-devel] [PATCH] dm-integrity: test for corrupted disk format

2017-07-21 Thread Mikulas Patocka
-by: Mikulas Patocka <mpato...@redhat.com> Cc: sta...@vger.kernel.org Fixes: 7eada909bfd7 ("dm: add integrity target") --- drivers/md/dm-integrity.c |5 + 1 file changed, 5 insertions(+) Index: linux-2.6/drivers/m

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-05 Thread Mikulas Patocka
On Sat, 5 Aug 2017, Christoph Hellwig wrote: > > On Thu, Aug 03, 2017 at 10:10:55AM -0400, Mikulas Patocka wrote: > > That dm-crypt commit that uses bio integrity payload came 3 months before > > 7c20f11680a441df09de7235206f70115fbf6290 and it was already pr

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-06 Thread Mikulas Patocka
On Sat, 5 Aug 2017, Martin K. Petersen wrote: > Mikulas, > > > The sector number in the integrity tag must match the physical sector > > number. So, it must be verified at the bottom. > > The ref tag seed matches the submitter block number (typically block > layer sector for the top device)

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 <mpato...@redhat.com> writes: > > Mikulas> On Mon, 14 Aug 2017, John Stoffel wrote: > > >> >>>>> "Mikulas" == Mikulas Patocka <mpat

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-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-region-hash: fix strange usage of mempool_alloc.

2017-05-03 Thread Mikulas Patocka
On Mon, 24 Apr 2017, NeilBrown wrote: > On Fri, Apr 21 2017, Mikulas Patocka wrote: > > > On Mon, 10 Apr 2017, NeilBrown wrote: > > > >> mempool_alloc() should only be called with GFP_ATOMIC when > >> it is not safe to wait. Passing __GFP_NOFAIL to kmalloc

  1   2   3   4   5   6   7   8   9   10   >