Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Sergey Senozhatsky
On (09/10/13 17:34), Sergey Senozhatsky wrote: [..] > > > > Now I think we can drop the call to handle_pending_slot_free() in > > zram_bvec_rw() altogether. As long as the write lock is held when > > handle_pending_slot_free() is called, there is no race. It's no different > > from any write

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Greg Kroah-Hartman
On Tue, Sep 10, 2013 at 05:58:02PM +0300, Dan Carpenter wrote: > Btw, the de...@driverdev.osuosl.org list seems to be down again. I > still have not recieved the v3 patch. Use the > driverdev-de...@linuxdriverproject.org email list instead. They are the same "list", just different DNS entries.

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Dan Carpenter
Btw, the de...@driverdev.osuosl.org list seems to be down again. I still have not recieved the v3 patch. Use the driverdev-de...@linuxdriverproject.org email list instead. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Sergey Senozhatsky
On (09/09/13 18:10), Jerome Marchand wrote: > On 09/09/2013 03:46 PM, Jerome Marchand wrote: > > On 09/09/2013 03:21 PM, Dan Carpenter wrote: > >> On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: > > Calling handle_pending_slot_free() for every RW operation may > > cause

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Sergey Senozhatsky
On (09/09/13 18:10), Jerome Marchand wrote: On 09/09/2013 03:46 PM, Jerome Marchand wrote: On 09/09/2013 03:21 PM, Dan Carpenter wrote: On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Dan Carpenter
Btw, the de...@driverdev.osuosl.org list seems to be down again. I still have not recieved the v3 patch. Use the driverdev-de...@linuxdriverproject.org email list instead. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Greg Kroah-Hartman
On Tue, Sep 10, 2013 at 05:58:02PM +0300, Dan Carpenter wrote: Btw, the de...@driverdev.osuosl.org list seems to be down again. I still have not recieved the v3 patch. Use the driverdev-de...@linuxdriverproject.org email list instead. They are the same list, just different DNS entries. I'll

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-10 Thread Sergey Senozhatsky
On (09/10/13 17:34), Sergey Senozhatsky wrote: [..] Now I think we can drop the call to handle_pending_slot_free() in zram_bvec_rw() altogether. As long as the write lock is held when handle_pending_slot_free() is called, there is no race. It's no different from any write request and

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Jerome Marchand
On 09/09/2013 03:46 PM, Jerome Marchand wrote: > On 09/09/2013 03:21 PM, Dan Carpenter wrote: >> On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: > Calling handle_pending_slot_free() for every RW operation may > cause unneccessary slot_free_lock locking, because most

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Sergey Senozhatsky
On (09/09/13 17:52), Dan Carpenter wrote: > On Mon, Sep 09, 2013 at 05:42:59PM +0300, Sergey Senozhatsky wrote: > > > 3) Explain why it is safe to test zram->slot_free_rq when we are not > > >holding the lock. I think it is unsafe. I don't want to even think > > >about it without the

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Dan Carpenter
On Mon, Sep 09, 2013 at 05:42:59PM +0300, Sergey Senozhatsky wrote: > > 3) Explain why it is safe to test zram->slot_free_rq when we are not > >holding the lock. I think it is unsafe. I don't want to even think > >about it without the numbers. > > atomic pointer test, which is either

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Sergey Senozhatsky
On (09/09/13 16:21), Dan Carpenter wrote: > On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: > > > > Calling handle_pending_slot_free() for every RW operation may > > > > cause unneccessary slot_free_lock locking, because most likely > > > > process will see NULL slot_free_rq.

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Jerome Marchand
On 09/09/2013 03:21 PM, Dan Carpenter wrote: > On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq.

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Dan Carpenter
On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: > > > Calling handle_pending_slot_free() for every RW operation may > > > cause unneccessary slot_free_lock locking, because most likely > > > process will see NULL slot_free_rq. handle_pending_slot_free() > > > only when current

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Sergey Senozhatsky
> > Calling handle_pending_slot_free() for every RW operation may > > cause unneccessary slot_free_lock locking, because most likely > > process will see NULL slot_free_rq. handle_pending_slot_free() > > only when current detects that slot_free_rq is not NULL. > > > > v2: protect

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Dan Carpenter
On Fri, Sep 06, 2013 at 06:12:55PM +0300, Sergey Senozhatsky wrote: > Calling handle_pending_slot_free() for every RW operation may > cause unneccessary slot_free_lock locking, because most likely > process will see NULL slot_free_rq. handle_pending_slot_free() > only when current detects that

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Dan Carpenter
On Fri, Sep 06, 2013 at 06:12:55PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq. handle_pending_slot_free() only when current detects that

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Sergey Senozhatsky
Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq. handle_pending_slot_free() only when current detects that slot_free_rq is not NULL. v2: protect handle_pending_slot_free()

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Dan Carpenter
On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq. handle_pending_slot_free() only when current detects that

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Jerome Marchand
On 09/09/2013 03:21 PM, Dan Carpenter wrote: On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq.

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Sergey Senozhatsky
On (09/09/13 16:21), Dan Carpenter wrote: On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq.

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Dan Carpenter
On Mon, Sep 09, 2013 at 05:42:59PM +0300, Sergey Senozhatsky wrote: 3) Explain why it is safe to test zram-slot_free_rq when we are not holding the lock. I think it is unsafe. I don't want to even think about it without the numbers. atomic pointer test, which is either NULL or

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Sergey Senozhatsky
On (09/09/13 17:52), Dan Carpenter wrote: On Mon, Sep 09, 2013 at 05:42:59PM +0300, Sergey Senozhatsky wrote: 3) Explain why it is safe to test zram-slot_free_rq when we are not holding the lock. I think it is unsafe. I don't want to even think about it without the numbers.

Re: [PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-09 Thread Jerome Marchand
On 09/09/2013 03:46 PM, Jerome Marchand wrote: On 09/09/2013 03:21 PM, Dan Carpenter wrote: On Mon, Sep 09, 2013 at 03:49:42PM +0300, Sergey Senozhatsky wrote: Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process

[PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-06 Thread Sergey Senozhatsky
Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq. handle_pending_slot_free() only when current detects that slot_free_rq is not NULL. v2: protect handle_pending_slot_free() with zram

[PATCH 1/2] staging: zram: minimize `slot_free_lock' usage (v2)

2013-09-06 Thread Sergey Senozhatsky
Calling handle_pending_slot_free() for every RW operation may cause unneccessary slot_free_lock locking, because most likely process will see NULL slot_free_rq. handle_pending_slot_free() only when current detects that slot_free_rq is not NULL. v2: protect handle_pending_slot_free() with zram