Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c| 39 ++--
drivers/md/dm-ploop-target.c | 23 +
drivers/md/dm-ploop.h| 2 ++
3 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/drivers/md/dm-ploop-map.c b/
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.
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
---
drivers/md
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c| 23 ---
drivers/md/dm-ploop-target.c | 3 ++-
drivers/md/dm-ploop.h| 2 +-
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers
now proper bitops are used for status we do not need to lock.
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-cmd.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 8bbb16
Split ploop_process_delta_cow in two - list iterator and processing
functions, unify handling with other pio types.
We need this to be able to call pio by pio from threads.
https://virtuozzo.atlassian.net/browse/VSTOR-91821
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c | 55 +++
Ploop processes requsts in a different threads in parallel
where possible which results in significant improvement in
performance and makes further optimistations possible.
Along with changes in v4:
- BAT writeback delay
- Lists/Locking moving to lockless lists to reduce locking
- Requests are
Do not bulk write all dirtied bat pages in a common timeout.
Instead mark dirty time for each page and delay for each page
by the timeout. If page is tried to be redirtied - update the
dirty time so for hot page try to accumulate more changes before
writeout.
https://virtuozzo.atlassian.net/browse
This was missed in an earlier patch and i've actually had a crash here.
https://virtuozzo.atlassian.net/browse/VSTOR-91821
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm
When doing utility operations we do not want to delay writeout
of dirty pages. Add interface to disable delay.
Hook it into suspend/resuming of sending pios. Which is done before
ops that require it.
https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Alexander Atanasov
---
drivers
There are some requirements listed in the comment inside
ploop_bat_write_complete
* Success: now update local BAT copy. We could do this
* from our delayed work, but we want to publish new
* mapping in the fastest way. This must be done before
* data bios completion
Currently lock is taken once for all pios submitted(code block),
move it to protect only the list insertion (data).
The goal is to reduce lock contention on the deferred lock as
it is in the top of lock stats.
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
--
From: Andrey Zhadchenko
We are planning to delay metadata writeback, so we want to
immediately apply metadata changes to BAT page.
Make all request that trigger PIWB_TYPE_RELOC apply metadata
changes immediately.
https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Andrey Zhadchenko
From the third glance it is fine, as for GFP_NOIO kvmalloc only does
kmalloc allocation and do not try vmalloc. Series is fine, but I will
resend it anyway, cause I found that there is already a patch in
mainstream which dublicates my first patch.
On 11/18/24 14:20, Pavel Tikhomirov wrote:
Oh,
From: 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 8c02095321c4..25d24f
Prepare for threads. Convert rwlock to spin lock.
This patch converts existing rwlocks only.
In the next one lock is used where required.
https://virtuozzo.atlassian.net/browse/VSTOR-91821
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-cmd.c| 8
drivers/md/dm-ploop-map.c
From: Andrey Zhadchenko
Currently we have single bat_rwlock for the whole ploop. However,
runtime locking granularity can be reduced to single metadata page.
In this patch, add rwlock to metadata structure, use it when
accessing md->levels and md->page at the sime time to protect
readers against
From: Andrey Zhadchenko
Do not bother with locked clusters. For llseek we can ignore all
concurrent operations.
Do not call ploop_bat_entries() on every cluster as this is slow.
Just remember md and read it directly.
https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Andrey Zhadch
*** JUST FOR TESTING - NOT TO BE APPLIED ***
Fast path results in rcu lockups and hangs.
The reason is that we got called from fs,
then we try to re-enter the fs but fs is not ready for this.
There is an idea to investigate - try to skip dispatcher thread
and directly execute in a runner thread.
From: Andrey Zhadchenko
Revert llist conversion for metadata writeback.
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.
Always submit COW and discard io to
From: 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| 42
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-cmd.c | 12 ++--
drivers/md/dm-ploop-map.c | 12 ++--
drivers/md/dm-ploop.h | 2 +-
3 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/drivers/md/dm-ploop
Prepare for threads. When preparing bat updates there are two important
things to protect - md->status MD_DIRTY bit and holes bitmap.
Use bat_lock to protect them.
https://virtuozzo.atlassian.net/browse/VSTOR-91821
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c | 83 +++
Process pios in runner threads while preserving order.
Metadata writeback requries all prios pios to be processed,
since they can generate updates, so we have to wait before
processing writeback. Fsync is yet sequential too.
Both can be improved in a next iterration.
https://virtuozzo.atlassian.n
From: Andrey Zhadchenko
as we already got all info from ploop_bat_entries() earlier.
https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Andrey Zhadchenko
---
drivers/md/dm-ploop-map.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-ploop
pios can get reordered, fix in the next commit.
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c| 119 ++-
drivers/md/dm-ploop-target.c | 6 +-
drivers/md/dm-ploop.h| 4 +-
3 files c
After a pio is split and prepared try to execute if immediately
without going to the worker thread.
https://virtuozzo.atlassian.net/browse/VSTOR-91820
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c | 92 ---
1 file changed, 67 insertions(+), 2
ktime_* are expnsive functions, we do not need ns precision.
using jiffies is fine.
https://virtuozzo.atlassian.net/browse/VSTOR-91821
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c | 9 -
drivers/md/dm-ploop.h | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
Currently data pios and fluses are separated into different lists before
handled to workqueue. This can lead to executing of flushes before relevant
data pios and it is not possible to get that dependancy in the worker.
So put both data and flush pios into prepare list. This way worker can
get sing
Create threads to execute pios in parallel - call them pio runners.
Use number of CPUs to determine the number of threads started.
>From worker each pio is sent to a thread in round-robin fashion
thru work_llist. Maintain the number of pios sent so we can wait
for them to be processed - NB we only
From: Andrey Zhadchenko
Drop ploop_cluster_is_in_top_delta(), because
- it internally searches md on every call
- it takes read lock every time
https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Andrey Zhadchenko
---
drivers/md/dm-ploop-map.c | 15 +++
1 file chang
From: 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://v
Prepare locking for threads. Some operations require to lock bat data
(see next patch) and in some cases we need to lock md page while hodling
bat spin lock but we can not take sleeping lock while holding a spin lock.
To address this use a spin lock for md pages instead of rwlock.
https://virtuoz
From: 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 | 41 +--
1 file changed,
Merging required to back this change, so do it again.
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c| 49 ++--
drivers/md/dm-ploop-target.c | 1 -
drivers/md/dm-ploop.h| 1 -
3 files changed, 25 insertions(+), 26 deletions(-)
diff -
*** JUST FOR TESTING - NOT TO BE APPLIED ***
Delayed metadata writeback results in a hang, disable
it until it is fixed. Pios end in the waiting list of
md and get stuck there never to complete.
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c | 3 ++-
1 file changed, 2 insertio
This is a base for moving to multithreaded model.
https://virtuozzo.atlassian.net/browse/VSTOR-91821
Signed-off-by: Alexander Atanasov
---
drivers/md/dm-ploop-map.c| 65
drivers/md/dm-ploop-target.c | 60 +
drivers/md/dm-pl
36 matches
Mail list logo