Re: [PATCH] zsmalloc: do not use bit_spin_lock

2021-01-14 Thread Sebastian Andrzej Siewior
On 2021-01-14 18:15:08 [+0100], Vitaly Wool wrote: > > Basically, yes. Minchan was very clear that he didn't want to remove > that inter-function locking, so be it. > I wouldn't really advise to use zsmalloc with zswap because zsmalloc > has no support for reclaim, nevertheless I wouldn't like thi

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2021-01-14 Thread Vitaly Wool
On Thu, Jan 14, 2021 at 5:56 PM Sebastian Andrzej Siewior wrote: > > On 2021-01-14 17:29:37 [+0100], Vitaly Wool wrote: > > On Thu, 14 Jan 2021, 17:18 Sebastian Andrzej Siewior, > > wrote: > > > > > > On 2020-12-23 19:25:02 [+0100], Vitaly Wool wrote: > > > > > write the following patch according

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2021-01-14 Thread Sebastian Andrzej Siewior
On 2021-01-14 17:29:37 [+0100], Vitaly Wool wrote: > On Thu, 14 Jan 2021, 17:18 Sebastian Andrzej Siewior, > wrote: > > > > On 2020-12-23 19:25:02 [+0100], Vitaly Wool wrote: > > > > write the following patch according to your idea, what do you think ? > > > > > > Yep, that is basically what I was

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2021-01-14 Thread Vitaly Wool
On Thu, 14 Jan 2021, 17:18 Sebastian Andrzej Siewior, wrote: > > On 2020-12-23 19:25:02 [+0100], Vitaly Wool wrote: > > > write the following patch according to your idea, what do you think ? > > > > Yep, that is basically what I was thinking of. Some nitpicks below: > > Did this go somewhere? The

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2021-01-14 Thread Sebastian Andrzej Siewior
On 2020-12-23 19:25:02 [+0100], Vitaly Wool wrote: > > write the following patch according to your idea, what do you think ? > > Yep, that is basically what I was thinking of. Some nitpicks below: Did this go somewhere? The thread just ends here on my end. Mike, is this patch fixing / helping you

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2021-01-14 Thread Sebastian Andrzej Siewior
On 2020-12-20 08:21:37 [+0100], Vitaly Wool wrote: > Not really because bit spinlock leaves preemption disabled. It leaves it disabled for a reason. Now you just spin until the original context gets back on the CPU. On UP with preemption, if the "lock owner" gets preempted, the next lock attempt w

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-23 Thread Vitaly Wool
gt;> wrote: > >>>> > >>>> > >>>>> -Original Message- > >>>>> From: Song Bao Hua (Barry Song) > >>>>> Sent: Tuesday, December 22, 2020 3:03 PM > >>>>> To: 'Vitaly Wool' > >

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-23 Thread tiantao (H)
Galbraith ; LKML ; linux-mm ; Sebastian Andrzej Siewior ; NitinGupta ; Sergey Senozhatsky ; Andrew Morton ; tiantao (H) Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock On Tue, 22 Dec 2020, 03:11 Song Bao Hua (Barry Song), wrote: -Original Message- From: Song Bao Hua (Barry Song

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-22 Thread Vitaly Wool
; Minchan Kim ; > > Mike > > Galbraith ; LKML ; linux-mm > > ; Sebastian Andrzej Siewior ; > > NitinGupta ; Sergey Senozhatsky > > ; Andrew Morton > > ; tiantao (H) > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > > > On Tue, 22 D

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-22 Thread Song Bao Hua (Barry Song)
pta ; Sergey Senozhatsky > ; Andrew Morton > ; tiantao (H) > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > On Tue, 22 Dec 2020, 03:11 Song Bao Hua (Barry Song), > wrote: > > > > > > > > > -Original Message- > > > From: Son

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-22 Thread Vitaly Wool
t; Mike > > Galbraith ; LKML ; linux-mm > > ; Sebastian Andrzej Siewior ; > > NitinGupta ; Sergey Senozhatsky > > ; Andrew Morton > > ; tiantao (H) > > Subject: RE: [PATCH] zsmalloc: do not use bit_spin_lock > > > > > > > I'm still not c

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-22 Thread David Laight
From: Song Bao Hua > Sent: 21 December 2020 23:02 ... > > For decompression, I would like as low latency as possible which I > > think is only possible by doing decompression on a cpu synchronously. > > One possibility is that we change HW accelerator driver to be sync > polling for decompression.

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
y > ; Andrew Morton > ; tiantao (H) > Subject: RE: [PATCH] zsmalloc: do not use bit_spin_lock > > > > I'm still not convinced. Will kmap what, src? At this point src might become > just a bogus pointer. > > As long as the memory is still there, we can kmap it b

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
> I'm still not convinced. Will kmap what, src? At this point src might become > just a bogus pointer. As long as the memory is still there, we can kmap it by its page struct. But if it is not there anymore, we have no way. > Why couldn't the object have been moved somewhere else (due to the c

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
sky > ; Andrew Morton > > Subject: RE: [PATCH] zsmalloc: do not use bit_spin_lock > > > > > -Original Message- > > From: Vitaly Wool [mailto:vitaly.w...@konsulko.com] > > Sent: Tuesday, December 22, 2020 2:00 PM > > To: Song Bao Hua (Barry Song)

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
pta ; Sergey Senozhatsky > ; Andrew Morton > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > On Tue, Dec 22, 2020 at 12:37 AM Song Bao Hua (Barry Song) > wrote: > > > > > > > > > -Original Message- > > > From: Song Bao Hua

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Vitaly Wool
n Kim ; > > Mike > > Galbraith ; LKML ; linux-mm > > ; Sebastian Andrzej Siewior ; > > NitinGupta ; Sergey Senozhatsky > > ; Andrew Morton > > > > Subject: RE: [PATCH] zsmalloc: do not use bit_spin_lock > > > > > > > > > -Original

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
sky > ; Andrew Morton > > Subject: RE: [PATCH] zsmalloc: do not use bit_spin_lock > > > > > -Original Message- > > From: Vitaly Wool [mailto:vitaly.w...@konsulko.com] > > Sent: Tuesday, December 22, 2020 11:12 AM > > To: Song Bao Hua (Barry Song)

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
pta ; Sergey Senozhatsky > ; Andrew Morton > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > On Mon, Dec 21, 2020 at 1:30 PM Song Bao Hua (Barry Song) > wrote: > > > > > > > > > -Original Message- > > > From: Shakeel But

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Shakeel Butt
; Minchan Kim > > ; > > Mike Galbraith ; LKML ; > > linux-mm > > ; Sebastian Andrzej Siewior ; > > NitinGupta ; Sergey Senozhatsky > > ; Andrew Morton > > > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > > > On Mon, Dec

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
pta ; Sergey Senozhatsky > ; Andrew Morton > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > On Mon, Dec 21, 2020 at 10:30 PM Song Bao Hua (Barry Song) > wrote: > > > > > > > > > -Original Message- > > > From: Shakeel But

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Vitaly Wool
; Minchan Kim > > ; > > Mike Galbraith ; LKML ; > > linux-mm > > ; Sebastian Andrzej Siewior ; > > NitinGupta ; Sergey Senozhatsky > > ; Andrew Morton > > > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > > > On Mon, Dec

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
pta ; Sergey Senozhatsky > ; Andrew Morton > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > On Mon, Dec 21, 2020 at 12:06 PM Song Bao Hua (Barry Song) > wrote: > > > > > > > > > -Original Message- > > > From: Shakeel Bu

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Shakeel Butt
th ; LKML > > ; linux-mm ; Song Bao Hua > > (Barry Song) ; Sebastian Andrzej Siewior > > ; NitinGupta ; Sergey Senozhatsky > > ; Andrew Morton > > > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > > > On Mon, Dec 21, 2020 at 11:20 AM

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Minchan Kim
On Mon, Dec 21, 2020 at 08:20:26PM +0100, Vitaly Wool wrote: > On Mon, Dec 21, 2020 at 6:24 PM Minchan Kim wrote: > > > > On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > > > zsmalloc takes bit spinlock in its _map() callback and releases it > > > only in unmap() which is unsafe and

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Song Bao Hua (Barry Song)
pta ; Sergey Senozhatsky > ; Andrew Morton > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > On Mon, Dec 21, 2020 at 11:20 AM Vitaly Wool wrote: > > > > On Mon, Dec 21, 2020 at 6:24 PM Minchan Kim wrote: > > > > > > On Sun, Dec 20, 2020 at 02:

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Shakeel Butt
On Mon, Dec 21, 2020 at 11:20 AM Vitaly Wool wrote: > > On Mon, Dec 21, 2020 at 6:24 PM Minchan Kim wrote: > > > > On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > > > zsmalloc takes bit spinlock in its _map() callback and releases it > > > only in unmap() which is unsafe and leads

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Vitaly Wool
On Mon, Dec 21, 2020 at 6:24 PM Minchan Kim wrote: > > On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > > zsmalloc takes bit spinlock in its _map() callback and releases it > > only in unmap() which is unsafe and leads to zswap complaining > > about scheduling in atomic context. > >

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Minchan Kim
On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > zsmalloc takes bit spinlock in its _map() callback and releases it > only in unmap() which is unsafe and leads to zswap complaining > about scheduling in atomic context. > > To fix that and to improve RT properties of zsmalloc, remove

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-20 Thread Mike Galbraith
a (Barry Song) ; Sebastian > > Andrzej > > Siewior ; Minchan Kim ; > > NitinGupta > > > > Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock > > > > On Sun, 2020-12-20 at 02:23 +0100, Mike Galbraith wrote: > > > On Sun, 2020-12-20 at 02:2

RE: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-20 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Mike Galbraith [mailto:efa...@gmx.de] > Sent: Sunday, December 20, 2020 8:48 PM > To: Vitaly Wool ; LKML > ; linux-mm > Cc: Song Bao Hua (Barry Song) ; Sebastian Andrzej > Siewior ; Minchan Kim ; NitinGupta > > Subject: Re: [

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-19 Thread Mike Galbraith
On Sun, 2020-12-20 at 02:23 +0100, Mike Galbraith wrote: > On Sun, 2020-12-20 at 02:22 +0200, Vitaly Wool wrote: > > zsmalloc takes bit spinlock in its _map() callback and releases it > > only in unmap() which is unsafe and leads to zswap complaining > > about scheduling in atomic context. > > > >

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-19 Thread Vitaly Wool
On Sun, Dec 20, 2020 at 2:18 AM Matthew Wilcox wrote: > > On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > > zsmalloc takes bit spinlock in its _map() callback and releases it > > only in unmap() which is unsafe and leads to zswap complaining > > about scheduling in atomic context. >

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-19 Thread Mike Galbraith
On Sun, 2020-12-20 at 02:23 +0100, Mike Galbraith wrote: > On Sun, 2020-12-20 at 02:22 +0200, Vitaly Wool wrote: > > zsmalloc takes bit spinlock in its _map() callback and releases it > > only in unmap() which is unsafe and leads to zswap complaining > > about scheduling in atomic context. > > > >

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-19 Thread Mike Galbraith
On Sun, 2020-12-20 at 02:22 +0200, Vitaly Wool wrote: > zsmalloc takes bit spinlock in its _map() callback and releases it > only in unmap() which is unsafe and leads to zswap complaining > about scheduling in atomic context. > > To fix that and to improve RT properties of zsmalloc, remove that > b

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-19 Thread Mike Galbraith
On Sun, 2020-12-20 at 02:22 +0200, Vitaly Wool wrote: > zsmalloc takes bit spinlock in its _map() callback and releases it > only in unmap() which is unsafe and leads to zswap complaining > about scheduling in atomic context. > > To fix that and to improve RT properties of zsmalloc, remove that > b

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-19 Thread Matthew Wilcox
On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > zsmalloc takes bit spinlock in its _map() callback and releases it > only in unmap() which is unsafe and leads to zswap complaining > about scheduling in atomic context. > > To fix that and to improve RT properties of zsmalloc, remove