Re: [PATCH 10/10] Replace tasklets with workqueues

2019-10-11 Thread Maksym Planeta
Hi, this is a kind reminder regarding the patchset. I added description of races in the original email. On 30/07/2019 21:20, Maksym Planeta wrote: On 25/07/2019 20:50, Jason Gunthorpe wrote: On Thu, Jul 25, 2019 at 04:36:20PM +0200, Maksym Planeta wrote: Is this one better? Replace

Re: [PATCH 10/10] Replace tasklets with workqueues

2019-07-30 Thread Maksym Planeta
On 25/07/2019 20:50, Jason Gunthorpe wrote: On Thu, Jul 25, 2019 at 04:36:20PM +0200, Maksym Planeta wrote: Is this one better? Replace tasklets with workqueues in rxe driver. The reason for this replacement is that tasklets are supposed to run atomically, although the actual code may block

Re: [PATCH 10/10] Replace tasklets with workqueues

2019-07-25 Thread Maksym Planeta
tly. On 22/07/2019 17:32, Jason Gunthorpe wrote: On Mon, Jul 22, 2019 at 05:14:26PM +0200, Maksym Planeta wrote: Replace tasklets with workqueues in rxe driver. Ensure that task is called only through a workqueue. This allows to simplify task logic. Add additional dependencies to make sure t

[PATCH 04/10] Protect kref_put with the lock

2019-07-22 Thread Maksym Planeta
Need to ensure that kref_put does not run concurrently with the loop inside rxe_pool_get_key. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_pool.c | 18 ++ drivers/infiniband/sw/rxe/rxe_pool.h | 4 +--- 2 files changed, 19 insertions(+), 3 deletions(-) diff

[PATCH 07/10] Pass the return value of kref_put further

2019-07-22 Thread Maksym Planeta
Used in a later patch. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_pool.c | 3 ++- drivers/infiniband/sw/rxe/rxe_pool.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c index

[PATCH 01/10] Simplify rxe_run_task interface

2019-07-22 Thread Maksym Planeta
Make rxe_run_task only schedule tasks and never run them directly. This simplification will be used in further patches. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_comp.c | 16 drivers/infiniband/sw/rxe/rxe_loc.h | 2 +- drivers/infiniband/sw/rxe

[PATCH 06/10] Remove pd form rxe_ah

2019-07-22 Thread Maksym Planeta
Pointer to PD is not used in rxe_ah anymore. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_verbs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h index 5c4b2239129c..8dd65c2a7c72 100644

[PATCH 09/10] Consolidate resetting of QP's tasks into one place

2019-07-22 Thread Maksym Planeta
Used in a later patch. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_loc.h | 1 + drivers/infiniband/sw/rxe/rxe_qp.c | 17 + drivers/infiniband/sw/rxe/rxe_req.c | 1 + drivers/infiniband/sw/rxe/rxe_resp.c | 25 ++--- 4 files changed

[PATCH 00/10] Refactor rxe driver to remove multiple race conditions

2019-07-22 Thread Maksym Planeta
This patchset helps to get rid of following race condition situations: 1. Tasklet functions were incrementing reference counting after entering running the tasklet. 2. Getting a pointer to reference counted object (kref)

[PATCH 02/10] Remove counter that does not have a meaning anymore

2019-07-22 Thread Maksym Planeta
After putting all tasks to schedule, this counter does not have a meaning anymore. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_comp.c| 6 -- drivers/infiniband/sw/rxe/rxe_hw_counters.c | 1 - drivers/infiniband/sw/rxe/rxe_hw_counters.h | 1 - 3 files changed, 8

[PATCH 10/10] Replace tasklets with workqueues

2019-07-22 Thread Maksym Planeta
by removing multiple race conditions and use-after-free situations. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_cq.c| 15 ++- drivers/infiniband/sw/rxe/rxe_net.c | 17 +++- drivers/infiniband/sw/rxe/rxe_qp.c| 73 --- drivers/infiniband/sw/rxe/rxe_req.c

[PATCH 05/10] Fix reference counting for rxe tasklets

2019-07-22 Thread Maksym Planeta
Reference should be aquired *before* the tasklet is run. The best time to increment the reference counter is at initialisation. Otherwise, the object may not exists anymore by the time tasklet is run. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_comp.c | 4 drivers

[PATCH 03/10] Make pool interface more type safe

2019-07-22 Thread Maksym Planeta
Replace void* with rxe_pool_entry* for some functions. Change macro to inline function. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_comp.c | 18 drivers/infiniband/sw/rxe/rxe_mcast.c | 20 drivers/infiniband/sw/rxe/rxe_mr.c| 8 ++-- drivers

[PATCH 08/10] Move responsibility of cleaning up pool elements

2019-07-22 Thread Maksym Planeta
Specific implementations must finish off the cleanup of pool elements when it is the right moment. Reason for that is that a concreate cleanup function may want postpone and schedule part of object destruction to later time. Signed-off-by: Maksym Planeta --- drivers/infiniband/sw/rxe/rxe_cq.c

Re: [PATCH 07/10] Pass the return value of kref_put further

2019-07-22 Thread Maksym Planeta
In a later patch I need to know if the dependency to QP object still exists or not. On 22/07/2019 17:29, Jason Gunthorpe wrote: On Mon, Jul 22, 2019 at 05:14:23PM +0200, Maksym Planeta wrote: Used in a later patch. Signed-off-by: Maksym Planeta drivers/infiniband/sw/rxe/rxe_pool.c | 3

Re: [PATCH 04/10] Protect kref_put with the lock

2019-07-22 Thread Maksym Planeta
On 22/07/2019 17:25, Jason Gunthorpe wrote: On Mon, Jul 22, 2019 at 05:14:20PM +0200, Maksym Planeta wrote: Need to ensure that kref_put does not run concurrently with the loop inside rxe_pool_get_key. Signed-off-by: Maksym Planeta drivers/infiniband/sw/rxe/rxe_pool.c | 18

Re: [PATCH] sysctl: Add a feature to drop caches selectively

2014-06-26 Thread Maksym Planeta
s give this > more thoughts, and come up with a deeper analysis. Interfaces are very > important to get right, or as right as possible... > > -- > Best Regards, > Artem Bityutskiy > -- Regards, Maksym Planeta. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] sysctl: Add a feature to drop caches selectively

2014-06-26 Thread Maksym Planeta
to solve... Sorry if I am a bit vague, I am mostly trying to make you guys give this more thoughts, and come up with a deeper analysis. Interfaces are very important to get right, or as right as possible... -- Best Regards, Artem Bityutskiy -- Regards, Maksym Planeta. -- To unsubscribe

[PATCH] sysctl: Add a feature to drop caches selectively

2014-06-24 Thread Maksym Planeta
To clean the page cache one can use /proc/sys/vm/drop_caches. But this drops the whole page cache. In contrast to that sdrop_caches enables ability to drop the page cache selectively by path string. Suggested-by: Thomas Knauth Signed-off-by: Maksym Planeta --- Documentation/sysctl/vm.txt | 15

[PATCH] sysctl: Add a feature to drop caches selectively

2014-06-24 Thread Maksym Planeta
To clean the page cache one can use /proc/sys/vm/drop_caches. But this drops the whole page cache. In contrast to that sdrop_caches enables ability to drop the page cache selectively by path string. Suggested-by: Thomas Knauth thomas.kna...@gmx.de Signed-off-by: Maksym Planeta mcsim.plan