[PATCH] zsmalloc: calling zs_map_object() from irq is a bug

2017-09-28 Thread Sergey Senozhatsky
Use BUG_ON(in_interrupt()) in zs_map_object(). This is not a new BUG_ON(), it's always been there, but was recently changed to VM_BUG_ON(). There are several problems there. First, we use use per-CPU mappings both in zsmalloc and in zram, and interrupt may easily corrupt those buffers. Second, and

Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug

2017-09-27 Thread Sergey Senozhatsky
On (09/26/17 17:26), Andrew Morton wrote: > > On Wed, Sep 20, 2017 at 03:39:41PM +0900, Sergey Senozhatsky wrote: > > > Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this > > > function from IRQ is a bug, because we use per-CPU mappings > > > and interrupt may corrupt those buffers. > > >

Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug

2017-09-26 Thread Andrew Morton
On Wed, 20 Sep 2017 15:47:39 +0900 Minchan Kim wrote: > On Wed, Sep 20, 2017 at 03:39:41PM +0900, Sergey Senozhatsky wrote: > > Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this > > function from IRQ is a bug, because we use per-CPU mappings > > and interrupt may corrupt those buffers.

Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug

2017-09-19 Thread Sergey Senozhatsky
On (09/20/17 15:47), Minchan Kim wrote: > On Wed, Sep 20, 2017 at 03:39:41PM +0900, Sergey Senozhatsky wrote: > > Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this > > function from IRQ is a bug, because we use per-CPU mappings > > and interrupt may corrupt those buffers. > > > > Signed-

Re: [PATCH] zsmalloc: calling zs_map_object() from irq is a bug

2017-09-19 Thread Minchan Kim
On Wed, Sep 20, 2017 at 03:39:41PM +0900, Sergey Senozhatsky wrote: > Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this > function from IRQ is a bug, because we use per-CPU mappings > and interrupt may corrupt those buffers. > > Signed-off-by: Sergey Senozhatsky IMHO, corruption the bu

[PATCH] zsmalloc: calling zs_map_object() from irq is a bug

2017-09-19 Thread Sergey Senozhatsky
Use BUG_ON(in_interrupt()) in zs_map_object(). Calling this function from IRQ is a bug, because we use per-CPU mappings and interrupt may corrupt those buffers. Signed-off-by: Sergey Senozhatsky --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zsmalloc.c b