Re: [Devel] [RFC PATCH vz9 5/5] ploop: convert wait_list and wb_batch_llist to use lockless lists

2024-10-09 Thread Denis V. Lunev
On 10/7/24 13:12, Alexander Atanasov wrote: Convert to lockless lists - intermix with regular list due to that next pointer in both list_head and llist_head is the first field, and prev is not used. Do this so we can make babysteps forward. Signed-off-by: Alexander Atanasov --- drivers/md/dm-

Re: [Devel] [RFC PATCH vz9 5/5] ploop: convert wait_list and wb_batch_llist to use lockless lists

2024-10-09 Thread Alexander Atanasov
On 9.10.24 19:09, Denis V. Lunev wrote: On 10/7/24 13:12, Alexander Atanasov wrote: Convert to lockless lists - intermix with regular list due to that next pointer in both list_head and llist_head is the first field, and prev is not used. Do this so we can make babysteps forward. [cut] I obser

Re: [Devel] [PATCH VZ9 v2 0/6] ploop BAT optimizations

2024-10-09 Thread Denis V. Lunev
On 10/9/24 14:17, Andrey Zhadchenko wrote: With this patchset, we start to check if the upcoming requests for ploop have REQ_FUA flag. If the flag is present: - IO submits immediately, completion waits for BAT update - BAT updates submit immediately - set IOCB_DSYNC for writes and BAT updat

Re: [Devel] [PATCH VZ9 v2 0/6] ploop BAT optimizations

2024-10-09 Thread Denis V. Lunev
On 10/9/24 16:33, Denis V. Lunev wrote: On 10/9/24 14:17, Andrey Zhadchenko wrote: With this patchset, we start to check if the upcoming requests for ploop have REQ_FUA flag. If the flag is present:   - IO submits immediately, completion waits for BAT update   - BAT updates submit immediately  

Re: [Devel] [RFC PATCH vz9 5/5] ploop: convert wait_list and wb_batch_llist to use lockless lists

2024-10-09 Thread Denis V. Lunev
On 10/9/24 18:18, Alexander Atanasov wrote: On 9.10.24 19:09, Denis V. Lunev wrote: On 10/7/24 13:12, Alexander Atanasov wrote: Convert to lockless lists - intermix with regular list due to that next pointer in both list_head and llist_head is the first field, and prev is not used. Do this so w

Re: [Devel] [PATCH VZ9 v2 0/6] ploop BAT optimizations

2024-10-09 Thread Alexander Atanasov
Hi, I haven't went in deep but one thing that looks suspicious is in 6/6 patch + if (pio->bi_op & REQ_PREFLUSH && (pio->bi_op & REQ_OP_MASK) != REQ_OP_FLUSH) { + flush_pio = ploop_alloc_pio(ploop, GFP_NOIO); + if (!flush_pio) { + pio->bi_status

Re: [Devel] [PATCH VZ9 v2 0/6] ploop BAT optimizations

2024-10-09 Thread Andrey Zhadchenko
On 10/9/24 17:35, Alexander Atanasov wrote: Hi, I haven't went in deep but one thing that looks suspicious is in 6/6 patch +    if (pio->bi_op & REQ_PREFLUSH && (pio->bi_op & REQ_OP_MASK) != REQ_OP_FLUSH) { +    flush_pio = ploop_alloc_pio(ploop, GFP_NOIO); +    if (!flush_pio) { + 

Re: [Devel] [PATCH vz9] ploop: fsync after all pios are sent

2024-10-09 Thread Alexander Atanasov
On 9.10.24 15:43, Andrey Zhadchenko wrote: On 10/8/24 13:46, Alexander Atanasov wrote: On 8.10.24 14:35, Andrey Zhadchenko wrote: Code from ploop_dispatch_pio(): if (pio->queue_list_id == PLOOP_LIST_FLUSH)     *is_flush = true; else     *is_data = true; So I think

Re: [Devel] [PATCH vz9] ploop: fsync after all pios are sent

2024-10-09 Thread Andrey Zhadchenko
On 10/8/24 13:46, Alexander Atanasov wrote: On 8.10.24 14:35, Andrey Zhadchenko wrote: On 10/4/24 09:58, Alexander Atanasov wrote: Currently there are two workers one to handle pios, one to handle flush (via vfs_fsync). This workers are created unbound which means they are run whenever ther

