mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qiliang Yuan <qiliang.yuan@linux.dev>
To: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Qiliang Yuan <qiliang.yuan@linux.dev>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dm thin: free thins with kfree_rcu() instead of waiting in thin_dtr()
Date: Thu, 19 Nov 2026 01:14:27 -0500	[thread overview]
Message-ID: <20261119061427.1452945-1-qiliang.yuan@linux.dev> (raw)
In-Reply-To: <20261119051620.507189-1-bmarzins@redhat.com>

On Thu, Nov 19, 2026 at 12:16:20AM -0500, Benjamin Marzinski wrote:
> Qiliang, does this version work for you? Could you rerun the timing?

It works. I applied it on top of mainline 63fdb511c27af plus v2 1/3, the
thin_ctr() patch, with a test-only 3 s msleep() added to the pool worker
after each thin it walks. Thins 1 and 2 of a three-thin pool are
suspended and then removed while the worker holds thin 1:

- With your patch, KASAN reports nothing in 5 of 5 trials.
- With v2 1/3 alone, the guest crashes on the first trial; earlier
  runs of the same test reported a slab-use-after-free in
  get_next_thin() in 3 of 3.

A 300 s run of thins being created and removed while the worker walks
the list, on the same KASAN and lockdep kernel, logged no kernel errors.

Removing 100 thin devices of an idle pool with dmsetup remove takes per
device (same boot, mean of five rounds, min-max of the rounds in
parentheses). All kernels are mainline 63fdb511c27af with the patches
listed; the change is against "v2 1/3", the thin_ctr() patch alone:

  patches on top of mainline           remove (ms)        change
  none                                 17.0 (16.6-17.6)
  v2 1/3                               16.8 (16.5-17.1)
  v2 1/3 + your [PATCH v2]             13.9 (13.1-14.6)     -17%
  v2 1/3, 2/3 and 3/3                  14.1 (13.7-14.4)     -16%

Thanks,
Qiliang

  reply	other threads:[~2026-11-19  6:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  5:12 [PATCH 0/2] dm thin: stop waiting for grace periods when activating and removing thins Qiliang Yuan
2026-11-16  5:12 ` [PATCH 1/2] dm thin: drop the grace period from thin_ctr() Qiliang Yuan
2026-11-18  0:51   ` Benjamin Marzinski
2026-11-16  5:12 ` [PATCH 2/2] dm thin: free thins with kfree_rcu() instead of waiting in thin_dtr() Qiliang Yuan
2026-11-18  1:13   ` Benjamin Marzinski
2026-11-19  5:16   ` [PATCH v2] " Benjamin Marzinski
2026-11-19  6:14     ` Qiliang Yuan [this message]
2026-11-19  5:24 ` [PATCH 0/2] dm thin: stop waiting for grace periods when activating and removing thins Benjamin Marzinski
2026-11-19  5:46   ` Qiliang Yuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261119061427.1452945-1-qiliang.yuan@linux.dev \
    --to=qiliang.yuan@linux.dev \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®