dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: yangerkun@huawei.com, agk@redhat.com,
	Mike Snitzer <snitzer@kernel.org>,
	dm-devel@redhat.com, yangerkun <yangerkun@huaweicloud.com>
Subject: Re: [dm-devel] dm-crypt: fix softlockup in dmcrypt_write
Date: Mon, 6 Mar 2023 14:03:52 -0500 (EST)	[thread overview]
Message-ID: <alpine.LRH.2.21.2303061402020.3482@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <ee7a7a6a-ef46-f487-e78d-a828a4042393@acm.org>



On Mon, 6 Mar 2023, Bart Van Assche wrote:

> On 3/6/23 10:02, Mikulas Patocka wrote:
> > On Tue, 28 Feb 2023, yangerkun wrote:
> > > It's ok to fix the softlockup, but for async write encrypt,
> > > kcryptd_crypt_write_io_submit will add bio to write_tree, and once we
> > > call cond_resched before every kcryptd_io_write, the write performance
> > > may be poor while we meet a high cpu usage scene.
> > 
> > Hi
> > 
> > To fix this problem, find the PID of the process "dmcrypt_write" and
> > change its priority to -20, for example "renice -n -20 -p 34748".
> > 
> > This is the proper way how to fix it; locking up the process for one
> > second is not.
> > 
> > We used to have high-priority workqueues by default, but it caused audio
> > playback skipping, so we had to revert it - see
> > f612b2132db529feac4f965f28a1b9258ea7c22b.
> > 
> > Perhaps we should add an option to have high-priority kernel threads?
> 
> Would calling cond_resched() every n iterations instead of every iteration
> help? From mm/swapfile.c:
> 
> 			if (unlikely(--latency_ration < 0)) {
> 				cond_resched();
> 				latency_ration = LATENCY_LIMIT;
> 			}
> 
> Thanks,
> 
> Bart.

I think that if this helps, it is really a bug in the scheduler... It 
shouldn't switch tasks so often.

Mikulas
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2023-03-06 19:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  3:19 [dm-devel] [PATCH] dm-crypt: fix softlockup in dmcrypt_write yangerkun
2023-02-26  2:01 ` Bart Van Assche
2023-02-27  1:31   ` yangerkun
2023-02-27 17:55     ` [dm-devel] " Mike Snitzer
2023-02-27 18:03       ` Mike Snitzer
2023-02-27 18:06         ` Mike Snitzer
2023-02-28  1:40           ` yangerkun
2023-03-06 18:02             ` Mikulas Patocka
2023-03-06 18:16               ` Bart Van Assche
2023-03-06 19:03                 ` Mikulas Patocka [this message]
2023-02-28  1:25       ` yangerkun
2023-02-28  7:22         ` yangerkun

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=alpine.LRH.2.21.2303061402020.3482@file01.intranet.prod.int.rdu2.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=agk@redhat.com \
    --cc=bvanassche@acm.org \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yangerkun@huaweicloud.com \
    /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;
as well as URLs for NNTP newsgroup(s).