Re: [Devel] [PATCH vz9] ploop: fsync after all pios are sent

2024-10-09 Thread Andrey Zhadchenko
On 10/9/24 14:45, Alexander Atanasov wrote: On 9.10.24 15:43, Andrey Zhadchenko wrote: On 10/8/24 13:46, Alexander Atanasov wrote: On 8.10.24 14:35, Andrey Zhadchenko wrote: Code from ploop_dispatch_pio():  if (pio->queue_list_id == PLOOP_LIST_FLUSH) *is_flush = true;  

Re: [Devel] [PATCH vz9] ploop: kmap all md_pages at creation time

2024-10-09 Thread Andrey Zhadchenko
On 9/30/24 19:32, Alexander Atanasov wrote: md_page is always present in memory. In that case md_page->page could be mapped once and we would not need to perform kmap_atomic/kunmap_atomic for each access. https://virtuozzo.atlassian.net/browse/VSTOR-91659 Suggested-by: Denis V. Lunev Signed-

[Devel] [PATCH VZ9 v2 1/6] dm-ploop: do not flush after metadata writes

2024-10-09 Thread Andrey Zhadchenko
Flushed should be explicitly called by the writer if he really wants it. Drop ploop_md_write_endio() and ploop_md_fsync_endio(). https://virtuozzo.atlassian.net/browse/VSTOR-91817 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploop-map.c | 31 +++ 1 file changed,

[Devel] [PATCH VZ9 v2 6/6] dm-ploop: handle REQ_PREFLUSH

2024-10-09 Thread Andrey Zhadchenko
Create new flush pio when we see REQ_PREFLUSH flag. Call original pio after the flush is done. https://virtuozzo.atlassian.net/browse/VSTOR-91817 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploop-map.c | 39 ++- 1 file changed, 34 insertions(+), 5 delet

[Devel] [PATCH VZ9 v2 4/6] dm-ploop: add delay for metadata writeback

2024-10-09 Thread Andrey Zhadchenko
Create new list for priority metadata updates, which are triggered by FUA requests. Write metadata for all other requests in batch after some delay. Add new parameter to specify delay time. https://virtuozzo.atlassian.net/browse/VSTOR-91817 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploo

[Devel] [PATCH VZ9 v2 5/6] dm-ploop: submit all postponed metadata on REQ_OP_FLUSH

2024-10-09 Thread Andrey Zhadchenko
On every flush request we should submit all accumulated metadata changes, wait for their completion and only then do the flush. https://virtuozzo.atlassian.net/browse/VSTOR-91817 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploop-map.c | 44 +++ drivers/

[Devel] [PATCH VZ9 v2 0/6] ploop BAT optimizations

2024-10-09 Thread Andrey Zhadchenko
With this patchset, we start to check if the upcoming requests for ploop have REQ_FUA flag. If the flag is present: - IO submits immediately, completion waits for BAT update - BAT updates submit immediately - set IOCB_DSYNC for writes and BAT updates - BAT update does not trigger flush If the f

[Devel] [PATCH VZ9 v2 3/6] dm-ploop: do not wait for BAT update for non-FUA requests

2024-10-09 Thread Andrey Zhadchenko
https://virtuozzo.atlassian.net/browse/VSTOR-91817 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploop-map.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c index 0eba5ce31643..313d1e6ad535 100644 --- a/drivers/md

[Devel] [PATCH VZ9 v2 2/6] dm-ploop: set IOCB_DSYNC on all FUA requests

2024-10-09 Thread Andrey Zhadchenko
When mapping request, save all flags, rather then only operation type. Use it later to check if the request is FUA or not. Unfortunately there is no REQ_FUA equivalent on IOCB layer, but IOCB_DSYNC is usually translated to it, as can be seen in __iomap_dio_rw(). https://virtuozzo.atlassian.net/bro

Re: [Devel] [PATCH vz9] ploop: kmap all md_pages at creation time

2024-10-09 Thread Alexander Atanasov
Hi, On 9.10.24 16:13, Andrey Zhadchenko wrote: On 9/30/24 19:32, Alexander Atanasov wrote: md_page is always present in memory. In that case md_page->page could be mapped once and we would not need to perform kmap_atomic/kunmap_atomic for each access. https://virtuozzo.atlassian.net/browse/V